| | import java.util.Map; |
| | |
| | +import static com.keenwrite.events.StatusEvent.clue; |
| | import static io.gitlab.rxp90.jsymspell.Verbosity.ALL; |
| | import static io.gitlab.rxp90.jsymspell.Verbosity.CLOSEST; |
 |
| | |
| | final var words = lookup( lexeme, CLOSEST ); |
| | - return !words.isEmpty() && lexeme.equals( words.get( 0 ).getSuggestion() ); |
| | + return !words.isEmpty() && lexeme.equals( words.getFirst().getSuggestion() ); |
| | } |
| | |
 |
| | assert v != null; |
| | |
| | - return mSymSpell.lookup( lexeme, v ); |
| | + try { |
| | + return mSymSpell.lookup( lexeme, v ); |
| | + } |
| | + catch( final NotInitializedException ex ) { |
| | + clue( ex ); |
| | + } |
| | + |
| | + return new ArrayList<>(); |
| | } |
| | } |