|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreebankLanguagePack
This interface specifies language/treebank specific information for a Treebank, which a parser or other treebank user might need to know.
Some of this is fixed for a (treebank,language) pair, but some of it reflects feature extraction decisions, so it can be sensible to have multiple implementations of this interface for the same (treebank,language) pair.
So far this covers punctuation, character encodings, and characters reserved for label annotations. It should probably be expanded to cover other stuff (unknown words?).
Various methods in this class return arrays. You should treat them as read-only, even though one cannot enforce that in Java.
Implementations in this class do not call basicCategory() on arguments before testing them, so if needed, you should explicitly call basicCategory() yourself before passing arguments to these routines for testing. This class should be able to be an immutable singleton. It contains data on various things, but no state. At some point we should make it a real immutable singleton.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ENCODING
Use this as the default encoding for Readers and Writers of Treebank data. |
Method Summary | |
---|---|
java.lang.String |
basicCategory(java.lang.String category)
Returns the basic syntactic category of a String by truncating stuff after a (non-word-initial) occurrence of one of the labelAnnotationIntroducingCharacters() . |
java.lang.String |
categoryAndFunction(java.lang.String category)
Returns the syntactic category and 'function' of a String. |
Filter<java.lang.String> |
evalBIgnoredPunctuationTagAcceptFilter()
Returns a filter that accepts a String that is a punctuation tag that should be ignored by EVALB-style evaluation, and rejects everything else. |
Filter<java.lang.String> |
evalBIgnoredPunctuationTagRejectFilter()
Returns a filter that accepts everything except a String that is a punctuation tag that should be ignored by EVALB-style evaluation. |
java.lang.String[] |
evalBIgnoredPunctuationTags()
Returns a String array of punctuation tags that EVALB-style evaluation should ignore for this treebank/language. |
Function<java.lang.String,java.lang.String> |
getBasicCategoryFunction()
Returns a Function object that maps Strings to Strings according
to this TreebankLanguagePack's basicCategory method. |
Function<java.lang.String,java.lang.String> |
getCategoryAndFunctionFunction()
Returns a Function object that maps Strings to Strings according
to this TreebankLanguagePack's categoryAndFunction method. |
java.lang.String |
getEncoding()
Return the charset encoding of the Treebank. |
TokenizerFactory<? extends HasWord> |
getTokenizerFactory()
Return a tokenizer factory which might be suitable for tokenizing text that will be used with this Treebank/Language pair. |
GrammaticalStructureFactory |
grammaticalStructureFactory()
Return a GrammaticalStructureFactory suitable for this language/treebank. |
GrammaticalStructureFactory |
grammaticalStructureFactory(Filter<java.lang.String> puncFilter)
Return a GrammaticalStructureFactory suitable for this language/treebank. |
HeadFinder |
headFinder()
The HeadFinder to use for your treebank. |
boolean |
isEvalBIgnoredPunctuationTag(java.lang.String str)
Accepts a String that is a punctuation tag that should be ignored by EVALB-style evaluation, and rejects everything else. |
boolean |
isLabelAnnotationIntroducingCharacter(char ch)
Say whether this character is an annotation introducing character. |
boolean |
isPunctuationTag(java.lang.String str)
Accepts a String that is a punctuation tag name, and rejects everything else. |
boolean |
isPunctuationWord(java.lang.String str)
Accepts a String that is a punctuation word, and rejects everything else. |
boolean |
isSentenceFinalPunctuationTag(java.lang.String str)
Accepts a String that is a sentence end punctuation tag, and rejects everything else. |
boolean |
isStartSymbol(java.lang.String str)
Accepts a String that is a start symbol of the treebank. |
char[] |
labelAnnotationIntroducingCharacters()
Return an array of characters at which a String should be truncated to give the basic syntactic category of a label. |
Filter<java.lang.String> |
punctuationTagAcceptFilter()
Return a filter that accepts a String that is a punctuation tag name, and rejects everything else. |
Filter<java.lang.String> |
punctuationTagRejectFilter()
Return a filter that rejects a String that is a punctuation tag name, and accepts everything else. |
java.lang.String[] |
punctuationTags()
Returns a String array of punctuation tags for this treebank/language. |
Filter<java.lang.String> |
punctuationWordAcceptFilter()
Returns a filter that accepts a String that is a punctuation word, and rejects everything else. |
Filter<java.lang.String> |
punctuationWordRejectFilter()
Returns a filter that accepts a String that is not a punctuation word, and rejects punctuation. |
java.lang.String[] |
punctuationWords()
Returns a String array of punctuation words for this treebank/language. |
Filter<java.lang.String> |
sentenceFinalPunctuationTagAcceptFilter()
Returns a filter that accepts a String that is a sentence end punctuation tag, and rejects everything else. |
java.lang.String[] |
sentenceFinalPunctuationTags()
Returns a String array of sentence final punctuation tags for this treebank/language. |
java.lang.String[] |
sentenceFinalPunctuationWords()
Returns a String array of sentence final punctuation words for this treebank/language. |
void |
setGfCharacter(char gfCharacter)
Sets the grammatical function indicating character to gfCharacter. |
java.lang.String |
startSymbol()
Returns a String which is the first (perhaps unique) start symbol of the treebank, or null if none is defined. |
Filter<java.lang.String> |
startSymbolAcceptFilter()
Return a filter that accepts a String that is a start symbol of the treebank, and rejects everything else. |
java.lang.String[] |
startSymbols()
Returns a String array of treebank start symbols. |
java.lang.String |
stripGF(java.lang.String category)
Returns the category for a String with everything following the gf character (which may be language specific) stripped. |
java.lang.String |
treebankFileExtension()
Returns the extension of treebank files for this treebank. |
TreeReaderFactory |
treeReaderFactory()
Returns a TreeReaderFactory suitable for general purpose use with this language/treebank. |
TokenizerFactory<Tree> |
treeTokenizerFactory()
Return a TokenizerFactory for Trees of this language/treebank. |
Field Detail |
---|
static final java.lang.String DEFAULT_ENCODING
Method Detail |
---|
boolean isPunctuationTag(java.lang.String str)
str
- The string to check
boolean isPunctuationWord(java.lang.String str)
str
- The string to check
boolean isSentenceFinalPunctuationTag(java.lang.String str)
str
- The string to check
boolean isEvalBIgnoredPunctuationTag(java.lang.String str)
str
- The string to check
Filter<java.lang.String> punctuationTagAcceptFilter()
Filter<java.lang.String> punctuationTagRejectFilter()
Filter<java.lang.String> punctuationWordAcceptFilter()
Filter<java.lang.String> punctuationWordRejectFilter()
Filter<java.lang.String> sentenceFinalPunctuationTagAcceptFilter()
Filter<java.lang.String> evalBIgnoredPunctuationTagAcceptFilter()
Filter<java.lang.String> evalBIgnoredPunctuationTagRejectFilter()
java.lang.String[] punctuationTags()
java.lang.String[] punctuationWords()
java.lang.String[] sentenceFinalPunctuationTags()
java.lang.String[] sentenceFinalPunctuationWords()
java.lang.String[] evalBIgnoredPunctuationTags()
GrammaticalStructureFactory grammaticalStructureFactory()
GrammaticalStructureFactory grammaticalStructureFactory(Filter<java.lang.String> puncFilter)
puncFilter
- A filter which should reject punctuation words (as Strings)
java.lang.String getEncoding()
Charset
class.
TokenizerFactory<? extends HasWord> getTokenizerFactory()
char[] labelAnnotationIntroducingCharacters()
boolean isLabelAnnotationIntroducingCharacter(char ch)
ch
- A char
java.lang.String basicCategory(java.lang.String category)
labelAnnotationIntroducingCharacters()
. This
function should work on phrasal category and POS tag labels,
but needn't (and couldn't be expected to) work on arbitrary
Word strings.
category
- The whole String name of the label
java.lang.String stripGF(java.lang.String category)
category
- The String name of the label (may previously have had basic category called on it)
Function<java.lang.String,java.lang.String> getBasicCategoryFunction()
Function
object that maps Strings to Strings according
to this TreebankLanguagePack's basicCategory method.
java.lang.String categoryAndFunction(java.lang.String category)
category-function
.
category
- The whole String name of the label
Function<java.lang.String,java.lang.String> getCategoryAndFunctionFunction()
Function
object that maps Strings to Strings according
to this TreebankLanguagePack's categoryAndFunction method.
boolean isStartSymbol(java.lang.String str)
str
- The str to test
Filter<java.lang.String> startSymbolAcceptFilter()
java.lang.String[] startSymbols()
java.lang.String startSymbol()
java.lang.String treebankFileExtension()
void setGfCharacter(char gfCharacter)
gfCharacter
- Sets the character in label names that sets of
grammatical function marking (from the phrase label).TreeReaderFactory treeReaderFactory()
TokenizerFactory<Tree> treeTokenizerFactory()
HeadFinder headFinder()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |