基于管道过滤器的KWIC系统实现。
实现噪声单词过滤以及首单词大写功能。
package lws;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
* To construct the framework of the system
*/
public class KWIC{
public void execute(String file,String noisyFile){
try{
Pipe in_lt=new Pipe();
Pipe lt_cs = new Pipe();
Pipe cs_lt = new Pipe();
Pipe lt_al=new Pipe();
Pipe al_sf=new Pipe();
Pipe sf_ou=new Pipe();
FileInputStream in = new FileInputStream(file);
FileInputStream noise=new FileInputStream(noisyFile);
BufferedReader br=new BufferedReader(new InputStreamReader(noise));
String str;
ArrayList<String> noises=new ArrayList<St