do not check all words with synonym library if the library is empty

pull/1/head
orbiter 12 years ago
parent 70ba74b23a
commit 6e8377b8ad

@ -84,6 +84,10 @@ public class SynonymLibrary {
}
}
public int size() {
return this.lib.size();
}
/**
* for a given word, return a list of synonym words
* @param word

@ -219,7 +219,7 @@ public final class Condenser {
document.addMetatags(this.tags);
}
if (synlib != null) {
if (synlib != null && synlib.size() > 0) {
for (String word: this.words.keySet()) {
Set<String> syms = synlib.getSynonyms(word);
if (syms != null) this.synonyms.addAll(syms);
@ -228,7 +228,7 @@ public final class Condenser {
String text = document.getTextString();
// create the synonyms set
if (synonyms != null) {
if (synonyms != null && synlib.size() > 0) {
for (String word: this.words.keySet()) {
Set<String> syms = synlib.getSynonyms(word);
if (syms != null) this.synonyms.addAll(syms);

Loading…
Cancel
Save