| 1416 | 1416 | final var node = mParser.parse( text ); |
| 1417 | 1417 | final var visitor = new TextVisitor( ( visited, bIndex, eIndex ) -> { |
| 1418 | checker.proofread( visited, ( misspelled, prevIndex, currIndex ) -> { | |
| 1418 | // Treat hyphenated compound words as individual words. | |
| 1419 | final var preprocess = visited.replace( '-', ' ' ); | |
| 1420 | ||
| 1421 | checker.proofread( preprocess, ( misspelled, prevIndex, currIndex ) -> { | |
| 1419 | 1422 | prevIndex += bIndex; |
| 1420 | 1423 | currIndex += bIndex; |
| 48 | 48 | */ |
| 49 | 49 | public class SymSpellSpeller implements SpellChecker { |
| 50 | private final BreakIterator mBreakIterator = BreakIterator.getWordInstance(); | |
| 51 | ||
| 50 | 52 | private final SymSpell mSymSpell; |
| 51 | 53 | |
| ... | ||
| 106 | 108 | assert consumer != null; |
| 107 | 109 | |
| 108 | final BreakIterator wb = BreakIterator.getWordInstance(); | |
| 109 | wb.setText( text ); | |
| 110 | mBreakIterator.setText( text ); | |
| 110 | 111 | |
| 111 | int boundaryIndex = wb.first(); | |
| 112 | int boundaryIndex = mBreakIterator.first(); | |
| 112 | 113 | int previousIndex = 0; |
| 113 | 114 | |
| ... | ||
| 121 | 122 | |
| 122 | 123 | previousIndex = boundaryIndex; |
| 123 | boundaryIndex = wb.next(); | |
| 124 | boundaryIndex = mBreakIterator.next(); | |
| 124 | 125 | } |
| 125 | 126 | } |