Quote:
Originally Posted by MacEvansCB
Doing word search/replace is practically impossible, given the gigantic number of different words with both single 'L's and double 'LL's. I have started cleaning one file by doing one search/replace for "l " -> "ll" for words with an embedded "ll" and a second search/replace for "l " -> "ll " for words with "ll" at the end of the word. But both searches have to be run as "find next" followed by either "replace" or "ignore" and each hit has to be decided on individually. This is ridiculous in a 200,000 word document.
|
I played with this a while ago and wrote a regex to do it. The rules I worked out were:
- There has to be a a vowel, "y" or an apostrophe before the double L
- The character after the double L is one of a vowel, "y", punctuation or whitespace.
Using that, I wrote the regex and it covered 99% of things. It is on another machine, so I can't include it. From memory, treated apostrophe-double L separately which simplified the regex a bit.
There are some special cases. From memory, the first time I did this, I was converting a Sci Fi or Fantasy novel that had a name that broke the above rules. I had to fix the name before the rest of the words.