Package edu.stanford.nlp.ling

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


    Set<Symbol> singletonChars = Counters.keysBelow(charCounter, 1.5);
    Set<TaggedWord> singletonWords = Counters.keysBelow(wordCounter, 1.5);

    ClassicCounter<String> singletonWordPOSes = new ClassicCounter<String>();
    for (TaggedWord taggedWord : singletonWords) {
      singletonWordPOSes.incrementCount(taggedWord.tag());
    }
    Distribution<String> singletonWordPOSDist = Distribution.getDistribution(singletonWordPOSes);

    ClassicCounter<Character> singletonCharRads = new ClassicCounter<Character>();
    for (Symbol s : singletonChars) {
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.