public class SyntacticPathExtractor extends Object implements FeatureExtractor2<TreebankNode,TreebankNode>
| Modifier and Type | Field and Description |
|---|---|
protected String |
DOWN_SEPARATOR |
protected boolean |
isPartial |
protected String |
name |
protected FeatureExtractor1<TreebankNode> |
pathMemberExtractor |
protected String |
UP_SEPARATOR |
| Constructor and Description |
|---|
SyntacticPathExtractor(FeatureExtractor1<TreebankNode> pathMemberExtractor)
This constructor defaults to a full rather than a partial path.
|
SyntacticPathExtractor(FeatureExtractor1<TreebankNode> pathMemberExtractor,
boolean partial) |
| Modifier and Type | Method and Description |
|---|---|
List<Feature> |
extract(JCas view,
TreebankNode leftConstituent,
TreebankNode rightConstituent)
Extract a string representation of a path feature.
|
protected final String DOWN_SEPARATOR
protected boolean isPartial
protected FeatureExtractor1<TreebankNode> pathMemberExtractor
protected final String UP_SEPARATOR
public SyntacticPathExtractor(FeatureExtractor1<TreebankNode> pathMemberExtractor)
public SyntacticPathExtractor(FeatureExtractor1<TreebankNode> pathMemberExtractor, boolean partial)
pathMemberExtractor - this extractor will be used to get a feature for every node on the path, which will
then be combined to form a single string. The extractor should preferably generate
exactly one StringFeature, but must generate at least one
StringFeature, LongFeature, DoubleFeature, or
BooleanFeature. Only the first feature will then be used and naively
converted to a string.partial - if true, generate a partial path only, i.e. from the first node up to the lowest
common ancestor of the twopublic List<Feature> extract(JCas view, TreebankNode leftConstituent, TreebankNode rightConstituent) throws CleartkExtractorException
extract in interface FeatureExtractor2<TreebankNode,TreebankNode>leftConstituent - the first node of the pathrightConstituent - the last node of the pathCleartkExtractorExceptionCopyright © 2014. All rights reserved.