📄 checker.java
字号:
import java.io.*;
import java.util.*;
public class Checker
{
public String checkLine =new String();
public void check(myDictionary aDic,String textLine) throws IOException
{
String s=new String();
String s1=new String();
String err=new String();
int i=1;
checkLine="字典名:"+aDic.getname()+"\n";
StringReader aReader =new StringReader(textLine);
BufferedReader input =new BufferedReader(aReader);
s=input.readLine();
checkLine=checkLine+s;
while((s=input.readLine())!=null)
{
if(s==null) s="end";
StringTokenizer st =new StringTokenizer(s,"~!@#$%^&*()_+|:;',.? {}<>");
while (st.hasMoreTokens())
{
s1=st.nextToken();
if(!(aDic.contain(s1)))
{
err="出错单词"+s1+" 位于第 "+i+" 行";
checkLine=checkLine+err+"\n";
}
}
i++;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -