![]() |
Baby Language Lab Scripts
A collection of data processing tools.
|
This class provides information about/validation for a particular code. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | get_option |
Retreives a CodeInfo object for a specified option. More... | |
def | get_all_options_codes |
Retreives a list of all possible options for this code. More... | |
def | get_tests |
This function returns a list of functions that are called, one by one, upon validation. More... | |
def | is_valid |
Validates an option string for this Code object. More... | |
Public Attributes | |
options_dict | |
This class provides information about/validation for a particular code.
This could be a transcriber code, a LENA speaker code, a LENA notes code, or other potential types of codes. A code can have any number of options. Each option is a specific string value that the code can take on (eg. a LENA speaker code has options like 'MAN', 'FAN', etc.). This class also provides the ability fo valide code options that have been read from a TRS file.
def data_structs.codes.Code.__init__ | ( | self, | |
options_dict | |||
) |
def data_structs.codes.Code.get_all_options_codes | ( | self | ) |
def data_structs.codes.Code.get_option | ( | self, | |
code_str | |||
) |
Retreives a CodeInfo object for a specified option.
self | |
code_str | (string) a string representing the option to lookup (eg. 'MAN' or 'FAN' for a LENA speaker code, 'M' or 'F' for transcriber code 1, etc.) |
def data_structs.codes.Code.get_tests | ( | self | ) |
This function returns a list of functions that are called, one by one, upon validation.
Each function should accept a single argument, a string containing the option text. They should return an array containing any error messages to present to the UI (or empty list if none).
self |
def data_structs.codes.Code.is_valid | ( | self, | |
cd_str | |||
) |
Validates an option string for this Code object.
To do so, it retreives a list of test functions from get_tests() and executes them one by one. The resulting lists are concatenated and the final list is returned.
self | |
cd_str | (string) string for the code option being validated. |