SPRAAK
|
Handles processing and storing of configuration data. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | get |
Get a parameter from a section of the configuration. More... | |
def | has_key |
Check if a parameter is present in a specific section. More... | |
Handles processing and storing of configuration data.
def spr_eval.EvalConfig.__init__ | ( | self, | |
cfname, | |||
use_sections | |||
) |
Constructor.
Reads and processes the config file.
self | The config object |
cfname | The name of the config file |
use_sections | The AM, LM, LEX, SEARCH, SSP, ... sections to be used (instead of the default ones) |
def spr_eval.EvalConfig.get | ( | self, | |
section, | |||
key, | |||
default = None , |
|||
alt_sections = None , |
|||
type = None |
|||
) |
Get a parameter from a section of the configuration.
If the parameter is not found and no default return valuye is given, a warning will be written to stderr.
self | The config object |
section | The name of the section (case-insensitive) |
key | The name of the parameter (case-insensitive) |
default | An optional default return value if no parameter was found |
alt_sections | An optional secondary section where to look for the parameter |
type | An optional type to which the value should be converted |
def spr_eval.EvalConfig.has_key | ( | self, | |
section, | |||
key | |||
) |
Check if a parameter is present in a specific section.
True
if available.self | The config object |
section | The name of the section (case-insensitive) |
key | The name of the parameter (case-insensitive) |