Dec. 20th, 2015

Status...

Dec. 20th, 2015 11:18 am
alexpgp: (St. Jerome w/ computer)
I accumulated 75 items requiring clarification while translating the RRBJ™ assignment. These are things like checking to make sure terms are consistent and that queried items to which the editor has responded are incorporated into the target text.

I also have about 220 labels that have to be replaced in the target text with both the label and the translation, e.g., "Аварийная посадка" becomes "Аварийная посадка" ("Emergency landing").

The sheer volume is a bit intimidating, since if I complete one search and replace per minute, it will take me over 5 hours to do this.

So I better get to it, shouldn't I? :^)
alexpgp: (Visa)
By the time I got to the labels in the translated documents, it was almost 4 pm. Editing the list of labels in the documents brought the overall number down to just 192.

Carefully crafting search-and-replace strings by hand in Word would've easily taken a minute per label, or a bit over three hours, with the risk that I would—somewhere in the middle of it all—gnaw off a leg and use it to bash my computers and monitors into just so much silicon refuse. Bad outcome.

So I went about automating the process, starting out by editing the org-mode table where I had collected all these labels into a text file where each line looked like:
<Russian label><TAB><English label translation>
I then created a keyboard macro to convert each line into:
strSoyuz(,) = "<Russian label>"
strSoyuz(,) = "<English label translation>"
I then dug into my rather dusty bag of tricks and created a Perl script that read all the lines in the saved file one by one, replaced the comma between the parentheses with a pair of numbers (representing the indices of a two-dimensional string array), and spit out a usable result.

The tricky part in the Perl script was to have the numbers increment in the following pattern:
(1,1), (1,2), (2,1), (2,2), (3,1), (3,2), ... (192,1), (192,2)
So that the file looked like:
strSoyuz(1,1) = <first Russian label>
strSoyuz(1,2) = <translation of first Russian label>
strSoyuz(2,1) = <second Russian label>
strSoyuz(2,2) = <translation of second Russian label>
...and so on
The last part of this marathon was actually pretty simple: write a Word VBA macro that declared a string array, initialized all 192 pairs, and then cycled through them all, replacing as it went.

I was actually a little surprised the macro worked right out of the chute, and the longest it took to run was about 20 seconds for a 30,000 word file that's chock full of such labels. A spot check shows no errors, but a more detailed assessment will have to wait until tomorrow.

The only thing left to do is address a bunch (and I mean a bunch) of figures in the files. Some of them actually have quite a bit of text in them, and I didn't taken them into account when planning this work. My bad. I must be slipping.

That said, this was a very challenging assignment. Tomorrow, I'm going to have to hit the ground running, from the work perspective, but I'm also going to have to spend what I fear will be long periods on the phone, speaking with insurance agents and doctors.

Never a dull moment around here, let me tell ya!

Cheers...

Profile

alexpgp: (Default)
alexpgp

January 2018

S M T W T F S
  1 2 3456
7 8910111213
14 15 16 17181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 22nd, 2025 12:54 pm
Powered by Dreamwidth Studios