Package org.corrib.jonto.thesaurus

Examples of org.corrib.jonto.thesaurus.ThesaurusContext


   
      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())
View Full Code Here


      {
        Set<String> thesUris = thValues.keySet();
        for(String thesUri:thesUris)
        {
          Collection<String> thesList = thValues.get(thesUri);
          ThesaurusContext thesaurus = Thesauri.getInstance().getContext(thesUri);
            if (thesaurus!=null)
            {
              List<ThesaurusEntry> thesEntries = new ArrayList<ThesaurusEntry>();
              for(String entry:thesList)
            {
              ThesaurusEntry thEntry = thesaurus.getEntryByUri(entry,null);
                thesEntries.add(thEntry);
            }
              domain.setWordNetClassification(thesEntries);
            }
        }
View Full Code Here

        Set<String> thesUris = thValues.keySet();
        //List<ThesaurusEntry> taxEntries = new ArrayList<ThesaurusEntry>();
        for(String thesUri:thesUris)
        {
          Collection<String> thesList = thValues.get(thesUri);
          ThesaurusContext thesauri = Thesauri.getInstance().getContext(thesUri);
            if (thesauri!=null)
            {
              for(String entry:thesList)
            {
              ThesaurusEntry thEntry = thesauri.getEntryByUri(entry,null);
              chosenClassifications.add(thEntry);
            }
            }
        }
       
View Full Code Here

TOP

Related Classes of org.corrib.jonto.thesaurus.ThesaurusContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.