|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.context.Representation
de.fu_berlin.ties.context.AbstractRepresentation
public abstract class AbstractRepresentation
Provides basic functionality shared by different representations.
Field Summary | |
---|---|
static String |
CONFIG_RECOGN_NUM
Configuration key: The number of preceding recognitions to represent. |
static String |
CONFIG_SPLIT_MAXIMUM
Configuration key: The maximum number of subsequences to keep when a feature value must be split. |
static String |
CONFIG_STORE_NTH
Configuration key: Each n-th context representation is stored for debugging and inspection purposes,if > 0. |
Constructor Summary | |
---|---|
AbstractRepresentation(int recogNum,
int splitMax,
int n,
String outCharset)
Creates a new instance. |
Method Summary | |
---|---|
FeatureVector |
buildContext(Element element,
String leftText,
String mainText,
String rightText,
PriorRecognitions priorRecognitions,
Map<Element,List<LocalFeature>> featureCache,
String logPurpose)
Builds the context representation of text in an element. |
protected abstract FeatureVector |
doBuildContext(Element element,
String leftText,
String mainText,
String rightText,
PriorRecognitions priorRecognitions,
Map<Element,List<LocalFeature>> featureCache,
String logPurpose)
Builds the context representation of text in an element. |
int |
getSplitMaximum()
Returns the maximum number of subsequences to keep when a feature value must be split (at whitespace). |
int |
getStoreN()
Each storeN-th context representation is stored for debugging and inspection purposes (if > 0, otherwise no representation is stored). |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class de.fu_berlin.ties.context.Representation |
---|
buildContext, buildContext, createRecognitionBuffer, getRecognitionNumber |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONFIG_RECOGN_NUM
public static final String CONFIG_SPLIT_MAXIMUM
public static final String CONFIG_STORE_NTH
Constructor Detail |
---|
public AbstractRepresentation(int recogNum, int splitMax, int n, String outCharset)
recogNum
- the number of preceding recognitions to representsplitMax
- the maximum number of subsequences to keep when
a feature value must be split (at whitespace).n
- Each n-th context representation is stored if > 0;
otherwise no representation is storedoutCharset
- the output character set to use (only used to
store some configurations for inspection purposes, if n
> 0); if null
, the default charset of the current
platform is usedMethod Detail |
---|
public final FeatureVector buildContext(Element element, String leftText, String mainText, String rightText, PriorRecognitions priorRecognitions, Map<Element,List<LocalFeature>> featureCache, String logPurpose) throws ClassCastException, IllegalArgumentException
buildContext
in class Representation
element
- the element whose context should be representedleftText
- textual content to the left of (preceding)
mainText
, might be emptymainText
- the main textual content to represent, might be emptyrightText
- textual content to the right of (following)
mainText
, might be emptypriorRecognitions
- a buffer of the last Recognition
s from
the document, created by calling Representation.createRecognitionBuffer()
;
might be null
featureCache
- a cache of (local) feature, should be re-used
between all calls for the nodes in a single document (but must not be
re-used when building the context of nodes in different documents!)logPurpose
- the type of contexts of main interest to the caller
(e.g. "Token" or "Sentence"), used for logging
ClassCastException
- if the priorRecognitions
buffer
contains objects that aren't Recognition
s
IllegalArgumentException
- if the specified node is of an
unsupported typeprotected abstract FeatureVector doBuildContext(Element element, String leftText, String mainText, String rightText, PriorRecognitions priorRecognitions, Map<Element,List<LocalFeature>> featureCache, String logPurpose) throws ClassCastException, IllegalArgumentException
element
- the element whose context should be representedleftText
- textual content to the left of (preceding)
mainText
, might be emptymainText
- the main textual content to represent, might be emptyrightText
- textual content to the right of (following)
mainText
, might be emptypriorRecognitions
- a buffer of the last Recognition
s from
the document, created by calling Representation.createRecognitionBuffer()
;
might be null
featureCache
- a cache of (local) feature, should be re-used
between all calls for the nodes in a single document (but must not be
re-used when building the context of nodes in different documents!)logPurpose
- the type of contexts of main interest to the caller
(e.g. "Token" or "Sentence"), used for logging
ClassCastException
- if the priorRecognitions
buffer
contains objects that aren't Recognition
s
IllegalArgumentException
- if the specified node is of an
unsupported typepublic int getSplitMaximum()
public int getStoreN()
public String toString()
toString
in class Representation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |