public class RegexTagger extends Object
A class for tagging a sequence using a LayeredTokenPattern pattern.
The tagger is defined by a pattern and a tag. Given a LayeredSequence
object, the tag(LayeredSequence) method will return a list of
strings, where each string is either the tag, or the OUT_TAG symbol.
For example, given the sequence "she sells sea shells by the shore", the tag symbol "X" and a regular expression that matches the words starting with s, the tagger will return the list [X, X, X, X, O, O, X].
| Modifier and Type | Field and Description |
|---|---|
static String |
OUT_TAG
The symbol used to represent a token that did not match the pattern.
|
| Constructor and Description |
|---|
RegexTagger(LayeredTokenPattern pattern,
String tag) |
public static final String OUT_TAG
public RegexTagger(LayeredTokenPattern pattern, String tag)
pattern - the regular expression to matchtag - the tag to use for matching tokenspublic List<String> tag(LayeredSequence seq) throws SequenceException
seq - SequenceException - if unable to match against seqCopyright © 2010-2013 University of Washington CSE. All Rights Reserved.