edu.stanford.nlp.trees.international.pennchinese
Class ChineseTreebankLanguagePack

java.lang.Object
  extended by edu.stanford.nlp.trees.AbstractTreebankLanguagePack
      extended by edu.stanford.nlp.trees.international.pennchinese.ChineseTreebankLanguagePack
All Implemented Interfaces:
TreebankLanguagePack, Serializable

public class ChineseTreebankLanguagePack
extends AbstractTreebankLanguagePack
implements Serializable

Language pack for Chinese treebank. (Look into using native2ascii to edit this file as a GB file)

Author:
Roger Levy
See Also:
Serialized Form

Field Summary
static String ENCODING
           
 
Fields inherited from class edu.stanford.nlp.trees.AbstractTreebankLanguagePack
DEFAULT_ENCODING
 
Constructor Summary
ChineseTreebankLanguagePack()
           
 
Method Summary
static Filter chineseColonAcceptFilter()
           
static Filter chineseCommaAcceptFilter()
           
static Filter chineseDashAcceptFilter()
           
static Filter chineseDouHaoAcceptFilter()
           
static Filter chineseEndSentenceAcceptFilter()
           
static Filter chineseLeftParenthesisAcceptFilter()
           
static Filter chineseLeftQuoteMarkAcceptFilter()
           
static Filter chineseOtherAcceptFilter()
           
static Filter chineseParenthesisAcceptFilter()
           
static Filter chineseQuoteMarkAcceptFilter()
           
static Filter chineseRightParenthesisAcceptFilter()
           
static Filter chineseRightQuoteMarkAcceptFilter()
           
 String getEncoding()
          Return the input Charset encoding for the Treebank.
 TokenizerFactory getTokenizerFactory()
          Return a tokenizer which might be suitable for tokenizing text that will be used with this Treebank/Language pair, without tokenizing carriage returns (i.e., treating them as white space).
 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 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.
 char[] labelAnnotationIntroducingCharacters()
          Return an array of characters at which a String should be truncated to give the basic syntactic category of a label.
 String[] punctuationTags()
          Returns a String array of punctuation tags for this treebank/language.
 String[] punctuationWords()
          Returns a String array of punctuation words for this treebank/language.
 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.
static void setTokenizerFactory(TokenizerFactory tf)
           
 String[] startSymbols()
          Returns a String array of treebank start symbols.
 String treebankFileExtension()
          Returns the extension of treebank files for this treebank.
 
Methods inherited from class edu.stanford.nlp.trees.AbstractTreebankLanguagePack
basicCategory, categoryAndFunction, evalBIgnoredPunctuationTagAcceptFilter, evalBIgnoredPunctuationTagRejectFilter, evalBIgnoredPunctuationTags, getBasicCategoryFunction, getCategoryAndFunctionFunction, isLabelAnnotationIntroducingCharacter, isStartSymbol, punctuationTagAcceptFilter, punctuationTagRejectFilter, punctuationWordAcceptFilter, punctuationWordRejectFilter, sentenceFinalPunctuationTagAcceptFilter, startSymbol, startSymbolAcceptFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
See Also:
Constant Field Values
Constructor Detail

ChineseTreebankLanguagePack

public ChineseTreebankLanguagePack()
Method Detail

setTokenizerFactory

public static void setTokenizerFactory(TokenizerFactory tf)

getTokenizerFactory

public TokenizerFactory getTokenizerFactory()
Description copied from class: AbstractTreebankLanguagePack
Return a tokenizer which might be suitable for tokenizing text that will be used with this Treebank/Language pair, without tokenizing carriage returns (i.e., treating them as white space). The implementation in AbstractTreebankLanguagePack returns a factory for WhitespaceTokenizer.

Specified by:
getTokenizerFactory in interface TreebankLanguagePack
Overrides:
getTokenizerFactory in class AbstractTreebankLanguagePack
Returns:
A tokenizer

getEncoding

public String getEncoding()
Return the input Charset encoding for the Treebank. See documentation for the Charset class.

Specified by:
getEncoding in interface TreebankLanguagePack
Overrides:
getEncoding in class AbstractTreebankLanguagePack
Returns:
Name of Charset

isPunctuationTag

public boolean isPunctuationTag(String str)
Accepts a String that is a punctuation tag name, and rejects everything else.

Specified by:
isPunctuationTag in interface TreebankLanguagePack
Overrides:
isPunctuationTag in class AbstractTreebankLanguagePack
Returns:
Whether this is a punctuation tag

isPunctuationWord

public boolean isPunctuationWord(String str)
Accepts a String that is a punctuation word, and rejects everything else. If one can't tell for sure (as for ' in the Penn Treebank), it maks the best guess that it can.

Specified by:
isPunctuationWord in interface TreebankLanguagePack
Overrides:
isPunctuationWord in class AbstractTreebankLanguagePack
Returns:
Whether this is a punctuation word

isSentenceFinalPunctuationTag

public boolean isSentenceFinalPunctuationTag(String str)
Accepts a String that is a sentence end punctuation tag, and rejects everything else.

Specified by:
isSentenceFinalPunctuationTag in interface TreebankLanguagePack
Overrides:
isSentenceFinalPunctuationTag in class AbstractTreebankLanguagePack
Returns:
Whether this is a sentence final punctuation tag

punctuationTags

public String[] punctuationTags()
Returns a String array of punctuation tags for this treebank/language.

Specified by:
punctuationTags in interface TreebankLanguagePack
Specified by:
punctuationTags in class AbstractTreebankLanguagePack
Returns:
The punctuation tags

punctuationWords

public String[] punctuationWords()
Returns a String array of punctuation words for this treebank/language.

Specified by:
punctuationWords in interface TreebankLanguagePack
Specified by:
punctuationWords in class AbstractTreebankLanguagePack
Returns:
The punctuation words

sentenceFinalPunctuationTags

public String[] sentenceFinalPunctuationTags()
Returns a String array of sentence final punctuation tags for this treebank/language.

Specified by:
sentenceFinalPunctuationTags in interface TreebankLanguagePack
Specified by:
sentenceFinalPunctuationTags in class AbstractTreebankLanguagePack
Returns:
The sentence final punctuation tags

sentenceFinalPunctuationWords

public String[] sentenceFinalPunctuationWords()
Returns a String array of sentence final punctuation words for this treebank/language.

Specified by:
sentenceFinalPunctuationWords in interface TreebankLanguagePack
Returns:
The sentence final punctuation tags

isEvalBIgnoredPunctuationTag

public boolean isEvalBIgnoredPunctuationTag(String str)
Accepts a String that is a punctuation tag that should be ignored by EVALB-style evaluation, and rejects everything else. Traditionally, EVALB has ignored a subset of the total set of punctuation tags in the English Penn Treebank (quotes and period, comma, colon, etc., but not brackets)

Specified by:
isEvalBIgnoredPunctuationTag in interface TreebankLanguagePack
Overrides:
isEvalBIgnoredPunctuationTag in class AbstractTreebankLanguagePack
Returns:
Whether this is a EVALB-ignored punctuation tag

labelAnnotationIntroducingCharacters

public char[] labelAnnotationIntroducingCharacters()
Return an array of characters at which a String should be truncated to give the basic syntactic category of a label. The idea here is that Penn treebank style labels follow a syntactic category with various functional and crossreferencing information introduced by special characters (such as "NP-SBJ=1"). This would be truncated to "NP" by the array containing '-' and "=".

Specified by:
labelAnnotationIntroducingCharacters in interface TreebankLanguagePack
Overrides:
labelAnnotationIntroducingCharacters in class AbstractTreebankLanguagePack
Returns:
An array of characters that set off label name suffixes

startSymbols

public String[] startSymbols()
Returns a String array of treebank start symbols.

Specified by:
startSymbols in interface TreebankLanguagePack
Specified by:
startSymbols in class AbstractTreebankLanguagePack
Returns:
The start symbols

chineseCommaAcceptFilter

public static Filter chineseCommaAcceptFilter()

chineseEndSentenceAcceptFilter

public static Filter chineseEndSentenceAcceptFilter()

chineseDouHaoAcceptFilter

public static Filter chineseDouHaoAcceptFilter()

chineseQuoteMarkAcceptFilter

public static Filter chineseQuoteMarkAcceptFilter()

chineseParenthesisAcceptFilter

public static Filter chineseParenthesisAcceptFilter()

chineseColonAcceptFilter

public static Filter chineseColonAcceptFilter()

chineseDashAcceptFilter

public static Filter chineseDashAcceptFilter()

chineseOtherAcceptFilter

public static Filter chineseOtherAcceptFilter()

chineseLeftParenthesisAcceptFilter

public static Filter chineseLeftParenthesisAcceptFilter()

chineseRightParenthesisAcceptFilter

public static Filter chineseRightParenthesisAcceptFilter()

chineseLeftQuoteMarkAcceptFilter

public static Filter chineseLeftQuoteMarkAcceptFilter()

chineseRightQuoteMarkAcceptFilter

public static Filter chineseRightQuoteMarkAcceptFilter()

treebankFileExtension

public String treebankFileExtension()
Returns the extension of treebank files for this treebank. This is "fid".

Specified by:
treebankFileExtension in interface TreebankLanguagePack

grammaticalStructureFactory

public GrammaticalStructureFactory grammaticalStructureFactory()
Description copied from class: AbstractTreebankLanguagePack
Return a GrammaticalStructureFactory suitable for this language/treebank. (To be overridden in subclasses.)

Specified by:
grammaticalStructureFactory in interface TreebankLanguagePack
Overrides:
grammaticalStructureFactory in class AbstractTreebankLanguagePack
Returns:
A GrammaticalStructureFactory suitable for this language/treebank


Stanford NLP Group