summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authors123188 <s123188@S123188.campus.tue.nl>2014-05-15 15:20:15 +0200
committers123188 <s123188@S123188.campus.tue.nl>2014-05-15 15:20:15 +0200
commit87908edbd832f8e8d63b11159a6ec331592521ed (patch)
tree30c599e372bc0f0bba2dcfde18d24495a58f45d4 /src
parentd8162eb3e3d5b6008314cfdafd714c90632e0354 (diff)
downloadGoldfarmer-87908edbd832f8e8d63b11159a6ec331592521ed.tar.gz
such SQLException
Diffstat (limited to 'src')
-rw-r--r--src/main/Analyzor.java11
-rw-r--r--src/main/FarmShell.java2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/Analyzor.java b/src/main/Analyzor.java
index 4b30134..1d0e8aa 100644
--- a/src/main/Analyzor.java
+++ b/src/main/Analyzor.java
@@ -90,6 +90,7 @@ public class Analyzor {
while (data.next()) {
//get the text
text = data.getString("text");
+ text = replacePunct(text);
// test is the tweet text you are going to analyze
String[] words = text.split("\\s+"); // text splitted into separate words
double positiverate = 0; // positive rating
@@ -126,10 +127,20 @@ public class Analyzor {
System.err.println("data is empty, try querying first");
return;
}
+
+ //make the hashmap with the words and their frequency
+ HashMap<String, Integer> wordcloud = new HashMap<>();
+ //set the pointer at the start of the ResultSet
data.beforeFirst();
+
+ while(data.next()){
+ //get the text
+
+ }
}
+ //replaces punctuation so it will be splitted
private String replacePunct(String text) {
text = text.replaceAll("https?://\\S*", "");
text = text.replaceAll("[!?):;\"']", " $0");
diff --git a/src/main/FarmShell.java b/src/main/FarmShell.java
index 55585c2..d56c72a 100644
--- a/src/main/FarmShell.java
+++ b/src/main/FarmShell.java
@@ -83,7 +83,7 @@ public class FarmShell {
// thrown by the "exit" command to signal exit
return false;
} catch (SQLException ex){
- System.err.println("such SQLException");
+ System.err.println("such " + ex);
}
// another satisfied customer, next!
return true;