Package edu.mit.jwi.item

Examples of edu.mit.jwi.item.IWord


      return synonyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord = iDictionary.getWord(iWordId);

      ISynset iSynset = iWord.getSynset();
      for(IWord synsetMember : iSynset.getWords()) {
        synonyms.add(synsetMember.getLemma());
      }
     
      if(firstSenseOnly) {
View Full Code Here


      return hypernyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord1 = dict.getWord(iWordId);
      ISynset iSynset = iWord1.getSynset();
     
      // multiple hypernym chains are possible for a synset
      for(ISynsetID iSynsetId : iSynset.getRelatedSynsets(Pointer.HYPERNYM)) {
        List<IWord> iWords = dict.getSynset(iSynsetId).getWords();
        for(IWord iWord2: iWords) {
View Full Code Here

      return hypernyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord1 = dict.getWord(iWordId);
      ISynset iSynset = iWord1.getSynset();
     
      for(ISynsetID iSynsetId1 : iSynset.getRelatedSynsets(Pointer.HYPERNYM)) {
        for(ISynsetID iSynsetId2 : dict.getSynset(iSynsetId1).getRelatedSynsets(Pointer.HYPERNYM)) {
          List<IWord> iWords = dict.getSynset(iSynsetId2).getWords();
          for(IWord iWord2: iWords) {
View Full Code Here

      return synonyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord = iDictionary.getWord(iWordId);

      ISynset iSynset = iWord.getSynset();
      for(IWord synsetMember : iSynset.getWords()) {
        synonyms.add(synsetMember.getLemma());
      }
     
      if(firstSenseOnly) {
View Full Code Here

      return hypernyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord1 = dict.getWord(iWordId);
      ISynset iSynset = iWord1.getSynset();
     
      // multiple hypernym chains are possible for a synset
      for(ISynsetID iSynsetId : iSynset.getRelatedSynsets(Pointer.HYPERNYM)) {
        List<IWord> iWords = dict.getSynset(iSynsetId).getWords();
        for(IWord iWord2: iWords) {
View Full Code Here

      return hypernyms; // no senses found
    }
   
    // iterate over senses
    for(IWordID iWordId : iIndexWord.getWordIDs()) {
      IWord iWord1 = dict.getWord(iWordId);
      ISynset iSynset = iWord1.getSynset();
     
      for(ISynsetID iSynsetId1 : iSynset.getRelatedSynsets(Pointer.HYPERNYM)) {
        for(ISynsetID iSynsetId2 : dict.getSynset(iSynsetId1).getRelatedSynsets(Pointer.HYPERNYM)) {
          List<IWord> iWords = dict.getSynset(iSynsetId2).getWords();
          for(IWord iWord2: iWords) {
View Full Code Here

        .split(current));

    List<String> tagged = tagger.tag(words);
    IIndexWord idxWord;
    List<IWordID> wordID;
    IWord word;
    StringBuilder outDef = new StringBuilder();

    for (int i = 0; i < words.size(); i++) {
      // System.out.println(i);
      String definition = "";
      if (table.containsKey(tagged.get(i))) {
        if (nouns.containsKey(words.get(i))) {
          words.set(i, nouns.get(words.get(i)));
        }
        try {
          switch (table.get(tagged.get(i))) {
          case (1):
            idxWord = dict.getIndexWord(words.get(i), POS.NOUN);
            if (idxWord == null)
              break;
            wordID = idxWord.getWordIDs();
            word = dict.getWord(wordID.get(0));
            definition = word.getSynset().getGloss();
            break;
          case (2):
            tmpevent = port.createEventSet(words.get(i).toCharArray());
            idxWord = dict.getIndexWord(tmpevent.eventAt(0).toString(), POS.VERB);
            if (idxWord == null)
              break;
            wordID = idxWord.getWordIDs();
            word = dict.getWord(wordID.get(0));
            definition = word.getSynset().getGloss();
            break;
          case (3):
            idxWord = dict.getIndexWord(words.get(i), POS.ADJECTIVE);
            if (idxWord == null)
              break;
            wordID = idxWord.getWordIDs();
            word = dict.getWord(wordID.get(0));
            definition = word.getSynset().getGloss();
            break;
          case (4):
            idxWord = dict.getIndexWord(words.get(i), POS.ADVERB);
            if (idxWord == null)
              break;
            wordID = idxWord.getWordIDs();
            word = dict.getWord(wordID.get(0));
            definition = word.getSynset().getGloss();
            break;
          }

        } catch (IllegalArgumentException e) {
          logger.debug("Problem with possibly empty word: '" + words.get(i) + "'", e);
View Full Code Here

TOP

Related Classes of edu.mit.jwi.item.IWord

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.