|
Baby Language Lab Scripts
A collection of data processing tools.
|
This class holds information about a particular code option. More...

Public Member Functions | |
| def | __init__ |
| Constructor. More... | |
| def | has_property |
| Checks if this option has a given property from DBConstants.SPEAKER_PROPS. More... | |
| def | is_linkable |
| Checks if this option is linkable. More... | |
| def | is_distance |
| Checks if this option has a particular distance property (eg. More... | |
| def | is_speaker_type |
| Checks if this option has a given speaker type (where speaker types are defined as for transcriber code 1 in the transcriber manual). More... | |
| def | get_code_desc |
| Returns the description for this option. More... | |
| def | get_code |
| Returns the code string for this option. More... | |
Public Member Functions inherited from data_structs.base_objects.BLLObject | |
| def | __str__ |
| Builds a nicely formatted string containing all attributes of this object (except those in omit_attr_names), for debugging purposes. More... | |
Public Attributes | |
| db_id | |
| desc | |
| code | |
| is_linkable | |
| distance | |
| speaker_type | |
| props_dict | |
This class holds information about a particular code option.
A 'code option' is a particular value that a code can have. For example, transcriber code 1 may be set to one of the following options: ('M', 'F', 'T', 'O', 'C', 'U'). See the transcriber manual (or the transcriber_codes db table) for details about the options available for each transcriber code. Similarly, a LENA speaker code can have many different options: ('FAN', "MAN', 'NON', 'TVF', etc.). See the speaker_codes db table or the LENA documentation for more info about these codes. Other types of codes also exist.
| def data_structs.codes.CodeInfo.__init__ | ( | self, | |
| db_id, | |||
| code, | |||
| desc, | |||
| is_linkable, | |||
| distance, | |||
| speaker_type, | |||
props = [] |
|||
| ) |
Constructor.
| self | |
| db_id | (int) database id for this code option. This is from one of the code tables like transcriber_codes, lena_nodes_codes, etc. |
| code | (string) the option text |
| desc | (string) a description for this option that can be used for display purposes in the UI |
| is_linkable | (boolean integer) If an option is linkable (param is 1), then segments containing that code option will be considered when linking C/I transcriber codes. If an option is not linkable (param is 0), then segments containing that code option will be skipped when linking C/I transcriber codes (i.e. the segments can exist between I and C coded segments without causing errors). |
| distance | (int) one of the options from the Enum DBConstants.SPEAKER_DISTANCES (if this class is not being instantiated for a speaker code, this can be set to DBConstants.SPEAKER_CODES.NA). |
| speaker_type | (int) one of the options from the Enum DBConstants.SPEAKER_TYPES (if this class is not being instantiated for a speaker code, this can be set to DBConstants.SPEAKER_TYPES.NA) |
| props | (list) list of ints - each should be an option from DBConstants.SPEAKER_PROPS. Pass empty list if properties are not applicable or needed for this code. |
| def data_structs.codes.CodeInfo.get_code | ( | self | ) |
| def data_structs.codes.CodeInfo.get_code_desc | ( | self | ) |
| def data_structs.codes.CodeInfo.has_property | ( | self, | |
| prop | |||
| ) |
Checks if this option has a given property from DBConstants.SPEAKER_PROPS.
These properties record secondary characteristics like whether or not the option represents media noise, or overlapping speach.
| self | |
| prop | (int) one of the options from DBConstants.SPEAKER_PROPS |
| def data_structs.codes.CodeInfo.is_distance | ( | self, | |
| distance | |||
| ) |
Checks if this option has a particular distance property (eg.
NEAR, FAR, NA)
| self | |
| distance | (int) one of the options from DBConstants.SPEAKER_DISTANCES (pass the NA option if distance is not applicable for this code option). |
| def data_structs.codes.CodeInfo.is_linkable | ( | self | ) |
Checks if this option is linkable.
If an option is linkable, then segments containing that code option will be considered when linking C/I transcriber codes. If an option is not linkable, then segments containing that code option will be skipped when linking C/I transcriber codes (i.e. the segments can exist between I and C coded segments without causing errors).
| self |
| def data_structs.codes.CodeInfo.is_speaker_type | ( | self, | |
| speaker_type | |||
| ) |
Checks if this option has a given speaker type (where speaker types are defined as for transcriber code 1 in the transcriber manual).
| self | |
| speaker_type | (int) one of the options from DBConstants.SPEAKER_TYPES (pass the NA option if speaker type is not applicable for this code option) |