我写了一个可以查询一个文本里面的单词是否存在在字典里的程序,如果程序搜到了一个单词不在字典里就停止运行。可是老师给的这个文本明明每个都在字典里,可是我每次运行的时候就停在同个单词上。看了字典才知道,原来那个单词有两个意思,所以单词后面分别加了数字1和2,所以老是停在那个单词上。求怎么改这个程序,让他可以忽略单词后面的数字,然后只读单词呢?如果可以的话,能不能也加上一个可以限制要查询的文本,单词在1000个以内,如果超过就显示“超数”package escalera;import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
/**
 *
 * @author 
 */public class comparapalabra {
    
    public int count=0;
    
       public comparapalabra(String nom) throws Exception{
                
                FileReader fis1 = null;
BufferedReader bis1 = null;
FileReader fis2 = null;
BufferedReader bis2 = null;
String s1 = null;
String s2 = null;
Collection<String> c1 = new ArrayList<String>();
Collection<String> c2 = new ArrayList<String>();
Collection<String> cSame = new ArrayList<String>();
        
      try{
fis1 = new FileReader("diccionaricatala.txt");
bis1 = new BufferedReader(fis1);
fis2 = new FileReader(nom);
bis2 = new BufferedReader(fis2);
while ((s1=bis1.readLine())!=null){
c1.add(s1);}
while ((s2=bis2.readLine())!=null){
c2.add(s2);
if(c1.contains(s2)){
cSame.add(s2);
System.out.println("单词"+(count+1)+"; "+s2);
count++;}else {
    count++;
    System.out.println("单词:"+count+";"+s2+" 错误;单词不在字典中。");
   System.out.println("\n不是字梯,错误出现在单词"+count);
    break;

}
}catch(IOException e){
   
}finally{
try{
fis1.close();
bis1.close();
fis2.close();
bis2.close();
}catch(IOException e){
}}}
}