我正在编写拼写检查程序,它检查一些 .txt 文件的每个单词。它在到达文件末尾时读取文件,当它发现不正确的单词时,它会建议 JList 中的正确变体。用户选择一个并按下“下一步”按钮。然后它继续阅读和搜索不正确的单词。
while(EOF is not reached)
{
check(word);//this returns array of suggestions
if("next" button is pressed)
{
list.getSelectedWord() and continue while loop
} else {
suspend loop until "next" button is pressed
}
}