public final class TreeUtils extends Object
Modifier and Type | Method and Description |
---|---|
static TopTreebankNode |
buildAlignedTree(org.apache.uima.jcas.JCas jcas,
opennlp.tools.parser.Parse parse,
org.apache.uima.jcas.cas.FSArray terminalArray,
Sentence sentence) |
static TopTreebankNode |
buildAlignedTree(org.apache.uima.jcas.JCas jcas,
opennlp.tools.parser.Parse parse,
Sentence sentence) |
static boolean |
contains(SimpleTree node,
SimpleTree frag) |
static boolean |
contains(SimpleTree node,
SimpleTree frag,
boolean ignoreCase) |
static boolean |
containsDepFrag(SimpleTree node,
SimpleTree frag,
boolean ignoreCase) |
static boolean |
containsDepFragIgnoreCase(SimpleTree node,
SimpleTree frag) |
static boolean |
containsIgnoreCase(SimpleTree node,
SimpleTree frag) |
static int |
countDepFrags(SimpleTree node,
SimpleTree frag) |
static int |
countFrags(SimpleTree node,
SimpleTree frag) |
static opennlp.tools.parser.Parse |
ctakesTokensToOpennlpTokens(int sentenceOffset,
String text,
org.apache.uima.jcas.cas.FSArray terminalArray) |
static String |
escapePunct(String in) |
static int |
getHighestIndexTerm(TreebankNode inTree) |
static List<opennlp.tools.parser.Parse> |
getNodeList(opennlp.tools.parser.Parse tree) |
static List<TreebankNode> |
getNodeList(TopTreebankNode tree) |
static String |
getSplitSentence(org.apache.uima.jcas.cas.FSArray terminalArray) |
static org.apache.uima.jcas.cas.FSArray |
getTerminals(org.apache.uima.jcas.JCas jcas,
Sentence sentence) |
static TopTreebankNode |
getTopNode(TreebankNode inTree) |
static void |
replaceChild(TreebankNode parent,
TreebankNode oldTree,
TreebankNode newTree) |
static String |
tree2str(TreebankNode pathTree) |
public static List<TreebankNode> getNodeList(TopTreebankNode tree)
public static List<opennlp.tools.parser.Parse> getNodeList(opennlp.tools.parser.Parse tree)
public static String tree2str(TreebankNode pathTree)
public static boolean containsIgnoreCase(SimpleTree node, SimpleTree frag)
public static boolean contains(SimpleTree node, SimpleTree frag)
public static boolean contains(SimpleTree node, SimpleTree frag, boolean ignoreCase)
public static int countFrags(SimpleTree node, SimpleTree frag)
public static int countDepFrags(SimpleTree node, SimpleTree frag)
public static boolean containsDepFragIgnoreCase(SimpleTree node, SimpleTree frag)
public static boolean containsDepFrag(SimpleTree node, SimpleTree frag, boolean ignoreCase)
public static int getHighestIndexTerm(TreebankNode inTree)
public static TopTreebankNode getTopNode(TreebankNode inTree)
public static TopTreebankNode buildAlignedTree(org.apache.uima.jcas.JCas jcas, opennlp.tools.parser.Parse parse, Sentence sentence) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
jcas
- ye olde ...parse
- opennlp parsesentence
- -org.apache.uima.analysis_engine.AnalysisEngineProcessException
- thrown by recursivelyCreateStructure(org.apache.uima.jcas.JCas, org.apache.ctakes.typesystem.type.syntax.TreebankNode, opennlp.tools.parser.Parse, org.apache.ctakes.typesystem.type.syntax.TopTreebankNode)
public static TopTreebankNode buildAlignedTree(org.apache.uima.jcas.JCas jcas, opennlp.tools.parser.Parse parse, org.apache.uima.jcas.cas.FSArray terminalArray, Sentence sentence) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
jcas
- ye olde ...parse
- opennlp parseterminalArray
- [token] terminals in the sentencesentence
- -org.apache.uima.analysis_engine.AnalysisEngineProcessException
- thrown by recursivelyCreateStructure(org.apache.uima.jcas.JCas, org.apache.ctakes.typesystem.type.syntax.TreebankNode, opennlp.tools.parser.Parse, org.apache.ctakes.typesystem.type.syntax.TopTreebankNode)
public static org.apache.uima.jcas.cas.FSArray getTerminals(org.apache.uima.jcas.JCas jcas, Sentence sentence)
jcas
- ye olde ...sentence
- sentence annotationpublic static String getSplitSentence(org.apache.uima.jcas.cas.FSArray terminalArray)
public static void replaceChild(TreebankNode parent, TreebankNode oldTree, TreebankNode newTree)
public static opennlp.tools.parser.Parse ctakesTokensToOpennlpTokens(int sentenceOffset, String text, org.apache.uima.jcas.cas.FSArray terminalArray)
sentenceOffset
- begin offest character index for sentencetext
- text of the sentenceterminalArray
- [token] terminals in the sentenceCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.