Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ParseThesaurus() {
- try{
- FileInputStream Stream = new FileInputStream("./MobyThesaurus2.txt");
- Scanner Scan = new Scanner(Stream);
- while(Scan.hasNextLine()) {
- String line[] = Scan.nextLine().split(",");
- String lastfound = null;
- for(String currentWord : line) {
- if(Google.contains(currentWord)) {
- lastfound = currentWord;
- break;
- }
- }
- if(lastfound != null) {
- for(String word : line) {
- WordsMap.put(word, lastfound);
- }
- }
- }
- Scan.close();
- }catch(Exception E) {
- System.out.println("Error parsing the file");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement