package parser;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.Collection;

/**
 * @author Alexis Giraudet
 */
public class Parser {
    public static void parseLines(String fileName, Collection<String> c) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader(fileName));
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            c.add(line);
        }
    }
    
    public static void parseTokens(String fileName, Collection<String> c) throws IOException {
        StreamTokenizer streamTokenizer = new StreamTokenizer(new BufferedReader(new FileReader(fileName)));
        while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF) {
            if(streamTokenizer.ttype == StreamTokenizer.TT_WORD) {
                c.add(streamTokenizer.sval);
            }
        }
    }
}

@@ -215,16 +215,17 @@
 arser %7B%0A
+%0A
     publ
@@ -500,16 +500,30 @@
 add(line
+.toLowerCase()
 );%0A     
@@ -533,20 +533,16 @@
 %7D%0A    %7D%0A
-    
 %0A    pub
@@ -918,16 +918,30 @@
 zer.sval
+.toLowerCase()
 );%0A     

to lower case