Package edu.stanford.nlp.ling

Examples of edu.stanford.nlp.ling.LabelFactory.newLabel()


        String lab = t.label().value();
        if (lab.equals("S") && includesEmptyNPSubj(t)) {
          LabelFactory lf = t.label().labelFactory();
          // Note: this changes the tree label, rather than
          // creating a new tree node.  Beware!
          t.setLabel(lf.newLabel(t.label().value() + "-G"));
        }
      }
      return t;
    };
    Predicate<Tree> subtreeFilter = new Predicate<Tree>() {
View Full Code Here


              }
            }
            LabelFactory lf = ht.label().labelFactory();
            // Note: this changes the tree label, rather than
            // creating a new tree node.  Beware!
            ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
            oldT = ht;
          } while (!ht.isPreTerminal());
          if (lab.startsWith("PP")) {
            ht = headFinder.determineHead(t);
            // look to right
View Full Code Here

            if (ht.label().value().startsWith("NP")) {
              while (!ht.isLeaf()) {
                LabelFactory lf = ht.label().labelFactory();
                // Note: this changes the tree label, rather than
                // creating a new tree node.  Beware!
                ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
                ht = headFinder.determineHead(ht);
              }
            }
          }
        }
View Full Code Here

            Tree[] kids = t.children();
            for (Tree kid : kids) {
              if (kid.isPreTerminal()) {
                // Note: this changes the tree label, rather
                // than creating a new tree node.  Beware!
                kid.setLabel(lf.newLabel(kid.value() + "-TMP"));
              }
            }
          } else {
            Tree oldT = t;
            do {
View Full Code Here

              oldT = ht;
            } while (!ht.isPreTerminal());
            LabelFactory lf = ht.label().labelFactory();
            // Note: this changes the tree label, rather than
            // creating a new tree node.  Beware!
            ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
          }
        }
      } else if (temporalAnnotation == TEMPORAL_ALL_NP) {
        String lab = t.label().value();
        if (NPTmpPattern.matcher(lab).matches()) {
View Full Code Here

            }
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              LabelFactory lf = ht.labelFactory();
              // Note: this changes the tree label, rather than
              // creating a new tree node.  Beware!
              ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
              oldT = ht;
            }
          } while (ht.value().startsWith("NP"));
        }
      } else if (temporalAnnotation == TEMPORAL_ALL_NP_AND_PP || temporalAnnotation == TEMPORAL_NP_AND_PP_WITH_NP_HEAD || temporalAnnotation == TEMPORAL_ALL_NP_EVEN_UNDER_PP) {
View Full Code Here

            }
            LabelFactory lf = ht.labelFactory();
            // Note: this next bit changes the tree label, rather
            // than creating a new tree node.  Beware!
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
            }
            if (temporalAnnotation == TEMPORAL_ALL_NP_EVEN_UNDER_PP && oldT.value().startsWith("PP")) {
              oldT.setLabel(lf.newLabel(tlp.basicCategory(oldT.value())));
            }
            oldT = ht;
View Full Code Here

            // than creating a new tree node.  Beware!
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
            }
            if (temporalAnnotation == TEMPORAL_ALL_NP_EVEN_UNDER_PP && oldT.value().startsWith("PP")) {
              oldT.setLabel(lf.newLabel(tlp.basicCategory(oldT.value())));
            }
            oldT = ht;
          } while (oldT.value().startsWith("NP") || oldT.value().startsWith("PP"));
        }
      } else if (temporalAnnotation == TEMPORAL_ALL_NP_PP_ADVP) {
View Full Code Here

            }
            // Note: this next bit changes the tree label, rather
            // than creating a new tree node.  Beware!
            if (ht.isPreTerminal() || ht.value().startsWith("NP")) {
              LabelFactory lf = ht.labelFactory();
              ht.setLabel(lf.newLabel(ht.value() + "-TMP"));
            }
            oldT = ht;
          } while (oldT.value().startsWith("NP"));
        }
      } else if (temporalAnnotation == TEMPORAL_9) {
View Full Code Here

          } while (!ht.isPreTerminal());
          if ( ! onlyTagAnnotateNstar || ht.label().value().startsWith("N")) {
            LabelFactory lf = ht.label().labelFactory();
            // Note: this changes the tree label, rather than
            // creating a new tree node.  Beware!
            ht.setLabel(lf.newLabel(ht.label().value() + "-TMP"));
          }
        }
      }
      if (doAdverbialNP) {
        String lab = t.value();
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.