Skip to content

Commit

Permalink
Preprocessor bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyFou committed Jun 1, 2016
1 parent 08a9b25 commit 7bea4ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/combiner/Preprocessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ public static void preprocessTweets(String collectionName, FrequencyCounter fc)
private static String preprocessTweet(String input){
input = prepareText(input);
String[] tokens = tokenizer(input);

StringBuilder builder = new StringBuilder("");
for(String s : tokens){
if(isWhitelisted(s) && !isMention(s, '@')){ //if the word is whitelisted and its not a 'Google Plus' mention
if(isWhitelisted(s)==true && !isMention(s, '@')){ //if the word is whitelisted and its not a 'Google Plus' mention
builder.append(" ").append(s);
}
}
return input;

return builder.toString();
}

/**
Expand All @@ -89,7 +91,7 @@ private static String preprocessComment(String input){
builder.append(" ").append(s);
}
}
return input;
return builder.toString();
}

/**
Expand Down

0 comments on commit 7bea4ba

Please sign in to comment.