Class AbstractTreeAnnotator
- java.lang.Object
-
- io.outofprintmagazine.nlp.pipeline.annotators.AbstractAnnotator
-
- io.outofprintmagazine.nlp.pipeline.annotators.AbstractPosAnnotator
-
- io.outofprintmagazine.nlp.pipeline.annotators.AbstractTreeAnnotator
-
- All Implemented Interfaces:
edu.stanford.nlp.pipeline.Annotator,IOOPAnnotator
- Direct Known Subclasses:
AsAnnotator,BecauseAnnotator,DatesAnnotator,HowAnnotator,IfAnnotator,LikeAnnotator,WhatAnnotator,WhenAnnotator,WhereAnnotator,WhoAnnotator,WhyAnnotator
public abstract class AbstractTreeAnnotator extends AbstractPosAnnotator implements edu.stanford.nlp.pipeline.Annotator, IOOPAnnotator
Base class for custom annotators that work with constituency trees (Core Nlp parse).
Subclasses are encouraged to override the scoreTree method and invoke the superclass traverseTree method.
- Author:
- Ram Sadasiv
-
-
Field Summary
Fields Modifier and Type Field Description protected IScorerlistScorerprotected ISerializerlistSerializerprotected List<String>omitPunctuationMarksprotected List<String>removeLeadingSpace-
Fields inherited from class io.outofprintmagazine.nlp.pipeline.annotators.AbstractPosAnnotator
tags
-
Fields inherited from class io.outofprintmagazine.nlp.pipeline.annotators.AbstractAnnotator
dictionaryPOS, parameterStore, punctuationMarks, scorer, serializer
-
Fields inherited from interface edu.stanford.nlp.pipeline.Annotator
DEFAULT_REQUIREMENTS, STANFORD_CLEAN_XML, STANFORD_COLUMN_DATA_CLASSIFIER, STANFORD_COREF, STANFORD_COREF_MENTION, STANFORD_DEPENDENCIES, STANFORD_DETERMINISTIC_COREF, STANFORD_DOCDATE, STANFORD_ENTITY_MENTIONS, STANFORD_GENDER, STANFORD_KBP, STANFORD_LEMMA, STANFORD_LINK, STANFORD_MWT, STANFORD_NATLOG, STANFORD_NER, STANFORD_OPENIE, STANFORD_PARSE, STANFORD_POS, STANFORD_QUOTE, STANFORD_QUOTE_ATTRIBUTION, STANFORD_REGEXNER, STANFORD_RELATION, STANFORD_SENTIMENT, STANFORD_SSPLIT, STANFORD_TOKENIZE, STANFORD_TOKENSREGEX, STANFORD_TRUECASE, STANFORD_UD_FEATURES
-
-
Constructor Summary
Constructors Constructor Description AbstractTreeAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetOwnText(edu.stanford.nlp.trees.Tree tree)protected StringgetOwnText(edu.stanford.nlp.trees.Tree tree, List<String> tags)protected voidscoreTree(edu.stanford.nlp.trees.Tree pTree, List<PhraseAnnotation> scoreMap)protected voidscoreTree(edu.stanford.nlp.trees.Tree pTree, List<String> tags, List<PhraseAnnotation> scoreMap)protected voidscoreTree(edu.stanford.nlp.trees.Tree pTree, List<String> tags, Map<String,BigDecimal> scoreMap)protected voidscoreTree(edu.stanford.nlp.trees.Tree pTree, Map<String,BigDecimal> scoreMap)protected voidtraverseTree(edu.stanford.nlp.trees.Tree tree, List<PhraseAnnotation> scoreMap)protected voidtraverseTree(edu.stanford.nlp.trees.Tree tree, List<String> tags, List<PhraseAnnotation> scoreMap)protected voidtraverseTree(edu.stanford.nlp.trees.Tree tree, List<String> tags, Map<String,BigDecimal> scoreMap)protected voidtraverseTree(edu.stanford.nlp.trees.Tree tree, Map<String,BigDecimal> scoreMap)-
Methods inherited from class io.outofprintmagazine.nlp.pipeline.annotators.AbstractPosAnnotator
appendTagsFromFile, getTags, requires, scoreLemma, scoreLemma, scoreTag, scoreTag, scoreToken, scoreToken, setTags
-
Methods inherited from class io.outofprintmagazine.nlp.pipeline.annotators.AbstractAnnotator
addToScoreList, addToScoreMap, annotate, getAnnotationClass, getContextWords, getParameterStore, getScorer, getSerializer, hasPunctuationMark, init, isDictionaryWord, isPunctuationMark, requirementsSatisfied, score, serialize, serializeAggregateDocument, setScorer, setSerializer, toAlphaNumeric
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.stanford.nlp.pipeline.Annotator
annotate, requirementsSatisfied, requires, unmount
-
Methods inherited from interface io.outofprintmagazine.nlp.pipeline.annotators.IOOPAnnotator
getAnnotationClass, getDescription, init, score, serialize, serializeAggregateDocument
-
-
-
-
Method Detail
-
traverseTree
protected void traverseTree(edu.stanford.nlp.trees.Tree tree, Map<String,BigDecimal> scoreMap) throws IOException- Throws:
IOException
-
traverseTree
protected void traverseTree(edu.stanford.nlp.trees.Tree tree, List<String> tags, Map<String,BigDecimal> scoreMap) throws IOException- Throws:
IOException
-
scoreTree
protected void scoreTree(edu.stanford.nlp.trees.Tree pTree, Map<String,BigDecimal> scoreMap) throws IOException- Throws:
IOException
-
scoreTree
protected void scoreTree(edu.stanford.nlp.trees.Tree pTree, List<String> tags, Map<String,BigDecimal> scoreMap) throws IOException- Throws:
IOException
-
traverseTree
protected void traverseTree(edu.stanford.nlp.trees.Tree tree, List<PhraseAnnotation> scoreMap) throws IOException- Throws:
IOException
-
traverseTree
protected void traverseTree(edu.stanford.nlp.trees.Tree tree, List<String> tags, List<PhraseAnnotation> scoreMap) throws IOException- Throws:
IOException
-
scoreTree
protected void scoreTree(edu.stanford.nlp.trees.Tree pTree, List<PhraseAnnotation> scoreMap) throws IOException- Throws:
IOException
-
scoreTree
protected void scoreTree(edu.stanford.nlp.trees.Tree pTree, List<String> tags, List<PhraseAnnotation> scoreMap) throws IOException- Throws:
IOException
-
getOwnText
protected String getOwnText(edu.stanford.nlp.trees.Tree tree)
-
-