Macro or script for implementing edits
Thread poster: Samuel Murray

Samuel Murray  Identity Verified
Netherlands
Local time: 09:27
Member (2006)
English to Afrikaans
+ ...
Dec 11, 2013

Hello everyone

I'm about to write some scripts to solve this problem myself, but I thought I'd first ask if there is an existing solution to it. Here's my situation:

I translated a DOC file, in a two-column format, and it was reviewed by a reviewer. The reviewer did his reviews in Excel, not in the DOC file. The Excel file contains three columns, namely for the source text, the original target text, and the updated target text. Unfortunately the reviewer did not include whole sentences in the Excel file but simply the least necessary text to identify the edit.

I must now implement the reviewer's edits myself, in the DOC file. Doing this manually will take a full day (there are about 500 edits over the course of 100 pages (mostly preferential changes, but I have to implement them if I accept them, or I have to say why I reject them if I don't implement them). There is no formatting in the DOC file, so any procedure can easily be done on plain text files or even on a TM.

For example, the DOC file might contain this:
The quick brown fox jumps over the lazy dog.[TAB]Die vinnige bruin vos spring oor die luie hond.

And the Excel file contains this:
lazy dog[TAB]luie hond[TAB]lui hond
quick[TAB]vinnige[TAB]blitsige

So, I need the DOC file to contain this:
The quick brown fox jumps over the lazy dog.[TAB]Die blitsige bruin vos spring oor die lui hond.

Does anyone know about a strategy for this?

Samuel


 

Rolf Keller
Germany
Local time: 09:27
English to German
Don't underestimate the possible problems Dec 11, 2013

Samuel Murray wrote:

I'm about to write some scripts to solve this problem myself


In order to make sure that your macro works correctly, you have to check the 100 resulting pages very thoroughly. This might take more time than doing the editing manually.


 

2nl (X)  Identity Verified
Netherlands
Local time: 09:27
PlusTools? Dec 11, 2013

Samuel Murray wrote:

The quick brown fox jumps over the lazy dog.[TAB]Die vinnige bruin vos spring oor die luie hond.

And the Excel file contains this:
lazy dog[TAB]luie hond[TAB]lui hond
quick[TAB]vinnige[TAB]blitsige

So, I need the DOC file to contain this:
The quick brown fox jumps over the lazy dog.[TAB]Die blitsige bruin vos spring oor die lui hond.

Does anyone know about a strategy for this?


Allereers gecondoleerd met die verlies van julle voormalige president. Weet jy seker dat dit nie net met PlusTools moontlik is?


 

Samuel Murray  Identity Verified
Netherlands
Local time: 09:27
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
Okay, here's what I did (licked it in the end) Dec 12, 2013

Samuel Murray wrote:
For example, the DOC file might contain this:
The quick brown fox jumps over the lazy dog.[TAB]Die vinnige bruin vos spring oor die luie hond.

And the Excel file contains this:
lazy[TAB]luie[TAB]lui
quick[TAB]vinnige[TAB]blitsige

So, I need the DOC file to contain this:
The quick brown fox jumps over the lazy dog.[TAB]Die blitsige bruin vos spring oor die lui hond.


Well, okay, the first thing I tried was to turn the Excel file into a glossary and then go through the DOC file as if I'm proofreading a translation, and that worked, but it was really, really slow. I also realised that the editor sometimes did not indicate changes on subsequent pages if the same edit was made on a previous page, so I finally assumed that if the editor wanted an edit on page one, then he must want the same edit on page 40, unless it obviously does not fit.

In the end, I realised that the quickest, most efficient way to do this would be by using a script. The script is here, if you want it.

Essentially, the script does this action:

- for each segment...
- for each glossary item...
- if source text contains source term, and
- if target text contains target term, then
- replace target term in target text with replacer term
- next
- next

And if your glossary is in this format:

lazy dog luie hond [[l#u#i#]]{{l#u#i#e#}}
quick vinnige [[b#l#i#t#s#i#g#e#]]{{v#i#n#n#i#g#e#}}

Then the output file will look like this:

Die [[blitsige]]{{vinnige}} bruin vos spring oor die [[lui]]{{luie}} hond.

And then you can use a Word macro to turn that into "real" tracked changes:



Samuel

[Edited at 2013-12-12 21:50 GMT]


 

Luca Tutino  Identity Verified
Italy
Local time: 09:27
Member (2002)
English to Italian
+ ...
Bravo! Dec 13, 2013

Well done! And thank you , I did not even know about AutoIt.

It was worth just for the satisfaction. I can see that you did it in about one day, but I would also be curious to know how many hours did it really take you to make it, clean it and get it working.

Luca


 

Samuel Murray  Identity Verified
Netherlands
Local time: 09:27
Member (2006)
English to Afrikaans
+ ...
TOPIC STARTER
@Luca Dec 13, 2013

Luca Tutino wrote:
I can see that you did it in about one day, but I would also be curious to know how many hours did it really take you to make it, clean it and get it working.


Well, when the problem first cropped up, I immediately thought of using a script, and the final script had pretty much the same design as that which I though of at the very beginning.

I'm not very good at AutoIt scriptwriting, and I was in a hurry, so the script isn't very efficient from a technical point of view (it repeats many actions thousands of times, which, in a different design that I also had in mind but could not figure out on short notice, would have needed to be performed only once), but I have fast computer, so I can afford to be wasteful (programmatically speaking). The script isn't even finished -- for example, if you have a blank line break at the end of your file, it will throw an error message, and that is simple to solve, but... I didn't have time and I was tired.

I spent about 10 hours on this task in total, but that includes two failed attempts at doing it manually, and I had to recheck all the edits manually a second time to ensure that the editor didn't introduce small errors with his edits (he did). From the moment of sitting down with an empty text editor to the point where the script does what it should do, not counting any other tasks, the script writing itself probably took about 2 hours. If I was not in a rush to complete this task, and if I had used the script from the start, the task would have taken me less than 5 hours to complete (instead of 10, which was the result of trying out various options that seemed best at the time).

Anyway, you live and learn. Next time... next time will be faster (if there is a next time).


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Macro or script for implementing edits

Advanced search






SDL Trados Studio 2019 Freelance
The leading translation software used by over 250,000 translators.

SDL Trados Studio 2019 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2019 transforms how new users get up and running, helps experienced users make the most of the powerful features, ensures new

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search