tmilstead77
Technical User
I am learning TCL and have been given an assignment to test my knowledge. I am trying to create a simple spell checker, but am having a hard time getting all my parameters met. I think I can accomplish these requirements with regular expressions, but I am not sure how to go about it properly. Here is my problem:
Spell check rules:
1. The spell checker should be case insensitive. Meaning, if the word ‘APRIL’ is found in the input file and the word ‘April’ is defined in the dictionary file, then it should not regard this as a mistake.
2. Punctuation marks and symbols should be ignored. Words enclosed in quotes should still be checked.
3. Numbers should be ignored unless they are in ordinal form (e.g. 1st, 2nd, 3rd, etc). Commas in large numbers are valid (e.g. 29,300).
4. Words ending with a possessive apostrophe (’s) should be ignored and not considered mistakes.
Now I've worked out the problem for case 1. But like I said I believe I can work out the other requirements with regex(es) but Im not sure how to go about it. Any help would be greatly appreciated.
Spell check rules:
1. The spell checker should be case insensitive. Meaning, if the word ‘APRIL’ is found in the input file and the word ‘April’ is defined in the dictionary file, then it should not regard this as a mistake.
2. Punctuation marks and symbols should be ignored. Words enclosed in quotes should still be checked.
3. Numbers should be ignored unless they are in ordinal form (e.g. 1st, 2nd, 3rd, etc). Commas in large numbers are valid (e.g. 29,300).
4. Words ending with a possessive apostrophe (’s) should be ignored and not considered mistakes.
Now I've worked out the problem for case 1. But like I said I believe I can work out the other requirements with regex(es) but Im not sure how to go about it. Any help would be greatly appreciated.