|
|||||||||
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 of this method 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.
Field Summary | |
---|---|
static String |
DEFAULT_ENCODING
Use this as the default encoding for Readers and Writers of Treebank data. |
Method Summary | |
---|---|
String |
basicCategory(String category)
Returns the basic syntactic category of a String by truncating stuff after a (non-word-initial) occurrence of one of the labelAnnotationIntroducingCharacters() . |
String |
categoryAndFunction(String category)
Returns the syntactic category and 'function' of a String. |
Filter |
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 |
evalBIgnoredPunctuationTagRejectFilter()
Returns a filter that accepts everything except a String that is a punctuation tag that should be ignored by EVALB-style evaluation. |
String[] |
evalBIgnoredPunctuationTags()
Returns a String array of punctuation tags that EVALB-style evaluation should ignore for this treebank/language. |
Function |
getBasicCategoryFunction()
Returns a Function object that maps Strings to Strings according
to this TreebankLanguagePack's basicCategory method. |
Function |
getCategoryAndFunctionFunction()
Returns a Function object that maps Strings to Strings according
to this TreebankLanguagePack's categoryAndFunction method. |
String |
getEncoding()
Return the charset encoding of the Treebank. |
TokenizerFactory |
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. |
boolean |
isEvalBIgnoredPunctuationTag(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(String str)
Accepts a String that is a punctuation tag name, and rejects everything else. |
boolean |
isPunctuationWord(String str)
Accepts a String that is a punctuation word, and rejects everything else. |
boolean |
isSentenceFinalPunctuationTag(String str)
Accepts a String that is a sentence end punctuation tag, and rejects everything else. |
boolean |
isStartSymbol(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 |
punctuationTagAcceptFilter()
Return a filter that accepts a String that is a punctuation tag name, and rejects everything else. |
Filter |
punctuationTagRejectFilter()
Return a filter that rejects a String that is a punctuation tag name, and rejects everything else. |
String[] |
punctuationTags()
Returns a String array of punctuation tags for this treebank/language. |
Filter |
punctuationWordAcceptFilter()
Returns a filter that accepts a String that is a punctuation word, and rejects everything else. |
Filter |
punctuationWordRejectFilter()
Returns a filter that accepts a String that is not a punctuation word, and rejects punctuation. |
String[] |
punctuationWords()
Returns a String array of punctuation words for this treebank/language. |
Filter |
sentenceFinalPunctuationTagAcceptFilter()
Returns a filter that accepts a String that is a sentence end punctuation tag, and rejects everything else. |
String[] |
sentenceFinalPunctuationTags()
Returns a String array of sentence final punctuation tags for this treebank/language. |
String[] |
sentenceFinalPunctuationWords()
Returns a String array of sentence final punctuation words for this treebank/language. |
String |
startSymbol()
Returns a String which is the first (perhaps unique) start symbol of the treebank, or null if none is defined. |
Filter |
startSymbolAcceptFilter()
Return a filter that accepts a String that is a start symbol of the treebank, and rejects everything else. |
String[] |
startSymbols()
Returns a String array of treebank start symbols. |
String |
treebankFileExtension()
Returns the extension of treebank files for this treebank. |
Field Detail |
---|
static final String DEFAULT_ENCODING
Method Detail |
---|
boolean isPunctuationTag(String str)
boolean isPunctuationWord(String str)
boolean isSentenceFinalPunctuationTag(String str)
boolean isEvalBIgnoredPunctuationTag(String str)
Filter punctuationTagAcceptFilter()
Filter punctuationTagRejectFilter()
GrammaticalStructureFactory grammaticalStructureFactory()
Filter punctuationWordAcceptFilter()
Filter punctuationWordRejectFilter()
Filter sentenceFinalPunctuationTagAcceptFilter()
Filter evalBIgnoredPunctuationTagAcceptFilter()
Filter evalBIgnoredPunctuationTagRejectFilter()
String[] punctuationTags()
String[] punctuationWords()
String[] sentenceFinalPunctuationTags()
String[] sentenceFinalPunctuationWords()
String[] evalBIgnoredPunctuationTags()
String getEncoding()
Charset
class.
TokenizerFactory getTokenizerFactory()
char[] labelAnnotationIntroducingCharacters()
boolean isLabelAnnotationIntroducingCharacter(char ch)
String basicCategory(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
Function getBasicCategoryFunction()
Function
object that maps Strings to Strings according
to this TreebankLanguagePack's basicCategory method.
String categoryAndFunction(String category)
category-function
.
category
- The whole String name of the label
Function getCategoryAndFunctionFunction()
Function
object that maps Strings to Strings according
to this TreebankLanguagePack's categoryAndFunction method.
boolean isStartSymbol(String str)
Filter startSymbolAcceptFilter()
String[] startSymbols()
String startSymbol()
String treebankFileExtension()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |