📄 stoplist.java
字号:
/* **** StopList.java ***********************************************
Implement stoplist as HashTable
**********************************************************************/
package drsystem;
import java.util.*;
import java.io.*;
class StopList extends Hashtable<String,String>
{
public StopList(String file) throws IOException
{
super(); //call to parent class constructor
try
{
BufferedReader Istream=new BufferedReader(new FileReader(file)); //create input stream
String word;
while((word=Istream.readLine())!=null) //read stopword in each line
put(word,word); // and put in into HashTable
Istream.close(); //close stream
} //end of try block
catch(NullPointerException e)
{
System.out.println("StopList.java: " + e.getMessage());
}
catch(FileNotFoundException e)
{
System.out.println("StopList.java: " + e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -