Package net.didion.jwnl.data

Examples of net.didion.jwnl.data.IndexWord


    }
  }

  public String getSenseKey(String lemma, String pos,int sense) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null) {
        return null;
      }
      return String.valueOf(iw.getSynsetOffsets()[sense]);
    }
    catch (JWNLException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here


  }

  public int getNumSenses(String lemma, String pos) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null){
        return 0;
      }
      return iw.getSenseCount();
    }
    catch (JWNLException e) {
      return 0;
    }
  }
View Full Code Here

  }

  public String[] getParentSenseKeys(String lemma, String pos, int sense) {
    //System.err.println("JWNLDictionary.getParentSenseKeys: lemma="+lemma);
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw != null) {
        Synset synset = iw.getSense(sense+1);
        List<String> parents = new ArrayList<String>();
        getParents(synset,parents);
        return parents.toArray(new String[parents.size()]);
      }
      else {
View Full Code Here

    }
  }

  public String getSenseKey(String lemma, String pos,int sense) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null) {
        return null;
      }
      return String.valueOf(iw.getSynsetOffsets()[sense]);
    }
    catch (JWNLException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

   
  }
 
  public int getNumSenses(String lemma, String pos) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null){
        return 0;
      }
      return iw.getSenseCount();
    }
    catch (JWNLException e) {
      return 0;
    }
  }
View Full Code Here

  }

  public String[] getParentSenseKeys(String lemma, String pos, int sense) {
    //System.err.println("JWNLDictionary.getParentSenseKeys: lemma="+lemma);
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw != null) {
        Synset synset = iw.getSense(sense+1);
        List parents = new ArrayList();
        getParents(synset,parents);
        return (String[]) parents.toArray(new String[parents.size()]);
      }
      else {
View Full Code Here

        this(new LovinsStemmerWrapper(), 1);
    }

    protected IndexWord getIndexWord(String s) throws JWNLException, WVToolException {

        IndexWord word = null;

        POS[] posTags = new POS[] { POS.NOUN, POS.ADJECTIVE, POS.VERB, POS.ADVERB };

        IndexWordSet wordSet = dictionary.lookupAllIndexWords(s);
View Full Code Here

    public String getBase(String s) throws WVToolException {

        String result = null;
        try {
            IndexWord word = getIndexWord(s);

            if (word != null)
                if (word.getSenseCount() <= maxSenses)
                    result = getWordForm(word);
                else
                    result = word.getLemma();
            else {
                result = s;
            }
        } catch (JWNLException e) {
View Full Code Here

    }
  }

  public String getSenseKey(String lemma, String pos,int sense) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null) {
        return null;
      }
      return String.valueOf(iw.getSynsetOffsets()[sense]);
    }
    catch (JWNLException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

  }

  public int getNumSenses(String lemma, String pos) {
    try {
      IndexWord iw = dict.getIndexWord(POS.NOUN,lemma);
      if (iw == null){
        return 0;
      }
      return iw.getSenseCount();
    }
    catch (JWNLException e) {
      return 0;
    }
  }
View Full Code Here

TOP

Related Classes of net.didion.jwnl.data.IndexWord

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.