public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new FileReader(args[0]));
            BufferedWriter bw = new BufferedWriter(new FileWriter("corpus.txt"));
            String temp;
            StringBuffer sb = new StringBuffer();
            
            while((temp=br.readLine())!=null) {
            	if(temp.startsWith("<s>")){
            		sb = new StringBuffer();
            	}
            	else if(temp.startsWith("</s>")){
            		bw.write(sb.toString().toLowerCase().trim());
                    bw.newLine();
            	}
            	else{
                    String[] text = temp.split("\\t");
                    	sb.append(text[0]);//ignoring the rest which is tags...
                        sb.append(" ");
            	}
            }
            br.close();
            bw.close();
        }catch(IOException e) {
            e.printStackTrace();
        }
    }