public class TokenSequenceMatchDataAndTarget extends Pipe implements Serializable
For example, if you have a data file containing one line per token, and the label also appears on that line, you can first get a TokenSequence in which the text of each line is the Token.getText() of each token, then run this pipe, and separate the target information from the data information. For example to process the following,
BACKGROUND Then
PERSON Mr.
PERSON Smith
BACKGROUND said
...
use new TokenSequenceMatchDataAndTarget (Pattern.compile ("([A-Z]+) (.*)"), 2, 1).| Constructor and Description |
|---|
TokenSequenceMatchDataAndTarget(Pattern regex,
int dataGroup,
int targetGroup) |
TokenSequenceMatchDataAndTarget(String regex,
int dataGroup,
int targetGroup) |
| Modifier and Type | Method and Description |
|---|---|
Instance |
pipe(Instance carrier)
Process an Instance.
|
getDataAlphabet, getInstanceId, getParent, getParentRoot, getTargetAlphabet, isDataAlphabetSet, isTargetProcessing, pipe, readResolve, resolveDataAlphabet, resolveTargetAlphabet, setDataAlphabet, setParent, setTargetAlphabet, setTargetProcessingpublic TokenSequenceMatchDataAndTarget(Pattern regex, int dataGroup, int targetGroup)
public TokenSequenceMatchDataAndTarget(String regex, int dataGroup, int targetGroup)
public Instance pipe(Instance carrier)
PipeOne can create a new concrete subclass of Pipe simply by implementing this method.
Copyright © 2019 JULIE Lab, Germany. All rights reserved.