SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions
spr_eval.EvalConfig Class Reference

Handles processing and storing of configuration data. More...

+ Inheritance diagram for spr_eval.EvalConfig:
+ Collaboration diagram for spr_eval.EvalConfig:

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...
 

Detailed Description

Handles processing and storing of configuration data.

Constructor & Destructor Documentation

def spr_eval.EvalConfig.__init__ (   self,
  cfname,
  use_sections 
)

Constructor.

Reads and processes the config file.

Returns
Fully initialized config object, ready for use.
Parameters
selfThe config object
cfnameThe name of the config file
use_sectionsThe AM, LM, LEX, SEARCH, SSP, ... sections to be used (instead of the default ones)

Member Function Documentation

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.

Returns
The value of the requested value or the default if not found.
Parameters
selfThe config object
sectionThe name of the section (case-insensitive)
keyThe name of the parameter (case-insensitive)
defaultAn optional default return value if no parameter was found
alt_sectionsAn optional secondary section where to look for the parameter
typeAn 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.

Returns
True if available.
Parameters
selfThe config object
sectionThe name of the section (case-insensitive)
keyThe name of the parameter (case-insensitive)