|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.Language
public class Language
Provides objects that perform functions specific to a particular language
and/or Treebank. When the static method setLanguage()
is called,
several objects from a language package are created and stored statically by
this class. This scheme means that Language.setLanguage
should
be called before any language-specific resources or methods are required,
typically early in the execution of a program. A language package must
provide implementations for the following interfaces:
danbikel.parser.english
, using the method setLanguage()
.
setLanguage()
,
Settings
,
Settings.language
,
Settings.languagePackage
,
Serialized FormMethod Summary | |
---|---|
static String |
encoding()
Gets the file encoding for the current language. |
static String |
getLanguage()
Gets the name of the current language. |
static String |
getLanguagePackage()
Gets the name of the current language package. |
static HeadFinder |
headFinder()
Gets the HeadFinder object for the current language. |
static void |
setLanguage()
Sets the language and language package using the values obtained from the Settings class. |
static Training |
training()
Gets the Training object for the current language. |
static Treebank |
treebank()
Gets the Treebank object for the current language. |
static WordFeatures |
wordFeatures()
Gets the WordFeatures object for the current language. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final WordFeatures wordFeatures()
WordFeatures
object for the current language.
public static final HeadFinder headFinder()
HeadFinder
object for the current language.
public static final Treebank treebank()
Treebank
object for the current language.
public static final Training training()
Training
object for the current language.
public static final String encoding()
Settings.get(Settings.fileEncodingPrefix + Settings.language)
is non-null
, then it is used as the file encoding; otherwise,
the file encoding is to be the value ofSystem.getProperty("file.encoding")
.
Settings.fileEncodingPrefix
,
Settings.language
public static void setLanguage()
Settings
class. The language to be set is determined by the value
of the parser.language
property stored in Settings
.
The language package to be set is determined by the value of the
parser.language.package
property stored in
Settings
.
A language package is required to provide concrete subclasses of the following abstract classes:
This method will create one object of each of the required language package classes using the classes' respective default constructors. The objects are created in the order listed above, so any dependencies in a language package must be from later-instantiated to earlier-instantiated classes.The class names of the concrete classes in a language package are assumed to be identical to those listed above, prepended with the string
Settings.get(Settings.languagePackage) + "."If a particular concrete subclass has a different name from the abstract class it extends, the appropriate
Settings
property must be set containing the fully-qualified version
of the class name:
public static final String getLanguage()
public static final String getLanguagePackage()
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |