String[] words = label.split("\b"); // \b is regexp constant for word
for (String word : words) {
if(thesUri!=null&&word!=null&&word.trim().length()>0) {
ThesaurusContext context = Thesauri.getInstance().getContext(thesUri);
classifications.addAll( ThesaurusStorage.getInstance().search(context, word+" AND (type:synset )",threshold).keySet());
}
else if(word!=null&&word.trim().length()>0){
for(ThesaurusContext context:Thesauri.getInstance().getContexts())
{
classifications.addAll( ThesaurusStorage.getInstance().search(context, word+" AND (type:synset )",threshold).keySet());
}
}
//classifications.addAll(WordNetClassification.getWordNetClassifications(word));
}
}
if(description!=null) {
//as lucene is doing the OR by default, add AND between the words.
description = description.trim().replaceAll(" ", " AND ");
String[] words = description.split("\b");
for (String word : words) {
if(thesUri!=null&&word!=null&&word.trim().length()>0) {
ThesaurusContext context = Thesauri.getInstance().getContext(thesUri);
classifications.addAll( ThesaurusStorage.getInstance().search(context, word+" AND (type:synset)",threshold).keySet());
}
else if(word!=null&&word.trim().length()>0)
{
for(ThesaurusContext context:Thesauri.getInstance().getContexts())