|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.parser.Settings
public class Settings
Provides static settings for this package, primarily via an internal
Properties
object. All recognized properties of this package and
the supplied language packages are provided as publicly-accessible constants.
headTablePrefix + language
.fileEncodingPrefix + language
to override the default file
encoding as determined by the locale of the Java VM. Settings files
for a particular language and/or Treebank may contain any other settings
required by a language package.
Variable expansion is performed on property values as in Java security
policy files, with the additional provision that properties defined earlier
in a settings file can be used as variable names in subsequent lines of the
settings file. See Text.expandVars(Properties,StringBuffer)
for
what variables are allowed in the definitions of property values.
Upon intialization, this class attempts to read default parser settings from
the file settings inside the default settings directory,
$HOME/.db-parser, where $HOME is ther user's home
directory, as defined by the system property user.home. If either
the default settings directory or the default settings file is missing,
this class will use fallback default settings from a resource that is
bundled with this package.
To obtain a default settings file as a template for modification, run
the main(java.lang.String[])
method of this class.
headTablePrefix
,
fileEncodingPrefix
,
Language.encoding
,
settingsDirOverride
,
settingsFileOverride
,
Serialized FormNested Class Summary | |
---|---|
static interface |
Settings.Change
An interface by which to notify a class or an instance of a class after one or more settings have changed. |
Field Summary | |
---|---|
static String |
addGapInfo
Property to specify whether Training.addGapInformation(Sexp) threads gap information or simply leaves the training trees untouched. |
static String |
baseNPsCannotContainVerbs
The property to specify whether the containsVerb predicate should have an additional base case where it should simply return false for NPB nodes. |
static String |
chartItemClass
The property to specify the fully-qualified name of the subclass of Item to be used for chart items. |
static String |
clientDeathUponSwitchboardDeath
The property to specify whether parsing clients should commit suicide when they have detected that the Switchboard has died. |
static String |
collinsDeficientEstimation
The property to specify whether to perform deficient estimation of probabilities (as per Mike Collins' bug in his thesis parser). |
static String |
collinsNPPruneHack
The property to specify whether the chart should add 3 in natural log-space to the beam width for chart items whose root labels are either NP or NP-A, as is done by Collins' parser. |
static String |
collinsRelabelHeadChildrenAsArgs
The property to specify whether Training.identifyArguments(Sexp) should relabel head children as arguments. |
static String |
collinsRepairBaseNPs
The property to specify whether Training.repairBaseNPs(Sexp) alters the training tree or leaves it untouched. |
static String |
collinsSkipWSJSentences
The property to specify whether certain sentences are skipped during training on sections 02 through 21 of the Penn Treebank Wall Street Journal corpus in order to mimic Mike Collins' trainer on this now-standard training corpus. |
static String |
constraintSetFactoryClass
The property to specify the fully-qualified classname of the ConstraintSetFactory object to be used by the
ConstraintSets static class. |
static String |
countThreshold
The property to specify the threshold below which TrainerEvent
objects are discarded by the trainer. |
static String |
decoderCellLimit
The property to specify the limit on the number of chart items the decoder will have per cell in its chart. |
static String |
decoderClass
The property to specify the fully-qualified class name of the Decoder instance to be created for use by
Parser and EMParser classes (and any other
subclass of Parser ). |
static String |
decoderDontPostProcess
The property to specify whether the decoder should perform post-processing on a tree after parsing, that is, whether to invoke Training.postProcess(danbikel.lisp.Sexp) on that parse tree. |
static String |
decoderLocalCacheSize
The property to specify the size of the cache used by the CachingDecoderServer instance used by the decoder
when the decoderUseLocalProbabilityCache property
is true . |
static String |
decoderMaxPruneFactor
The property to specify the maximum prune factor when performing beam-widening. |
static String |
decoderOutputHeadLexicalizedLabels
The property to specify whether node labels in trees output by the decoder include their lexical head information, which is normally only used internally by the decoder. |
static String |
decoderOutputInsideProbs
The property to specify whether node labels in trees output by the decoder include the inside probability of their subtree, which is normally only used internally by the decoder. |
static String |
decoderPruneFactor
The property to specify the factor by which the decoder should prune away chart entries. |
static String |
decoderPruneFactorIncrement
The property to specify the increment used when the decoder does beam-widening. |
static String |
decoderRelaxConstraintsAfterBeamWidening
The property to specify whether the decoder should relax all hard constraints (except the comma pruning rule, which is controlled by the decoderUseCommaConstraint setting) after performing all beam
widening. |
static String |
decoderServerClass
The property to specify the fully-qualified class name of the DecoderServerRemote instance to be created for use by
Parser and EMParser classes (and any other
subclass of Parser ). |
static String |
decoderSubstituteWordsForClosedClassTags
The property to specify whether the decoder should substitute a known word when the only tag for an unknown word is closed-class (i.e., the tag was never observed with the unknown word during training). |
static String |
decoderUseCellLimit
The property to specify whether the decoder should impose a limit on the number of chart items per cell in the chart. |
static String |
decoderUseCommaConstraint
The property to specify whether the decoder should employ a constraint on the way commas can appear in and around chart items. |
static String |
decoderUseHeadToParentMap
The property to specify whether the decoder should use the head-to-parent map derived during training. |
static String |
decoderUseLocalProbabilityCache
The property to specify whether the decoder should wrap its DecoderServerRemote instance with an instance of
CachingDecoderServer , which caches probability
lookups. |
static String |
decoderUseOnlySuppliedTags
The property to specify whether the decoder should only use the tags supplied with words in an input file when seeding the chart. |
static String |
decoderUsePruneFactor
The property to specify whether or not the decoding algorithm should prune away chart entries within a particular factor of the top-ranked chart entry in a given cell. |
static String |
defaultModelClass
The property to specify the default Model class to be created
around ProbabilityStructure objects when their
ProbabilityStructure.newModel() method is invoked. |
static String |
derivedCountThreshold
The property to specify the threshold below which Event
objects are discarded by the databases contained with Model
objects. |
static String |
dontAddNewParams
Indicates whether instances of Model , when smoothing parameters
from a previous training run, should not add new parameters when deriving
counts. |
static String |
downcaseWords
The property to specify whether words are downcased during training and decoding. |
static String |
fileEncodingPrefix
The prefix string used to specify a language's file encoding property. |
static String |
gapModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the gap-generation submodel. |
static String |
gapModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
gap-generation submodel. |
static String |
globalModelStructureNumber
The property to specify the model structure number to use when creating ProbabilityStructure objects. |
static String |
headFinderClass
The property to specify the fully-qualified name of the class that extends HeadFinder in a language package. |
static String |
headFinderRandomProb
The property to specify a probability that the method AbstractHeadFinder.defaultFindHead(danbikel.lisp.Symbol,danbikel.lisp.SexpList)
should return a randomly-selected head-child index. |
static String |
headFinderWarnDefaultRule
The property to specify whether the method AbstractHeadFinder.defaultFindHead(danbikel.lisp.Symbol,danbikel.lisp.SexpList)
issues a warning whenever it needs to use the default head-finding rule. |
static String |
headModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the head-generation submodel. |
static String |
headModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
head-generation submodel. |
static String |
headTablePrefix
The prefix string used to specify a language's head table property. |
static String |
kBest
The property to specify the maximum number of top-scoring theories to give as a parse. |
static String |
keepAliveInterval
The property to specify how often clients and servers should ping the "keep-alive" socket connected to the switchboard. |
static String |
keepAliveMaxRetries
The property to specify at most how many times the switchboard attempts to contact clients and servers before considering them dead (after an initial failure, thus making 0 a legal value for this property). |
static String |
keepAllWords
The property to specify whether or not the trainer keeps all words. |
static String |
keepLowFreqTags
The property to specify whether the trainer includes low-frequency words in its part of speech map. |
static String |
language
The property to specify the language to be parsed. |
static String |
languagePackage
The property to specify the language package to be used. |
static String |
leftSubcatModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the left subcat-generation submodel. |
static String |
leftSubcatModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
left-subcat-generation submodel. |
static String |
lexPriorModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the lexical prior submodel. |
static String |
lexPriorModelStructureNumber
The properth to specify the model structure to use when creating the ProbabilityStructure object for the
lexical prior submodel. |
static String |
maxEventChunkSize
The property to specify how many events the trainer should read from an observations file before deriving counts (for use only when using a trainer output file; see Trainer.main(String[]) ). |
static String |
maxParseTime
The property to specify the maximum time, in milliseconds, that the decoder will attempt to deliver a parse on a sentence. |
static String |
maxSentLen
The property to specify the maximum length a sentence can be; sentences greater than this length will not be parsed. |
static String |
modelDoPruning
The property to specify whether to prune redundant parameters from every Model instance. |
static String |
modelPruningThreshold
The property to specify the pruning threshold when pruning is performed (ignored if modelDoPruning is false). |
static String |
modelStructurePackage
The property to specify the package for model structure classes. |
static String |
modNonterminalModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the modifying nonterminal-generation submodel. |
static String |
modNonterminalModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
modifying nonterminal-generation submodel. |
static String |
modWordModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the modifying word-generation submodel. |
static String |
modWordModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
modifying word-generation submodel. |
static String |
nonterminalPriorModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the nonterminal prior submodel. |
static String |
nonterminalPriorModelStructureNumber
The properth to specify the model structure to use when creating the ProbabilityStructure object for the
nonterminal prior submodel. |
static String |
numPrevMods
The property to specify how many previous modifiers the trainer outputs for its top-level count files. |
static String |
numPrevWords
The property to specify how many head words of previous modifiers the trainer outputs for its top-level count files. |
static String |
outputCollins
The property to specify whether the trainer outputs top-level events in the format output by Michael Collins' trainer to System.out when training on a Treebank input file. |
static String |
outputHeadToParentMap
The property to specify whether the trainer should output the head-to-parent nonterminal map that it derives from its top-level observations. |
static String |
outputModNonterminalMap
The property to specify whether the trainer should output the modifying nonterminal map that it derives from its top-level observations. |
static String |
outputSubcatMaps
The property to specify whether the trainer should output the subcat maps that it derives from its top-level observations. |
static String |
precomputeProbs
The property to specify whether or not to pre-compute probabilities when training and use those pre-computed probabilities when decoding. |
static String |
prevModMapperClass
The property to specify the concrete type of the NonterminalMapper
instance used by NTMapper to map nonterminals that are
previously-generated modifiers of some head child nonterminal. |
static String |
progName
The official name of this program. |
static String |
restorePrunedWords
The property to specify that the decoder restores all pruned words. |
static String |
rightSubcatModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the right subcat-generation submodel. |
static String |
rightSubcatModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
right-subcat-generation submodel. |
static String |
saveSmoothingParams
|
static String |
sbSocketTimeout
The property to specify how long, in milliseconds, the SO_TIMEOUT value should be for the switchboard's RMI-client (caller) sockets. |
static String |
sbUserSBMaxRetries
The property to specify at most how many times switchboard users should try to acquire the switchboard from the bootstrap registry before giving up, either when first starting up or in the event of a switchboard crash. |
static String |
sbUserTimeout
The property to specify how long (in milliseconds) sockets stay alive on the client (switchboard) side for RMI calls to switchboard user objects (subclasses of AbstractSwitchboardUser ). |
static String |
serverDeathKillClients
The property to specify whether the switchboard should kill all of a server's clients when it detects that the server has died. |
static String |
serverFailover
The property to specify whether parsing clients should have server failover; that is, whether they should request a new server from the switchboard if their current server fails. |
static String |
serverMaxRetries
The property to specify at most how many times parsing clients should re-try their servers in the event of a method failure before giving up. |
static String |
serverRetrySleep
The property to specify how many milliseconds to sleep between server re-tries. |
static String |
settingsDirOverride
The name of the property to override the location of the default settings directory, to be specified at run-time on the command line. |
static String |
settingsFileOverride
The name of the property to override the name of the default settings file, which is <defaultSettingsDir>/settings, where <defaultSettingsDir> is the default settings directory, as described in the documentation for settingsDirOverride . |
static String |
shifterClass
The property to specify the fully-qualified classname of the Shift object to be used by the Shifter
static class. |
static String |
smoothingParamsDir
The property to specify the directory from which Model objects
are to read smoothing parameters files. |
static String |
subcatFactoryClass
The property to specify the fully-qualified classname of the SubcatFactory object to be used by the Subcats
static factory class. |
static String |
topLexModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the head word-generation submodel for head
words of entire sentences. |
static String |
topLexModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
head word-generation submodel for heads of entire sentences. |
static String |
topNonterminalModelStructureClass
The property to specify the fully-qualified name of a class that extends ProbabilityStructure , to be instantiated by
Trainer for the head-generation submodel for heads whose parents
are Training.topSym() . |
static String |
topNonterminalModelStructureNumber
The property to specify the model structure number to use when creating the ProbabilityStructure object for the
head-generation submodel for heads whose parents are
Training.topSym() . |
static String |
trainerReportingInterval
The property to specify the interval (in number of sentences) at which the trainer emits reports to System.err when training. |
static String |
trainerShareCounts
The property to indicate whether the trainer should share counts among various models' back-off levels. |
static String |
trainingClass
The property to specify the fully-qualified name of the class that extends Training in a language package. |
static String |
treebankClass
The property to specify the fully-qualified name of the class that extends Treebank in a language package. |
static String |
unknownWordThreshold
The property to specify the threshold below which words are considered unknown by the trainer. |
static String |
useLowFreqTags
The property to specify whether to use tags collected from low-frequency words by the trainer when seeding the chart, if the current word is a low-frequency word observed when training. |
static String |
useSimpleModNonterminalMap
The property to specify whether the decoder uses ModelCollection.simpleModNonterminalMap . |
static String |
useSmoothingParams
Indicates whether instances of Model should use smoothing
parameters saved to a file from a previous training run, instead of
deriving smoothing parameters. |
static String |
version
The official version of this program. |
static String |
wordFactoryClass
The property to specify the fully-qualified classname of the WordFactory object to be used by the Words
static factory class. |
static String |
wordFeaturesClass
The property to specify the fully-qualified name of the class that extends WordFeatures in a language package. |
static String |
writeCanonicalEvents
The property to specify whether or not the ModelCollection
class should write out the large hash map containing canonical versions of
Event objects when it is serialized (that is, saved to a
file). |
Method Summary | |
---|---|
static String |
get(String name)
Gets the value of the specified property. |
static boolean |
getBoolean(String setting)
Returns the boolean value of the specified setting, as determined by Boolean.valueOf(String) . |
static boolean |
getBooleanProperty(String property,
boolean defaultValue)
Returns the boolean value of specified property, or the specified default value if the specified property does not exist. |
static InputStream |
getDefaultsResource()
Gets the fallback defaults from resource, thowing exception if resource unavailable (which is a very bad situation). |
static double |
getDouble(String setting)
Returns the double value of the specified setting, as determined by Double.parseDouble(String) . |
static InputStream |
getFileOrResourceAsStream(Class cl,
String name)
Attempts to locate the file or resource with the specified name in one of three places: as a file path relative to the default settings directory, or as a file path relative to the current working directory, or relative to nothing, if name is an absolute path
as a resource gotten from the class loader of the specified class
The default settings directory is described in the documentation
for settingsDirOverride . |
static int |
getInteger(String setting)
Returns the integer value of the specified setting, as determined by Integer.parseInt(String) . |
static int |
getIntProperty(String property,
int defaultValue)
Returns the integer value of specified property, or the specified default value if the specified property does not exist. |
static Properties |
getSettings()
Returns a deep copy of the internal Properties object. |
static void |
load(File file)
Loads the properties from the specified file, using load(InputStream) . |
static void |
load(InputStream is)
Loads the properties from the specified input stream, using Properties.load(InputStream) . |
static void |
load(String filename)
Loads the properties from the file of the specified filename, using load(File) . |
static void |
main(String[] args)
Prints the default settings contained in the resource supplied with this parsing software. |
static void |
register(Class cl,
Settings.Change change,
Set<Class> before)
Registers a class to receive an update when one or more settings have changed. |
static void |
register(Settings.Change change)
Registers a particular object implementing the Settings.Change interface
to receive an update when one or more settings have changed. |
static void |
set(String name,
String value)
Sets the property name to value , using Properties.setProperty(String,String) . |
static void |
setSettings(Properties newSettings)
Allows any class to set the settings of this class directly using the specified Properties object. |
static void |
store(ObjectOutputStream os)
Stores the properties of this class to the specified output stream. |
static void |
store(OutputStream os)
Stores the properties of this class to the specified output stream, using Properties.store(OutputStream,String) . |
static void |
store(OutputStream os,
String header)
Stores the properties of this class to the specified output stream, using Properties.store(OutputStream,String) . |
static void |
storeSorted(OutputStream os)
Stores a sorted list of the settings and values of this class to the specified output stream |
static void |
storeSorted(OutputStream os,
String header)
Stores a sorted list of the property-value pairs contained in this class to the specified output stream using the specified header. |
static void |
storeSorted(Properties props,
OutputStream os)
Stores a sorted list of the specified property-value pairs to the specified output stream |
static void |
storeSorted(Properties props,
OutputStream os,
String header)
Stores a sorted list of the specified container of property-value pairs to the specified output stream using the specified header. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String progName
public static final String version
public static final String settingsFileOverride
settingsDirOverride
.
getFileOrResourceAsStream(Class,String)
.
public static final String settingsDirOverride
"parser.settingsDir"
.
Example UNIX usage:
java -Dparser.settingsDir=/tmp ...
public static final String modelStructurePackage
globalModelStructureNumber
,
Constant Field Valuespublic static final String language
The value of this constant is "parser.language"
.
Language
,
Constant Field Valuespublic static final String languagePackage
The value of this constant is
"parser.language.package"
.
Language
,
Constant Field Valuespublic static final String wordFeaturesClass
WordFeatures
in a language package. If this property
is set, it will override the default, which is
Settings.get(Settings.languagePackage) + ".WordFeatures"The value of this constant is
"parser.language.wordFeatures"
.
Language
,
Constant Field Valuespublic static final String treebankClass
Treebank
in a language package. If this property
is set, it will override the default, which is
Settings.get(Settings.languagePackage) + ".Treebank"The value of this constant is
"parser.language.treebank"
.
Language
,
Constant Field Valuespublic static final String headFinderClass
HeadFinder
in a language package. If this property
is set, it will override the default, which is
Settings.get(Settings.languagePackage) + ".HeadFinder"The value of this constant is
"parser.language.headFinder"
.
Language
,
Constant Field Valuespublic static final String trainingClass
Training
in a language package. If this property
is set, it will override the default, which is
Settings.get(Settings.languagePackage) + ".Training"The value of this constant is
"parser.language.training"
.
Language
,
Constant Field Valuespublic static final String headTablePrefix
Settings.get(Settings.headTablePrefix + "english");The value of this constant is
"parser.headtable."
.
HeadFinder
,
Constant Field Valuespublic static final String subcatFactoryClass
SubcatFactory
object to be used by the Subcats
static factory class.
Subcat
,
Subcats
,
SubcatFactory
,
Constant Field Valuespublic static final String wordFactoryClass
WordFactory
object to be used by the Words
static factory class.
Word
,
Words
,
WordFactory
,
Constant Field Valuespublic static final String shifterClass
Shift
object to be used by the Shifter
static class.
Shift
,
Shifter
,
DefaultShifter
,
Constant Field Valuespublic static final String constraintSetFactoryClass
ConstraintSetFactory
object to be used by the
ConstraintSets
static class.
ConstraintSets
,
ConstraintSet
,
Constraint
,
Constant Field Valuespublic static final String baseNPsCannotContainVerbs
public static final String fileEncodingPrefix
Settings.get(Settings.fileEncodingPrefix + "chinese");The value of this constant is
"parser.file.encoding."
.
Language.encoding
,
Constant Field Valuespublic static final String decoderClass
Decoder
instance to be created for use by
Parser
and EMParser
classes (and any other
subclass of Parser
).
The value of this constant is
"parser.parser.decoderClass"
.
Parser.getNewDecoder(int,DecoderServerRemote)
,
Constant Field Valuespublic static final String decoderServerClass
DecoderServerRemote
instance to be created for use by
Parser
and EMParser
classes (and any other
subclass of Parser
). This property is used when
the Parser/EMParser
class instance is asked to create
and/or use its own, internal server.
The value of this constant is
"parser.parser.decoderServerClass"
.
Parser.getNewDecoderServer(String)
,
Constant Field Valuespublic static final String defaultModelClass
Model
class to be created
around ProbabilityStructure
objects when their
ProbabilityStructure.newModel()
method is invoked.
The value of this constant is
"parser.probabilityStructure.defaultModelClass"
.
ProbabilityStructure.newModel()
,
Constant Field Valuespublic static final String precomputeProbs
The value of this constant is
"parser.model.precomputeProbabilities"
.
public static final String collinsDeficientEstimation
λ1⋅e1 + (1 − λ1) ⋅ (λ2⋅e2 + (1 − λ2) ⋅ λ3⋅e3)where λi is the smoothing weight for backoff level i and ei is an estimate for backoff level i. If this property is false, then the formula is estimated in the correct fashion:
λ1⋅e1 + (1 − λ1) ⋅ (λ2⋅e2 + (1 − λ2) ⋅ e3)
The value of this constant is
"parser.model.collinsDeficientEstimation"
.
public static final String saveSmoothingParams
public static final String dontAddNewParams
Model
, when smoothing parameters
from a previous training run, should not add new parameters when deriving
counts.
public static final String useSmoothingParams
Model
should use smoothing
parameters saved to a file from a previous training run, instead of
deriving smoothing parameters.
public static final String smoothingParamsDir
Model
objects
are to read smoothing parameters files.
public static final String modelDoPruning
Model
instance.
public static final String modelPruningThreshold
modelDoPruning
is false). The value of this
property should be (the string representation of) a double.
modelDoPruning
,
Constant Field Valuespublic static final String prevModMapperClass
NonterminalMapper
instance used by NTMapper
to map nonterminals that are
previously-generated modifiers of some head child nonterminal.
public static final String writeCanonicalEvents
ModelCollection
class should write out the large hash map containing canonical versions of
Event
objects when it is serialized (that is, saved to a
file). When decoding using caches instead of precomputed probabilities
(see precomputeProbs
), the use of the canonical events table
saves time by allowing the decoder to put canonical events observed
during training into the caches, instead of always having to create a
canonical events table anew during decoding. Accordingly, when
precomputeProbs
is set to false, the value of this
property should usually be true, except when debugging. When
precomputeProbs
is false and the value
of this property is also false, then the
ModelCollection
object used during training will simply write
out an empty canonical events table, to be read in when the
ModelCollection
object is de-serialized just prior to
decoding, meaning that as events are cached, they will need to be copied
on the fly to the canonical events table. Finally, when
precomputeProbs
is true, this property is ignored.
The value of this property should be (the string representation of) a
boolean (conversion is performed by the method
Boolean.valueOf
).
The value of this constants is
"parser.modelCollection.writeCanonicalEvents"
.
precomputeProbs
,
ModelCollection
,
Constant Field Valuespublic static final String headFinderWarnDefaultRule
AbstractHeadFinder.defaultFindHead(danbikel.lisp.Symbol,danbikel.lisp.SexpList)
issues a warning whenever it needs to use the default head-finding rule.
The value of this property should be (the string representation of) a
boolean (conversion is performed by the method
Boolean.valueOf
).
The value of this constant is
"parser.headfinder.warnDefaultRule"
.
public static final String headFinderRandomProb
AbstractHeadFinder.defaultFindHead(danbikel.lisp.Symbol,danbikel.lisp.SexpList)
should return a randomly-selected head-child index. The value of
this property should be (the string representation of) a double
(conversion is performed by the method Double.parseDouble
).
Training.addBaseNPs(danbikel.lisp.Sexp)
will always produce consistent results. The issue is that adding base
NPs normally relies on head finding (see AbstractTraining.needToAddNormalNPLevel(danbikel.lisp.Sexp,int,danbikel.lisp.Sexp)
).
The value of this constant is
"parser.headfinder.randomProb"
.
AbstractTraining.needToAddNormalNPLevel(danbikel.lisp.Sexp,int,danbikel.lisp.Sexp)
,
Constant Field Valuespublic static final String addGapInfo
Boolean.valueOf
).
The value of this constant is
"parser.training.addGapInfo"
.
Training.addGapInformation(danbikel.lisp.Sexp)
,
Constant Field Valuespublic static final String collinsRelabelHeadChildrenAsArgs
Training.identifyArguments(danbikel.lisp.Sexp)
,
Constant Field Valuespublic static final String collinsRepairBaseNPs
Boolean.valueOf
).
The value of this constant is
"parser.training.collinsRepairBaseNPs"
.
Training.repairBaseNPs(danbikel.lisp.Sexp)
,
Constant Field Valuespublic static final String trainerShareCounts
public static final String unknownWordThreshold
The value of this constant is
"parser.trainer.unknownWordThreshold"
.
Trainer
,
Constant Field Valuespublic static final String countThreshold
TrainerEvent
objects are discarded by the trainer. The value of this property
must be (the string representation of) a floating-point number.
The value of this constant is
"parser.trainer.countThreshold"
.
Trainer
,
Constant Field Valuespublic static final String derivedCountThreshold
Event
objects are discarded by the databases contained with Model
objects. The value of this property must be (the string representation
of) a floating-point number.
The value of this constant is
"parser.trainer.derivedCountThreshold"
.
Trainer
,
Constant Field Valuespublic static final String trainerReportingInterval
System.err
when training.
The value of this property must be (the string representation of)
an integer.
The value of this constant is
"parser.trainer.reportingInterval"
.
Trainer
,
Constant Field Valuespublic static final String keepAllWords
Boolean.valueOf
).
The value of this constant is
"parser.trainer.keepAllWords"
.
unknownWordThreshold
,
Trainer
,
Constant Field Valuespublic static final String keepLowFreqTags
The value of this constant is
"parser.trainer.keepLowFreqTags"
.
useLowFreqTags
,
Trainer
,
Constant Field Valuespublic static final String numPrevMods
The value of this constant is
"parser.trainer.numPrevMods"
.
Trainer
,
Constant Field Valuespublic static final String numPrevWords
The value of this constant is
"parser.trainer.numPrevWords"
.
Trainer
,
Constant Field Valuespublic static final String globalModelStructureNumber
ProbabilityStructure
objects. The model
structure number will be appended to the end of the canonical
names of model structure class name prefixes. For example, the
canonical class name prefix for the head generation model
structure is HeadModelStructure
, so if this property
has a value of "1", then the head model structure
instantiated by Trainer.deriveCounts()
will be the class
HeadModelStructure1
. The model structure numbers
for specific model structure classes can be overridden by
specifying one of the following, model structure-specific properties:
topNonterminalModelStructureNumber
topLexModelStructureNumber
headModelStructureNumber
gapModelStructureNumber
leftSubcatModelStructureNumber
rightSubcatModelStructureNumber
modNonterminalModelStructureNumber
modWordModelStructureNumber
lexPriorModelStructureNumber
nonterminalPriorModelStructureNumber
topNonterminalModelStructureClass
topLexModelStructureClass
headModelStructureClass
gapModelStructureClass
leftSubcatModelStructureClass
rightSubcatModelStructureClass
modNonterminalModelStructureClass
modWordModelStructureClass
lexPriorModelStructureClass
nonterminalPriorModelStructureClass
The value of this constant is
"parser.trainer.globalModelStructureNumber"
.
public static final String lexPriorModelStructureNumber
ProbabilityStructure
object for the
lexical prior submodel. This number will be appended to the
canonical lexical prior model structure classname prefix,
"danbikel.parser.LexPriorModelStructure"
, to form a
classname, such as
"danbikel.parser.LexPriorModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.lexPriorModelStructureNumber"
.
globalModelStructureNumber
,
lexPriorModelStructureClass
,
Constant Field Valuespublic static final String nonterminalPriorModelStructureNumber
ProbabilityStructure
object for the
nonterminal prior submodel. This number will be appended to the
canonical nonterminal prior model structure classname prefix,
"danbikel.parser.LexPriorModelStructure"
, to form a
classname, such as
"danbikel.parser.NonterminalPriorModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.nonterminalPriorModelStructureNumber"
.
globalModelStructureNumber
,
nonterminalPriorModelStructureClass
,
Constant Field Valuespublic static final String topNonterminalModelStructureNumber
ProbabilityStructure
object for the
head-generation submodel for heads whose parents are
Training.topSym()
. This number will be appended to the
canonical top nonterminal model structure classname prefix,
"danbikel.parser.TopNonterminalModelStructure"
, to form a
classname, such as
"danbikel.parser.TopNonterminalModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.topNonterminalModelStructureNumber"
.
globalModelStructureNumber
,
topNonterminalModelStructureClass
,
Constant Field Valuespublic static final String topLexModelStructureNumber
ProbabilityStructure
object for the
head word-generation submodel for heads of entire sentences. This
number will be appended to the canonical top lexical model
structure classname prefix,
"danbikel.parser.TopLexModelStructure"
, to form a
classname, such as
"danbikel.parser.TopLexModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.topLexModelStructureNumber"
.
globalModelStructureNumber
,
topLexModelStructureClass
,
Constant Field Valuespublic static final String headModelStructureNumber
ProbabilityStructure
object for the
head-generation submodel. This number will be appended to the
canonical head model structure classname prefix,
"danbikel.parser.HeadModelStructure"
, to form a
classname, such as
"danbikel.parser.HeadModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.headModelStructureNumber"
.
globalModelStructureNumber
,
headModelStructureClass
,
Constant Field Valuespublic static final String gapModelStructureNumber
ProbabilityStructure
object for the
gap-generation submodel. This number will be appended to the
canonical gap model structure classname prefix,
"danbikel.parser.GapModelStructure"
, to form a
classname, such as
"danbikel.parser.GapModelStructure1"
. This constant
overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.gapModelStructureNumber"
.
globalModelStructureNumber
,
gapModelStructureClass
,
Constant Field Valuespublic static final String leftSubcatModelStructureNumber
ProbabilityStructure
object for the
left-subcat-generation submodel. This number will be appended to
the canonical left-subcat model structure classname prefix,
"danbikel.parser.LeftSubcatModelStructure"
, to form
a classname, such as
"danbikel.parser.LeftSubcatModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.leftSubcatModelStructureNumber"
.
globalModelStructureNumber
,
leftSubcatModelStructureClass
,
Constant Field Valuespublic static final String rightSubcatModelStructureNumber
ProbabilityStructure
object for the
right-subcat-generation submodel. This number will be appended
to the canonical right-subcat model structure classname prefix,
"danbikel.parser.RightSubcatModelStructure"
, to form
a classname, such as
"danbikel.parser.RightSubcatModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.rightSubcatModelStructureNumber"
.
globalModelStructureNumber
,
rightSubcatModelStructureClass
,
Constant Field Valuespublic static final String modNonterminalModelStructureNumber
ProbabilityStructure
object for the
modifying nonterminal-generation submodel. This number will be
appended to the canonical modifying nonterminal model structure
classname prefix,
"danbikel.parser.ModNonterminalModelStructure"
, to
form a classname, such as
"danbikel.parser.ModNonterminalModelStructure1"
.
This constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.modNonterminalModelStructureNumber"
.
globalModelStructureNumber
,
modNonterminalModelStructureClass
,
Constant Field Valuespublic static final String modWordModelStructureNumber
ProbabilityStructure
object for the
modifying word-generation submodel. This number will be appended
to the canonical modifying word model structure classname prefix,
"danbikel.parser.ModWordModelStructure"
, to form a
classname, such as
"danbikel.parser.ModWordModelStructure1"
. This
constant overrides the setting of the
globalModelStructureNumber
property.
The value of this constant is
"parser.trainer.modWordModelStructureNumber"
.
globalModelStructureNumber
,
modWordModelStructureClass
,
Constant Field Valuespublic static final String lexPriorModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the lexical prior submodel. Specifying this
property overrides the globalModelStructureNumber
and lexPriorModelStructureNumber
properties.
The value of this constant is
"parser.trainer.lexPriorModelStructureClass"
.
public static final String nonterminalPriorModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the nonterminal prior submodel. Specifying this
property overrides the globalModelStructureNumber
and nonterminalPriorModelStructureNumber
properties.
The value of this constant is
"parser.trainer.nonterminalPriorModelStructureClass"
.
public static final String topNonterminalModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the head-generation submodel for heads whose parents
are Training.topSym()
. Specifying this
property overrides the globalModelStructureNumber
and
topNonterminalModelStructureNumber
properties.
The value of this constant is
"parser.trainer.topNonterminalModelStructureClass"
.
public static final String topLexModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the head word-generation submodel for head
words of entire sentences. Specifying this
property overrides the globalModelStructureNumber
and
topLexModelStructureNumber
properties.
The value of this constant is
"parser.trainer.topLexModelStructureClass"
.
public static final String headModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the head-generation submodel. Specifying this
property overrides the globalModelStructureNumber
and
headModelStructureNumber
properties.
The value of this constant is
"parser.trainer.headModelStructureClass"
.
public static final String gapModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the gap-generation submodel. Specifying this
property overrides the globalModelStructureNumber
and
gapModelStructureNumber
properties.
The value of this constant is
"parser.trainer.gapModelStructureClass"
.
public static final String leftSubcatModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the left subcat-generation submodel. Specifying this
property overrides the globalModelStructureNumber
and
leftSubcatModelStructureNumber
properties.
The value of this constant is
"parser.trainer.leftSubcatModelStructureClass"
.
public static final String rightSubcatModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the right subcat-generation submodel. Specifying this
property overrides the globalModelStructureNumber
and
rightSubcatModelStructureNumber
properties.
The value of this constant is
"parser.trainer.rightSubcatModelStructureClass"
.
public static final String modNonterminalModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the modifying nonterminal-generation submodel.
Specifying this property overrides the globalModelStructureNumber
and modNonterminalModelStructureNumber
properties.
The value of this constant is
"parser.trainer.modNonterminalModelStructureClass"
.
public static final String modWordModelStructureClass
ProbabilityStructure
, to be instantiated by
Trainer
for the modifying word-generation submodel.
Specifying this property overrides the globalModelStructureNumber
and modWordModelStructureNumber
properties.
The value of this constant is
"parser.trainer.modWordModelStructureClass"
.
public static final String collinsSkipWSJSentences
The value of this constants is
"parser.trainer.collinsSkipWSJSentences"
.
public static final String maxEventChunkSize
Trainer.main(String[])
).
The value of this property should be (the string representation of)
an integer.
The value of this constant is
"parser.trainer.maxEventChunkSize"
.
public static final String outputHeadToParentMap
The value of this constant is
"parser.trainer.outputHeadToParentMap"
.
public static final String outputSubcatMaps
The value of this constant is
"parser.trainer.outputSubcatMaps"
.
public static final String outputModNonterminalMap
The value of this constant is
"parser.trainer.outputModNonterminalMap"
.
public static final String outputCollins
System.out
when training on a Treebank input file. Note
that in order to (near) perfectly emulate Collins' trainer, the property
unknownWordThreshold
should be set to 1.
The value of this constant is
"parser.trainer.outputCollins"
.
public static final String chartItemClass
Item
to be used for chart items.
The value of this constant is
"parser.chart.itemClass"
.
public static final String collinsNPPruneHack
The value of this constant is
"parser.chart.collinsNPPruneHack"
.
public static final String kBest
The value of this constant is
"parser.decoder.kBest"
.
Decoder.parse(danbikel.lisp.SexpList)
,
Constant Field Valuespublic static final String maxSentLen
The value of this constant is
"parser.decoder.maxSentenceLength"
.
Decoder
,
Constant Field Valuespublic static final String maxParseTime
The value of this constant is
"parser.decoder.maxParseTime"
.
Decoder
,
Constant Field Valuespublic static final String useLowFreqTags
true
, and if keepLowFreqTags
was true
during training, causes the decoder to attempt to find tags
observed with this word in training, even if it was a
low-frequency word. If false
, the decoder will
simply choose the first-best tag supplied by the input sentence,
or, if the input does not contain pre-tagged words, will use all
tags observed with the word's feature vector.
The value of this constant is
"parser.decoder.useLowFreqTags"
.
keepLowFreqTags
,
Decoder
,
Constant Field Valuespublic static final String decoderUsePruneFactor
Boolean.valueOf
).
The value of this constant is
"parser.decoder.usePruneFactor"
.
Decoder
,
Constant Field Valuespublic static final String decoderPruneFactor
Math.pow(value, 10.0)
, where value
is the value
of this property). This form of pruning will only occur if the value of
decoderUsePruneFactor
is true
.
The value of this constant is
"parser.decoder.pruneFactor"
.
Decoder
,
Constant Field Valuespublic static final String decoderMaxPruneFactor
decoderPruneFactor
. If this property is not set
(the value is the null object), then the maximum prune factor
defaults to the value of decoderPruneFactor
, and the decoder
will not do beam-widening. The value of this property should be a floating
point number that is the logarithm (base 10) of the desired factor
(i.e., the factor employed will effectively be
Math.pow(value, 10.0)
, where value
is the value
of this property).
decoderPruneFactor
,
decoderPruneFactorIncrement
,
Constant Field Valuespublic static final String decoderPruneFactorIncrement
Math.pow(value, 10.0)
, where value
is the value
of this property).
decoderMaxPruneFactor
,
Constant Field Valuespublic static final String decoderRelaxConstraintsAfterBeamWidening
decoderUseCommaConstraint
setting) after performing all beam
widening. Setting this property to true provides a means to
making the parser more robust, as it should allow the decoder to
always find at least some parse for any sentence.
For the purposes of this setting, a hard constraint is any implicit
or explicit zero probability estimate that would cause the decoder to
abandon an hypothesis (derivation). Note that setting this property to
true has no effect on the constraint-satisfaction system provided
by constraintSetFactoryClass
.
public static final String decoderUseCellLimit
Boolean.valueOf
).
The value of this constant is
"parser.decoder.useCellLimit"
.
Decoder
,
Constant Field Valuespublic static final String decoderCellLimit
decoderUseCellLimit
is true
.
The value of this property should be (the string representation of) an
integer.
The value of this constant is
"parser.decoder.cellLimit"
.
Decoder
,
Constant Field Valuespublic static final String decoderUseCommaConstraint
Z --> <.. X Y..>two of its children X and Y are separated by a comma, then the last word in Y must be directly followed by a comma or must be the last word in the sentence.
public static final String decoderUseOnlySuppliedTags
The value of this property should be (the string representation of)
a boolean (conversion is performed by the method
Boolean.valueOf
).
The value of this constant is
"parser.decoder.useOnlySuppliedTags"
.
public static final String decoderSubstituteWordsForClosedClassTags
The value of this property should be (the string representation of)
a boolean (conversion is performed by the method
Boolean.valueOf
).
The value of this constant is
"parser.decoder.substituteWordsForClosedClassTags"
.
public static final String decoderOutputHeadLexicalizedLabels
CKYItem.toSexp()
.
The form of a lexicalized label will be
NT[isHead/word/tag/startIdx/endIdx/headWordIdx]where
Treebank.nonTreebankLeftBracket()
,
Treebank.nonTreebankRightBracket()
and
Treebank.nonTreebankDelimiter()
methods, respectively.
If decoderOutputInsideProbs
is also true
, then
the form of a lexicalized label will be
NT[isHead/word/tag/prob]where prob is a floating-point value equal to the inside tree probability of the subtree rooted at the node. The words that were pruned before parsing and re-inserted after parsing (when the
restorePrunedWords
setting is true) will
not be output with lexical information, since the parser never
stochastically assigned head words to these nodes (but one could trivially
map these preterminals to their lexicalized versions).
CKYItem.toSexp()
,
Constant Field Valuespublic static final String decoderOutputInsideProbs
CKYItem.toSexp()
.
The form of a lexicalized label will be
NT[prob]where
double
value, indicating the inside
probability of the subtree
Treebank.nonTreebankLeftBracket()
and
Treebank.nonTreebankRightBracket()
methods, respectively.
This setting also “plays nice” with (i.e., can be
simultaneously true with) the decoderOutputHeadLexicalizedLabels
setting.
This setting requires that post-processing not be performed, so
when this setting is true, it will effectively be as though the user
also specified false for the value of the
decoderDontPostProcess
setting.
CKYItem.toSexp()
,
decoderOutputHeadLexicalizedLabels
,
decoderDontPostProcess
,
Constant Field Valuespublic static final String decoderDontPostProcess
Training.postProcess(danbikel.lisp.Sexp)
on that parse tree.
Note that this setting will effectively be true if
decoderOutputInsideProbs
is true; that is, the actual
value of this setting will be ignored if decoderOutputInsideProbs
is true, and will be treated as though the user specified
true for this setting, as well.
decoderOutputInsideProbs
,
Constant Field Valuespublic static final String decoderUseLocalProbabilityCache
DecoderServerRemote
instance with an instance of
CachingDecoderServer
, which caches probability
lookups. The value of this property should be (the string representation
of) a boolean (conversion is performed by the method
Boolean.valueOf
).
DecoderServerRemote
,
CachingDecoderServer
,
Constant Field Valuespublic static final String decoderLocalCacheSize
CachingDecoderServer
instance used by the decoder
when the decoderUseLocalProbabilityCache
property
is true
. The value of this property is ignored when
decoderUseLocalProbabilityCache
is false
.
The value of this property should be (the string representation of)
an integer.
public static final String decoderUseHeadToParentMap
public static final String restorePrunedWords
true
and the decoder produces a parse for
a sentence, then it is guaranteed that the number of tokens of the input
sentence will be equal to the number of terminals of the parsed output
sentence. The value of this property should be the (string representation
of) a boolean (conversion is performed by the method
Boolean.valueOf
).
Training.prune(danbikel.lisp.Sexp)
,
Constant Field Valuespublic static final String useSimpleModNonterminalMap
ModelCollection.simpleModNonterminalMap
. This is the simpler of two
mechanisms by which the decoder determines whether even to attempt to
compute the probability of a modifying nonterminal in the context of some
parent and head child and other syntactic context (this computation can be
expensive, hence the decoder has two, less-expensive mechanisms to try to
avoid such computation where possible). The simple modifying nonterminal
map maps parent/head/side triples to possible modifying nonterminals that
occurred in training. For example, if an NP occurred to the left
of a VP whose parent was S in training, then the simple
modifying nonterminal map would contain the mapping S,VP,left -->
NP. Note that before such mappings are created, any argument
augmentations on the parent and any gap augmentation on the head are
removed. Note also that if the last level of back-off of the
modifying-nonterminal generation model structure uses an even more reduced
context than such a triple, then the simple modifying nonterminal map
should not be used and this setting should be false.
(Using the simple modifying nonterminal map is appropriate,
however, with ModNonterminalModelStructure2
,
as well as several other modifying nonterminal model structures in
the danbikel.parser.ms package.)
public static final String downcaseWords
Boolean.valueOf
).
The value of this constant is "parser.downcaseWords"
.
public static final String sbSocketTimeout
SwitchboardRemote.socketTimeout
,
Constant Field Valuespublic static final String keepAliveInterval
SwitchboardRemote.keepAliveInterval
,
Constant Field Valuespublic static final String keepAliveMaxRetries
SwitchboardRemote.keepAliveMaxRetries
,
Constant Field Valuespublic static final String serverDeathKillClients
Boolean.valueOf
).
SwitchboardRemote.serverDeathKillClients
,
Constant Field Valuespublic static final String sbUserTimeout
AbstractSwitchboardUser
).
The value of this constant is
"parser.switchboardUser.timeout"
.
public static final String sbUserSBMaxRetries
AbstractSwitchboardUser.infiniteTries
, the
parsing clients and decoder servers will indefinitely keep trying to
re-acquire the switchboard in the event of its failure.
The value of this constant is
"parser.switchboardUser.sbMaxRetries"
.
public static final String serverFailover
The value of this constant is
"parser.switchboardUser.client.serverFailover"
.
Failover
,
Constant Field Valuespublic static final String serverMaxRetries
Retry.retryIndefinitely
, clients will
keep re-trying indefinitely.
The value of this constant is
"parser.switchboardUser.client.serverMaxRetries"
.
AbstractSwitchboardUser.SBUserRetry
,
Retry
,
Constant Field Valuespublic static final String serverRetrySleep
The value of this constant is
"parser.switchboardUser.client.serverRetrySleep"
.
serverMaxRetries
,
Constant Field Valuespublic static final String clientDeathUponSwitchboardDeath
false
, then parsing clients will be
tolerant to Switchboard death, meaning they will continue to attempt
to re-register with a Switchboard at the same RMI location as the
Switchboard that died.
Method Detail |
---|
public static void register(Class cl, Settings.Change change, Set<Class> before)
cl
- the class registering to receive notifications of changeschange
- the change request for the specified classbefore
- the set of classes that must be updated before this class, or
null
or Collections.<Class>emptySet()
if no such set existspublic static void register(Settings.Change change)
Settings.Change
interface
to receive an update when one or more settings have changed. Typically,
only large, long-lived objects should register for notifications.
change
- the change request for the specified objectpublic static double getDouble(String setting)
Double.parseDouble(String)
.
setting
- the setting whose value is to be gotten
public static int getInteger(String setting)
Integer.parseInt(String)
.
setting
- the setting whose value is to be gotten
public static boolean getBoolean(String setting)
Boolean.valueOf(String)
.
setting
- the setting whose value is to be gotten
public static void load(String filename) throws IOException
load(File)
.
filename
- the name of the file containing properties to load
IOException
- if load(File)
throws an IOExceptionpublic static void load(File file) throws IOException
load(InputStream)
.
file
- the file containing properties to load
IOException
- if creating a FileInputStream throws
an IOException or if the call to load(InputStream)
throws an IOExceptionpublic static void load(InputStream is) throws IOException
Properties.load(InputStream)
.
is
- the input stream containing properties to load
IOException
- if there is a problem reading from the specified streampublic static void store(OutputStream os) throws IOException
Properties.store(OutputStream,String)
.
os
- the output stream to which to write the properties contained in
this class
IOException
- if there is a problem writing to the specified streampublic static void store(OutputStream os, String header) throws IOException
Properties.store(OutputStream,String)
.
os
- the output stream to which to write the properties contained in
this classheader
- the header text to put at the beginning of the
properties file
IOException
- if there is an exception writing to the specified
streampublic static void store(ObjectOutputStream os) throws IOException
os
- the output stream to which to write the properties contained
in this class
IOException
- if there is an exception writing to the specified
streampublic static void storeSorted(OutputStream os) throws IOException
os
- the output stream to which to write a sorted list of the
settings and values contained in this class
IOException
- if there is a problem writing to the specified
output streampublic static void storeSorted(Properties props, OutputStream os) throws IOException
props
- a container of property-value pairsos
- an output stream to which to write a sorted list of the
property-value pairs contained in the specified Properties
object
IOException
- if there is a problem writing to the
specified output streampublic static void storeSorted(OutputStream os, String header) throws IOException
os
- the output stream to which to store a sorted list of the
property-value pairs contained in this classheader
- the header to write to the specified output stream
before writing the sorted list of property-value pairs
IOException
- if there is a problem writing to the specified
output streampublic static void storeSorted(Properties props, OutputStream os, String header) throws IOException
props
- a container of property-value pairsos
- the output stream to which to store a sorted list of the
specified property-value pairsheader
- the header to write to the specified output stream
before writing the sorted list of property-value pairs
IOException
- if there is a problem writing to the specified
output streampublic static void set(String name, String value)
name
to value
, using Properties.setProperty(String,String)
. As a side effect, all classes that
have registered to receive settings changes will be notified of this
change, via invocations of Settings.Change.update(Map)
on the
Settings.Change
instances that were passed either to the register(Class,Settings.Change,Set)
method or to the register(Settings.Change)
method.
name
- the name of the property to setvalue
- the value to which to set the property name
public static String get(String name)
name
- the name of the property to get
public static Properties getSettings()
Properties
object.
Properties
objectpublic static void setSettings(Properties newSettings)
Properties
object.
newSettings
- the new settings to be contained by this classpublic static final InputStream getFileOrResourceAsStream(Class cl, String name) throws FileNotFoundException
name
is an absolute path
settingsDirOverride
.
cl
- the class that needs the file or resourcename
- the name of the file or resource
InputStream
of the specified file or resource,
or null
if the file or resource could not be found
FileNotFoundException
- if the settings file cannot be foundpublic static final InputStream getDefaultsResource() throws FileNotFoundException
FileNotFoundException
- if the defaults resource stream cannot be
foundpublic static int getIntProperty(String property, int defaultValue)
property
- the property or setting whose value is to be retrieveddefaultValue
- the fallback default value for the specified property
public static boolean getBooleanProperty(String property, boolean defaultValue)
property
- the property or setting whose value is to be retrieveddefaultValue
- the fallback default value for the specified property
public static void main(String[] args)
args
- ignored
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |