Codota Logo
ADSentenceStream$SentenceParser$TreeElement
Code IndexAdd Codota to your IDE (free)

How to use
ADSentenceStream$SentenceParser$TreeElement
in
opennlp.tools.formats.ad

Best Java code snippets using opennlp.tools.formats.ad.ADSentenceStream$SentenceParser$TreeElement (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: org.cogroo/cogroo-nlp

private void processNode(Node node, List<String> sentence, List<String> lemmas, List<String> tags,
  List<String> target, String inheritedTag) {
 String phraseTag = getChunkTag(node.getSyntacticTag());
 boolean inherited = false;
 if (phraseTag.equals("O") && inheritedTag != null) {
  phraseTag = inheritedTag;
  inherited = true;
 }
 TreeElement[] elements = node.getElements();
 for (int i = 0; i < elements.length; i++) {
  if (elements[i].isLeaf()) {
   boolean isIntermediate = false;
   if (i > 0 && elements[i - 1].isLeaf() && phraseTag != null
     && !phraseTag.equals("O")) {
    isIntermediate = true;
   }
   if (inherited && target.size() > 0
     && target.get(target.size() - 1).endsWith(phraseTag)) {
    isIntermediate = true;
   }
   processLeaf((Leaf) elements[i], isIntermediate, phraseTag, sentence, lemmas,
     tags, target);
  } else {
   processNode((Node) elements[i], sentence, lemmas, tags, target, phraseTag);
  }
 }
}
origin: apache/opennlp

while (!nodeStack.isEmpty() && element.getLevel() > 0
  && element.getLevel() <= nodeStack.peek().getLevel()) {
 Node nephew = nodeStack.pop();
if (element.isLeaf() ) {
   int index = nodeStack.size() - 1;
   while (parent == null) {
    if (peek.getLevel() < element.getLevel()) {
     parent = peek;
    } else {
 if (!nodeStack.isEmpty() && nodeStack.peek().getLevel() < element.getLevel()) {
  nodeStack.peek().addElement(element);
 } else {
origin: apache/opennlp

private void process(Node node, List<String> sentence, List<String> tags) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, tags);
   } else {
    process((Node) element, sentence, tags);
   }
  }
 }
}
origin: cogroo/cogroo4

private int countLeafs(Node node) {
 int counter = 0;
 for (TreeElement element : node.getElements()) {
  if(element.isLeaf()) {
   counter++;
  } else {
   counter += countLeafs((Node)element);
  }
 }
 return counter;
}
origin: org.apache.opennlp/opennlp-tools

protected void processRoot(Node root, List<String> sentence, List<String> tags,
  List<String> target) {
 if (root != null) {
  TreeElement[] elements = root.getElements();
  for (int i = 0; i < elements.length; i++) {
   if (elements[i].isLeaf()) {
    processLeaf((Leaf) elements[i], false, OTHER, sentence, tags, target);
   } else {
    processNode((Node) elements[i], sentence, tags, target, null);
   }
  }
 }
}
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

protected void processRoot(Node root, List<String> sentence, List<String> tags,
  List<String> target) {
 if (root != null) {
  TreeElement[] elements = root.getElements();
  for (int i = 0; i < elements.length; i++) {
   if (elements[i].isLeaf()) {
    processLeaf((Leaf) elements[i], false, OTHER, sentence, tags, target);
   } else {
    processNode((Node) elements[i], sentence, tags, target, null);
   }
  }
 }
}
origin: cogroo/cogroo4

private void process(Node node, List<String> sentence, List<String> tags,
  List<String> con, List<String> prop) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, tags, con, prop);
   } else {
    process((Node) element, sentence, tags, con, prop);
   }
  }
 }
}
origin: cogroo/cogroo4

private void processRoot(Node root, List<String> sentence,List<String> lemmas, List<String> tags,
  List<String> target) {
 if (root != null) {
  TreeElement[] elements = root.getElements();
  for (int i = 0; i < elements.length; i++) {
   if (elements[i].isLeaf()) {
    processLeaf((Leaf) elements[i], false, "O", sentence, lemmas, tags, target);
   } else {
    processNode((Node) elements[i], sentence, lemmas, tags, target, null);
   }
  }
 }
}
origin: org.apache.opennlp/opennlp-tools

/**
 * Recursive method to process a node in Arvores Deitadas format.
 *
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: org.cogroo/cogroo-nlp

/**
 * Recursive method to process a node in Arvores Deitadas format.
 * 
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: cogroo/cogroo4

/**
 * Recursive method to process a node in Arvores Deitadas format.
 * 
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: cogroo/cogroo4

/**
 * Recursive method to process a node in Arvores Deitadas format.
 * 
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: cogroo/cogroo4

protected void processRoot(Node root, List<String> sentence, List<String> tags,
    List<String> target) {
  if (root != null) {
    TreeElement[] elements = root.getElements();
    for (int i = 0; i < elements.length; i++) {
      if (elements[i].isLeaf()) {
        processLeaf((Leaf) elements[i], false, OTHER, sentence, tags, target);
      } else {
        processNode((Node) elements[i], sentence, tags, target, null);
      }
    }
  }
}
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

/**
 * Recursive method to process a node in Arvores Deitadas format.
 *
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: org.cogroo/cogroo-nlp

private void processRoot(Node root, List<String> sentence,List<String> lemmas, List<String> tags,
  List<String> target) {
 if (root != null) {
  TreeElement[] elements = root.getElements();
  for (int i = 0; i < elements.length; i++) {
   if (elements[i].isLeaf()) {
    processLeaf((Leaf) elements[i], false, "O", sentence, lemmas, tags, target);
   } else {
    processNode((Node) elements[i], sentence, lemmas, tags, target, null);
   }
  }
 }
}
origin: org.cogroo/cogroo-nlp

/**
 * Recursive method to process a node in Arvores Deitadas format.
 * 
 * @param node
 *          the node to be processed
 * @param sentence
 *          the sentence tokens we got so far
 * @param names
 *          the names we got so far
 */
private void process(Node node, List<String> sentence, List<Span> names) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, names);
   } else {
    process((Node) element, sentence, names);
   }
  }
 }
}
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

private void process(Node node, List<String> sentence, List<String> tags) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, tags);
   } else {
    process((Node) element, sentence, tags);
   }
  }
 }
}
origin: org.cogroo/cogroo-nlp

private int countLeafs(Node node) {
 int counter = 0;
 for (TreeElement element : node.getElements()) {
  if(element.isLeaf()) {
   counter++;
  } else {
   counter += countLeafs((Node)element);
  }
 }
 return counter;
}
origin: cogroo/cogroo4

private void processNode(Node node, List<String> sentence, List<String> lemmas, List<String> tags,
  List<String> target, String inheritedTag) {
 String phraseTag = getChunkTag(node.getSyntacticTag());
 boolean inherited = false;
 if (phraseTag.equals("O") && inheritedTag != null) {
  phraseTag = inheritedTag;
  inherited = true;
 }
 TreeElement[] elements = node.getElements();
 for (int i = 0; i < elements.length; i++) {
  if (elements[i].isLeaf()) {
   boolean isIntermediate = false;
   if (i > 0 && elements[i - 1].isLeaf() && phraseTag != null
     && !phraseTag.equals("O")) {
    isIntermediate = true;
   }
   if (inherited && target.size() > 0
     && target.get(target.size() - 1).endsWith(phraseTag)) {
    isIntermediate = true;
   }
   processLeaf((Leaf) elements[i], isIntermediate, phraseTag, sentence, lemmas,
     tags, target);
  } else {
   processNode((Node) elements[i], sentence, lemmas, tags, target, phraseTag);
  }
 }
}
origin: org.cogroo/cogroo-nlp

private void process(Node node, List<String> sentence, List<String> tags,
  List<String> con, List<String> prop) {
 if (node != null) {
  for (TreeElement element : node.getElements()) {
   if (element.isLeaf()) {
    processLeaf((Leaf) element, sentence, tags, con, prop);
   } else {
    process((Node) element, sentence, tags, con, prop);
   }
  }
 }
}
opennlp.tools.formats.adADSentenceStream$SentenceParser$TreeElement

Javadoc

Represents a tree element, Node or Leaf

Most used methods

  • isLeaf
  • getLevel

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getSystemService (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Path (java.nio.file)
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • JLabel (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now