private static void loadClues() {
allClues = new ArrayList<SubjectivityClue>();
ArrayList<String> cluesRecords = FilesReader.getAllLines(PropertiesGetter.getProperty("SubjectivityClues"));
String[] lineTokens;
SubjectivityClue currentClue;
String wordPos;
double weight = 0;
String strength;
String polarity;
for (String line : cluesRecords) {
currentClue = new SubjectivityClue();
lineTokens = line.split(" ");
currentClue.setTheWord(lineTokens[2].split("=")[1]);
wordPos = lineTokens[3].split("=")[1];
if (wordPos.startsWith("adj")) {
currentClue.setWordTag(PosTag.ADJGeneral);
} else if (wordPos.startsWith("v")) {
currentClue.setWordTag(PosTag.VBGeneral);
} else if (wordPos.startsWith("adv")) {
currentClue.setWordTag(PosTag.RBGeneral);
} else if (wordPos.startsWith("n")) {
currentClue.setWordTag(PosTag.NNGeneral);
} else {
currentClue.setWordTag(PosTag.Unknown);
}
try {
strength = lineTokens[0].split("=")[1];
polarity = lineTokens[5].split("=")[1];
if (polarity.equals("positive")) {
weight = 1;
} else if (polarity.equals("negative")) {
weight = -1;
}
weight = strength.startsWith("strong") ? weight : weight * 0.5;
currentClue.setWeight(weight);
allClues.add(currentClue);
} catch (Exception e) {
System.out.println(currentClue.getTheWord());
}
}
}