Beautified code and added Normalized word functionality on OneWords

This commit is contained in:
2018-08-10 11:08:01 +02:00
parent 9b5fa4616b
commit e140a9538b
12 changed files with 194 additions and 162 deletions

View File

@@ -56,7 +56,8 @@ public class Ngrams {
// String test = key;
// }
// key = (!key.equals("") && key.charAt(key.length()-1) == ',') ? key.substring(0, key.length() - 1) : key;
if (stats.getFilter().getNotePunctuations())
key = (!key.equals("") && key.charAt(key.length()-1) == ',') ? key.substring(0, key.length() - 1) : key;
MultipleHMKeys multipleKeys;
@@ -165,6 +166,12 @@ public class Ngrams {
// .collect(Collectors.toList()));
// .substring(0, 1)
return StringUtils.join(candidate, " ");
case NORMALIZED_WORD:
candidate.addAll(ngramCandidate
.stream()
.map(Word::getNormalizedWord)
.collect(Collectors.toList()));
return StringUtils.join(candidate, " ");
}
return StringUtils.join(candidate, " ");