Package net.didion.jwnl.data.list

Examples of net.didion.jwnl.data.list.PointerTargetNodeList


                       Dictionary.getInstance().lookupIndexWord(POS.VERB, phrase));
  }

  private void demonstrateListOperation(IndexWord word) throws JWNLException {
    // Get all of the hypernyms (parents) of the first sense of <var>word</var>
    PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));
    System.out.println("Direct hypernyms of \"" + word.getLemma() + "\":");
    hypernyms.print();
  }
View Full Code Here


    protected String getWordForm(IndexWord word) {

        if (word.getSenseCount() == 1) {

            PointerTargetNodeList hypernyms;
            try {
                hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));
            } catch (Exception e) {
                hypernyms = null;
            }

            if ((hypernyms != null) && (hypernyms.size() > 0))
                return ((PointerTargetNode) hypernyms.get(0)).getSynset().getWord(0).getLemma();
            else
                return word.getLemma();

        } else
            return word.getLemma();
View Full Code Here

                       Dictionary.getInstance().lookupIndexWord(POS.VERB, phrase));
  }

  private void demonstrateListOperation(IndexWord word) throws JWNLException {
    // Get all of the hypernyms (parents) of the first sense of <var>word</var>
    PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));
    System.out.println("Direct hypernyms of \"" + word.getLemma() + "\":");
    hypernyms.print();
  }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hyponyms = PointerUtils
                                .getInstance().getDirectHyponyms(
                                        word.getSense(c + 1));
                        result.addAll(getLemmata(hyponyms));
                    }
                }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hypernyms = PointerUtils
                                .getInstance().getDirectHypernyms(
                                        word.getSense(c + 1));
                        result.addAll(getLemmata(hypernyms));
                    }
                }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hypernyms = PointerUtils
                                .getInstance()
                                .getAntonyms(word.getSense(c + 1));
                        result.addAll(getLemmata(hypernyms));
                    }
                }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hypernyms = PointerUtils
                                .getInstance().getCoordinateTerms(
                                        word.getSense(c + 1));
                        result.addAll(getLemmata(hypernyms));
                    }
                }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hypernyms = PointerUtils
                                .getInstance()
                                .getMeronyms(word.getSense(c + 1));
                        result.addAll(getLemmata(hypernyms));
                    }
                }
View Full Code Here

                if (word != null) {
                    // result.add(getWordLabel(word));
                    // for all senses...
                    for (int c = 0; c < word.getSenses().length; c++) {
                        // all hypernyms for the synset:
                        PointerTargetNodeList hypernyms = PointerUtils
                                .getInstance()
                                .getHolonyms(word.getSense(c + 1));
                        result.addAll(getLemmata(hypernyms));
                    }
                }
View Full Code Here

      // <var>word</var>
      java.util.HashSet<String> res = new java.util.HashSet<String>();

      IndexWord iw = Dictionary.getInstance().lookupIndexWord(
          getPOS(pos), word);
      PointerTargetNodeList hypernyms = PointerUtils.getInstance()
          .getDirectHypernyms(iw.getSense(1));
      for (int i = 0; i < hypernyms.size(); i++) {
        PointerTargetNode ptn = (PointerTargetNode) hypernyms.get(i);
        Word[] words = ptn.getSynset().getWords();
        for (Word w : words)
          res.add(w.getLemma());
      }
      String[] resArray = new String[res.size()];
View Full Code Here

TOP

Related Classes of net.didion.jwnl.data.list.PointerTargetNodeList

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.