diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-26 12:02:08 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-26 12:02:08 +0200 |
commit | 7df2ae452a984cb12986b33034557476cb4a1536 (patch) | |
tree | 6058fd9c8e5b33fb8545e9cad4b1c0c75f5d54c8 /src/main/FarmShell.java | |
parent | e051abbfdbf7ff721bf1318bf0b5939741b1f792 (diff) | |
download | Goldfarmer-7df2ae452a984cb12986b33034557476cb4a1536.tar.gz |
Optimize sentiment analysis
Do not create a new prepared statement every time. Use an optimized
UPDATE query. Drop requirement for supplying a query.
Diffstat (limited to 'src/main/FarmShell.java')
-rw-r--r-- | src/main/FarmShell.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/FarmShell.java b/src/main/FarmShell.java index 1266fd3..ed1a0ff 100644 --- a/src/main/FarmShell.java +++ b/src/main/FarmShell.java @@ -125,7 +125,12 @@ public class FarmShell { System.out.println("not yet implemented"); break; case sentiment: - getAnalyzor().sentimentAnalysis(params[0]); + // if there is no query, update all unrated items. + if (params.length > 0) { + getAnalyzor().sentimentAnalysis(params[0]); + } else { + getAnalyzor().sentimentAnalysis(""); + } break; case wordcloud: getAnalyzor().makeWordCloud(params[0]); @@ -163,10 +168,10 @@ public class FarmShell { enum Command { filterbots("marks all users as bot or not", 1), - sentiment("analyzes all tweets on positivity (about a brand)", 1), + sentiment("analyzes all tweets on brand positivity (optional arg: tweet/brand selection query)"), wordcloud("makes a wordcloud of the text of the tweets", 1), getBrands("fills the database with the brands of a tweet"), - disco("makes a outputfile for disco",1), + disco("makes a outputfile for disco", 1), exit("Returns to shell"), help("Get help"); |