aspell: Word skipping by context
1
1 D.3.1 Word skipping by context
1 ------------------------------
1
1 This was posted on the Aspell mailing list on January 1, 1999:
1
1 I had an idea on a great general way to determine if a word should be
1 skipped. Determine the words to skip based on the symbols that
1 (almost) always surround the word.
1
1 For example when asked to check the following C++ code:
1 cout << "My age is: " << num << endl;
1 cout << "Next year I will be " << num + 1 << endl;
1
1 `cout', `num', and `endl' will all be skipped. `cout' will be
1 skipped because it is always preceded by a `<<'. `num' will be skipped
1 because it is always preceded by a `<<'. And `endl' will be skipped
1 because it is always between a `<<' and a `;'.
1
1 Given the following HTML code.
1 <table width=50% cellspacing=0 cellpadding=1>
1 <tr><td>One<td>Two<td>Three
1 <tr><td>1<td>2<td>3
1 </table>
1
1 <table cellspacing=0 cellpadding=1>
1 </table>
1
1 `table', `width' `cellspacing', `cellpadding', `tr', `td' will all
1 be skipped because they are always enclosed in `<>'. Now of course
1 `table' and `width' would be marked as correct anyway however there is
1 no harm in skipping them.
1
1 So I was wondering if anyone on this list has any experience in
1 writing this sort of context recognition code or could give me some
1 pointers in the right direction.
1
1 This sort of word skipping will be very powerful if done right. I
1 imagine that it could replace specific spell checker modes for TeX,
1 Nroff, SGML etc because it will automatically be able to figure out
1 where it should skip words. It could also probably do a very good job
1 on programming languages code.
1
1 If you are interested in helping me out with this or just have
1 general comments about the idea please let me know.
1