summaryrefslogtreecommitdiff
path: root/src/main/FarmShell.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/FarmShell.java')
-rw-r--r--src/main/FarmShell.java35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/main/FarmShell.java b/src/main/FarmShell.java
index 6fa6d5f..da4e0f9 100644
--- a/src/main/FarmShell.java
+++ b/src/main/FarmShell.java
@@ -137,7 +137,6 @@ public class FarmShell {
break;
case timezone:
getAnalyzor().timezone(params[0]);
- break;
case disco:
getAnalyzor().disco(params[0]);
break;
@@ -147,11 +146,32 @@ public class FarmShell {
case newsspread:
getAnalyzor().newsSpread(params[0]);
break;
- case categorize:
- getAnalyzor().categorize(params[0]);
- break;
case getBrands:
- getAnalyzor().getBrands();
+ String trimmed = params[0].trim();
+ String bool = trimmed;
+ String query = null;
+
+ int index = trimmed.indexOf(" ");
+
+ if (index > -1) {
+ bool = trimmed.substring(0, index);
+ query = trimmed.substring(index + 1, trimmed.length());
+ }
+
+ boolean reset = false;
+ if (bool.equals("true")) {
+ reset = true;
+ } else if (bool.equals("false")) {
+ reset = false;
+ } else {
+ throw new IllegalArgumentException("getBrands: expected boolean, got " + params[0]);
+ }
+
+ if (query != null) {
+ getAnalyzor().getBrands(query, reset);
+ } else {
+ getAnalyzor().getBrands("", reset);
+ }
break;
case help:
for (String line : HELP) {
@@ -182,12 +202,11 @@ public class FarmShell {
filterbots("marks all users as bot or not", 1),
sentiment("analyzes all tweets on brand positivity (optional arg: tweet/brand selection query)"),
wordcloud("makes a csv for a wordcloud of the text of the tweets", 1),
- getBrands("fills the database with the brands of a tweet"),
- timezone("makes a csv ", 1),
+ getBrands("fills the database with the brands of a tweet, arg: bool indicating whether to reset mentionsbrand (optional arg: tweet selection query", 1),
+ timezone("makes a map per brand for the users", 1),
disco("makes a outputfile for disco", 1),
posneg("makes a csv for a histogram for positive or negative tweets", 1),
newsspread("makes a csv for disco to show a news spread process", 1),
- categorize("categorizes words in a csv as defined in categories.txt", 1),
exit("Returns to shell"),
help("Get help");