Package nltk_lite :: Package contrib :: Package toolbox :: Module settings :: Class FieldMetadata
[hide private]
[frames] | no frames]

Class FieldMetadata

source code

This class is a container for information about a field, including its marker, name, description, language, range set (valid values), and parent marker.

The raw field metadata looks like this:

 \+mkr dx
 \nam Dialect
 \desc dialects in which lexeme is found
 \lng Default
 \rngset Aita Atsilima Central Pipipaia
 \mkrOverThis lx
 \-mkr
Instance Methods [hide private]
 
__init__(self, marker=None, name=None, desc=None, lang=None, rangeset=None, multiword=None, required=None, parent_mkr=None) source code
string
get_marker(self)
Obtain the marker for this field (e.g., 'dx').
source code
string
get_name(self)
Obtain the name for this field (e.g., 'Dialect').
source code
string
get_description(self)
Obtain the marker for this field (e.g., 'dialects in which lexeme is found').
source code
string
get_language(self)
Obtain language in which field is encoded (e.g., 'Default').
source code
list of strings
get_rangeset(self)
Obtain range set for field (e.g., ['Aita', 'Atsilima', 'Central', 'Pipipaia']).
source code
 
set_rangeset(self, rangeset)
Set list of valid values for field.
source code
string
get_parent_marker(self)
Obtain the marker for the parent of this field (e.g., 'lx').
source code
boolean
is_multiword(self)
Determine whether the value of the field consists of multiple words.
source code
boolean
requires_value(self)
Determine whether the field requires a value.
source code
Method Details [hide private]

get_marker(self)

source code 

Obtain the marker for this field (e.g., 'dx').

Returns: string
marker for field

get_name(self)

source code 

Obtain the name for this field (e.g., 'Dialect').

Returns: string
name of field

get_description(self)

source code 

Obtain the marker for this field (e.g., 'dialects in which lexeme is found').

Returns: string
description of field

get_language(self)

source code 

Obtain language in which field is encoded (e.g., 'Default').

Returns: string
name of language used for field

get_rangeset(self)

source code 

Obtain range set for field (e.g., ['Aita', 'Atsilima', 'Central', 'Pipipaia']).

Returns: list of strings
list of possible values for field

set_rangeset(self, rangeset)

source code 

Set list of valid values for field.

Parameters:
  • rangeset (list) - list of valid values for the field

get_parent_marker(self)

source code 

Obtain the marker for the parent of this field (e.g., 'lx').

Returns: string
marker for parent field

is_multiword(self)

source code 

Determine whether the value of the field consists of multiple words.

Returns: boolean
whether field values can be multiword

requires_value(self)

source code 

Determine whether the field requires a value.

Returns: boolean
whether field requires a value