Results 1 to 1 of 1
2002-07-28, 23:53 #1
- Join Date
- Dec 2000
- Los Angeles Area, California, USA
- Thanked 0 Times in 0 Posts
Spell Check - Excluding Proper Nouns (Word 97 or 2000)
A recent question prompted me to do some research. If you have a document with numerous proper nouns that are not already added to your custom dictionary, doing a spell check can take an extremely long time. Spell check stops at each proper noun that it doesn't recognize (which is most of them) & asks whether you want to change it, add it to a custom dictionary, ignore it, or ignore all. One solution is to mark all proper nouns with "no proofing" (Word 97) or "Do not check spelling and grammer" (Word 2000).
I should first mention what will not work. Going to Tools/Options/Spelling & Grammer tab/ and unticking Ignore words in UPPERCASE will not work. It will only prevent spellcheck from checking words that are in all caps, not initial caps... the way most proper nouns are spelled. However, since many words in all uppercase are, in fact, proper nouns, checking this option will help & should be selected anyway.
A method to not spell check words that start with a capital letter (regardless of whether the rest of the word is uppercase or lowercase) is to create a character style and set the style to "No Proofing" language (Word 97 & below) or Tools/Language/Set Language & tick the box that says "Do not check spelling or grammer" (Word 2000 & above). Then Word will skip those words when doing a spell check. The easiest way to do this is to use the style in advance of typing the proper noun. However, assuming that there are numerous proper nouns already in a document, you must do a Find & Replace to replace such words with the "no proofing" language.
You should note, however, that there is no way for Word to distinguish between a proper noun which starts a sentence from a word that is not a proper noun. For example, using Find/Replace, there is no pattern to distinguish between the first word in the following sentences:
Newton was a physicist.
New words are hard to learn.
Therefore, assuming that you already have a document that contains numerous words that are capitalized, you must choose whether or not you want to spell check the first word in each sentence. My advice would be to spell check the first word in a sentence, as there are probably more words that are not proper nouns at the beginning of a sentence than words that are proper nouns.
<font color=red>Taking all the above into consideration, the following Find/Replace operation will format all capitalized words into a "no proofing" language, EXCEPT those words which are preceded by punctuation & a space. Use the following steps:
1. Bring up the Replace dialog box by pressing Ctrl+H (or using Edit/Replace).
2. In Word 97 & above, press More.
3. Tick the box that says "Use wildcards" (Pattern matching in Word 95 & below).
4. In the Find box, type the following expression (explained below):
Note that there is a space before the "<" in the line above. If you put 2 spaces between each sentence, you must put 2 spaces before the "<". (I won't debate the "2 spaces vs. 1 space" here; there's more than one thread on that subject) elsewhere.
5. In the Replace box, type
[Note: in Word 2000, that step is not necessary, but can't hurt. It is the expression for "find what" text. It is necessary in Word 97 because otherwise, Word will replace what is found with nothing.]
6. With the cursor still in the Replace box, go to Format/Language... & set the langauge for "no proofing" (Word 97 & below) or tick the box that says "Do not check spelling or grammer" (Word 2000 & above).
7. Click Replace all.</font color=red>
Now, to break down the expression
The first set of brackets that starts with an exclamation point says to find any character except anything that matches a character in the brackets. Inside the brackets you will find a period (.), then a question mark (?). Note that the question mark, which by itself is an operator meaning "any character" must be preceded by a backslash. Then follows a semi-colon, a colon, a quote mark, & an exclamation point (again preceded by a backslash, since it is an operator meaning "not"). If you use smart quotes, you should also place a beginning smart quote in the first expression by pressing Alt+0147.
The next character is a space. Remember, if you use two spaces between sentences, then you must use two spaces at this point in the expression.
<[A-Z][A-z]@> The last part of the expression finds the beginning of a word (<) that starts with a capital letter.
[A-Z] is an expression which finds the range. Here the range is capital A to capital Z.
[A-z] is an expression which finds the range capital A through small z. In other words, it finds any letter, whether or not it's capitalized. You don't need to use [a-zA-Z], which would also work.
@ is an operator that says one or more. Therefore, [A-z]@ finds one or more letters.
> is an operator that says the preceding character is at the end of a word.
When we put all this together, we are finding a word of at least two letters that starts with a capital letter & is NOT preceded by punctuation and a space. i.e. we are skipping all words that begin sentences (including words after colon space & semi-colon space). We are replacing them with the "no proofing" language so that Word will not spell check them.
I have tested the above expression & what I'm about to say in Word 2000 & it works. I do not know whether what I say in the next paragraph will work in other versions. Also, if I knew how to write macros, I'd search for the above expression in VBA & COLLAPSE the first letter & space in the selection & then do the replace. Nevertheless, I have tested what I'm about to say in Word 2000.
Astute observers will note that the above expression selects, not only the capitalized word, but also the last letter of the preceding word before replacing the expression with "no proofing". However, since the rest of the preceding word is not marked as "no proofing", it will still be spell checked.
For example, if you have the expression:
A man named Rabichow posted a message, where you do not wish to spell check Rabichow. You will find that "d Rabichow" has been marked "no proofing". Nevertheless, word would find a spelling mistake in the word "namd" if you had written:
A man namd Rabichow posted a message.
i.e. Word will still catch "namd".
Note: If a document contains a large number of names preceded by a title (Mr., Ms., Dr.), then it would be best to omit the period from the initial expression. Otherwise, you will end up spell checking:
Mr. John Doe
Mr. Phil Rabichow
Mr. James Smith
If anyone has suggestions on how to improve this Find/Replace method (or wants to put it in a macro), I'd welcome it.