Package edu.stanford.nlp.ling

Examples of edu.stanford.nlp.ling.TaggedWord.word()


    for (Tree tree : trees) {
      counter++;
      List<TaggedWord> taggedWords = tree.taggedYield();
      for (int i = 0, size = taggedWords.size(); i < size; i++) {
        TaggedWord taggedWord = taggedWords.get(i);
        String word = taggedWord.word();
        if (word.equals(Lexicon.BOUNDARY)) {
          continue;
        }
        wordCounter.incrementCount(taggedWord);
        wordLengthCounter.incrementCount(Integer.valueOf(word.length()));
View Full Code Here


        Label dl = child.label();
        TaggedWord dtw = null;
        if (dl instanceof HasWord && dl instanceof HasTag) {
          dtw = new TaggedWord(((HasWord) dl).word(), ((HasTag) dl).tag());
        }
        if (tw != null && tw.word() != null && dtw != null && tw.word().equals(dtw.word()) && tw.tag().equals(dtw.tag()) && !seenHead) {
          seenHead = true;
        } else {
          Dependency<Label, Label, Object> p = new UnnamedDependency(tw, dtw);
          if (f.accept(p)) {
            deps.add(p);
View Full Code Here

            dw = new TaggedWord(((HasWord) dl).word(), ((HasTag) dl).tag());
          }
        }
        // System.out.println("XX Doing pair: " + l + ", " + dl +
        //                 " gives " + w + ", " +dw);
        if (w != null && w.word() != null && w.tag() != null && dw != null && w.word().equals(dw.word()) && w.tag().equals(dw.tag()) && !seenHead) {
          seenHead = true;
        } else {
          Dependency<Label, Label, Object> p = new UnnamedDependency(w, dw);
          if (f.accept(p)) {
            deps.add(p);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.