May. 7th, 2015

alexpgp: (Default)
For cultural reasons, I suppose, Russians quite commonly refer to themselves by last name, first name, and patronymic. The closer you get to what one might call "the bureaucratic register," the more common is this practice.

So what does one do in the face of multiple lists of individuals whose names are rendered in this manner?

Alternative A is to Leave It The Heck Alone™, but this strikes some US end clients as a somewhat defective rendering of names.

Alternative B involves a lot of work, unless you get in good with the Find and Replace fairy.

Assuming one has successfully transliterated all of the names (something neatly handled by a macro), one ends up with a bunch of names along the lines of
Khrushchev Nikita Serveyevich
With the exception of a handful of names that contain hyphens (as in the case of physicist Aleksey Mikhailovich Bonch-Bruevich), we are faced with a situation where we have three strings of characters—where each string starts with a capital letter—separated by spaces.

My initial try at Find and Replace was less that successful:
Find what: ([A-Z][a-z]@) ([A-Z][a-z]@) ([A-Z][a-z]@)

Replace with: \2 \3 \1
Translated into English, the gibberish after 'Find what:' asks to find a grouping of three strings that start with a capital—[A-Z]—followed by one or more lower case letters—[a-z]@, where the '@' signals 'previous 1 or more'—with said strings separated by spaces.

I eventually found out that Word would look at a candidate name and find the following for the regular expression within the first parentheses:
Khrushchev Nikita Serveyevich
In other words, Word found a string that satisfied the expression, but not three of them in a row separated by a space.

What it turned out I needed is a symbol not many are aware of for Word (and other) regular expressions: the > sign. This character is interpreted as "end of word boundary," so that
([A-Z][a-z]@>)
will highlight the following in our test name:
Khrushchev Nikita Serveyevich
After this, the rest of the procedure is pretty simple: take the first found string and move it after the second and third strings.

QED

NOTE: Needs mucho rewrite to make it comprehensible to semi-techies, I think.

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

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 9th, 2025 05:29 pm
Powered by Dreamwidth Studios