Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
data_structs.codes.CodeInfo Class Reference

This class holds information about a particular code option. More...

Inheritance diagram for data_structs.codes.CodeInfo:

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
 

Detailed Description

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.

Definition at line 171 of file codes.py.

Constructor & Destructor Documentation

def data_structs.codes.CodeInfo.__init__ (   self,
  db_id,
  code,
  desc,
  is_linkable,
  distance,
  speaker_type,
  props = [] 
)

Constructor.

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

Definition at line 188 of file codes.py.

Member Function Documentation

def data_structs.codes.CodeInfo.get_code (   self)

Returns the code string for this option.

Parameters
self
Returns
(string) an options string (like 'MAN' or 'FAN')

Definition at line 235 of file codes.py.

def data_structs.codes.CodeInfo.get_code_desc (   self)

Returns the description for this option.

Parameters
self
Returns
(string) description text

Definition at line 229 of file codes.py.

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.

Parameters
self
prop(int) one of the options from DBConstants.SPEAKER_PROPS
Returns
(boolean) True if this option has the specified property, False otherwise.

Definition at line 202 of file codes.py.

def data_structs.codes.CodeInfo.is_distance (   self,
  distance 
)

Checks if this option has a particular distance property (eg.

NEAR, FAR, NA)

Parameters
self
distance(int) one of the options from DBConstants.SPEAKER_DISTANCES (pass the NA option if distance is not applicable for this code option).
Returns
(boolean) True if this option has the distance property, False otherwise.

Definition at line 216 of file codes.py.

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

Parameters
self
Returns
(boolean) True if this option is linkable, False otherwise

Definition at line 209 of file codes.py.

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

Parameters
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)
Returns
(boolean) True if this option has the specified speaker type, False otherwise.

Definition at line 223 of file codes.py.

Member Data Documentation

data_structs.codes.CodeInfo.code

Definition at line 191 of file codes.py.

data_structs.codes.CodeInfo.db_id

Definition at line 189 of file codes.py.

data_structs.codes.CodeInfo.desc

Definition at line 190 of file codes.py.

data_structs.codes.CodeInfo.distance

Definition at line 193 of file codes.py.

data_structs.codes.CodeInfo.is_linkable

Definition at line 192 of file codes.py.

data_structs.codes.CodeInfo.props_dict

Definition at line 195 of file codes.py.

data_structs.codes.CodeInfo.speaker_type

Definition at line 194 of file codes.py.


The documentation for this class was generated from the following file: