![]() |
Baby Language Lab Scripts
A collection of data processing tools.
|
Provides BLL-app-specific data retreival and storage routines, building on the base database class. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | apply_update_scripts |
Runs any sql scripts in UPDATE_SCRIPT_DIR that haven't been run yet. More... | |
def | select_codes |
This method creates Code objects containing all the options for a particular type of code (transcriber, lena_notes, speaker). More... | |
def | select_enum |
Builds an Enum based upon a selection from a particular property or table. More... | |
![]() | |
def | __init__ |
Constructor. More... | |
def | close |
Closes the database connection, releasing any resources that it was using. More... | |
def | execute_stmt |
Executes a verbatim SQL statement. More... | |
def | execute_script |
Reads and executes a sql script file. More... | |
def | insert |
Inserts one or more rows into a table in the database. More... | |
def | select |
Selects rows from a table in the database. More... | |
def | delete |
Deletes rows from a table in the database. More... | |
def | update_timestamp_col |
Updates the value of a timestamp column to the current date/time. More... | |
def | update |
Updates rows in a table. More... | |
def | write_to_file |
Writes out all of the data in a table to a csv file. More... | |
Static Public Attributes | |
string | DB_LOCATION = 'db/bll_db.db' |
string | CREATE_TABLES_SCRIPT = 'db/sql/init/create_tables.sql' |
string | INSERT_DATA_SCRIPT = 'db/sql/init/insert_data.sql' |
string | UPDATE_SCRIPT_DIR = 'db/sql/updates/' |
int | NUM_TRANS_CODES = 4 |
Private Member Functions | |
def | _get_speaker_types_enum |
Builds an Enum of recognized speaker types from the speaker_types table. More... | |
def | _get_speaker_distances_enum |
Builds an enum of possible speaker 'distances' (eg. More... | |
def | _get_speaker_props_enum |
Builds an Enum of possible speaker 'properties' (Eg. More... | |
def | _get_combo_groups_enum |
Builds an Enum of all possible combo groups. More... | |
def | _get_common_regexs_enum |
Builds an Enum of common regular expressions from the common_regex DB table. More... | |
def | _get_combo_options_enum |
Builds a dictionary (of Enums - one for each combo group), containing all prossible combo box options that the UI can use. More... | |
def | _get_settings_enum |
Builds an Enum of the application settings from the settings table. More... | |
def | _select_transcriber_codes |
Builds a list of Code objects for transcriber codes. More... | |
def | _select_lena_notes_codes |
Creates a Code object containing information about options from the lena_notes_codes table. More... | |
def | _select_speaker_codes |
Creates a Code object containing information about options from the speaker_codes table. More... | |
Additional Inherited Members | |
![]() | |
conn | |
cursor | |
Provides BLL-app-specific data retreival and storage routines, building on the base database class.
Constants needed for segment and utterance parsing/manipulation (lena speaker codes, transcriber codes, etc.), application-wide settings (info needed to launch Praat and Excel), common UI combobox options, and any associated information are retreived from database tables and put into Enums by routines in this class. The DBConstants class (see bottom of file) is populated using these methods. DBConstants' public attributes (Enums) can then be used anywhere in the application code.
Definition at line 18 of file bll_database.py.
def db.bll_database.BLLDatabase.__init__ | ( | self | ) |
|
private |
Builds an Enum of all possible combo groups.
Each combo group corresponds to a single dropdown box in the UI, and maps to one or more combo options. The Enum is built from the combo_groups table.
self |
Definition at line 114 of file bll_database.py.
|
private |
Builds a dictionary (of Enums - one for each combo group), containing all prossible combo box options that the UI can use.
self |
Definition at line 132 of file bll_database.py.
|
private |
Builds an Enum of common regular expressions from the common_regex DB table.
self |
Definition at line 123 of file bll_database.py.
|
private |
Builds an Enum of the application settings from the settings table.
self |
Definition at line 145 of file bll_database.py.
|
private |
Builds an enum of possible speaker 'distances' (eg.
FAN speaker has distance of 'near', FAF speaker has distance of 'far', 'SIL' speaker has distance of 'not applicable').
self | |
returns | (Enum) attributes are 'NA, NEAR, FAR', values are 0, 1, 2 (respectively) |
Definition at line 100 of file bll_database.py.
|
private |
Builds an Enum of possible speaker 'properties' (Eg.
speakers can be overlapping, be non-verbal noise, or be tv/radio sound)
self |
Definition at line 107 of file bll_database.py.
|
private |
Builds an Enum of recognized speaker types from the speaker_types table.
These are derrived from transcriber code 1's possible options (see transcriber manual) like 'MALE_ADULT', 'FEMALE_ADULT', 'OTHER_CHILD', etc.
self |
Definition at line 91 of file bll_database.py.
|
private |
Creates a Code object containing information about options from the lena_notes_codes table.
('LENA notes codes' look like 'VOC', 'SIL', etc.)
self |
Definition at line 219 of file bll_database.py.
|
private |
Creates a Code object containing information about options from the speaker_codes table.
(LENA speaker codes like 'MAN', 'FAN', etc.)
self | returns (Code) a Code object that can be used to access info about different speaker code options. |
Definition at line 242 of file bll_database.py.
|
private |
Builds a list of Code objects for transcriber codes.
The Code objects contain information from the transcriber_codes database table.
self |
Definition at line 180 of file bll_database.py.
def db.bll_database.BLLDatabase.apply_update_scripts | ( | self | ) |
Runs any sql scripts in UPDATE_SCRIPT_DIR that haven't been run yet.
In order to do this, scripts must follow a naming convention: "update-x.sql", where x is an integer. The files in UPDATE_SCRIPT_DIR are sorted by this integer before being applied. If previous update scripts have been applied, the last script number is recorded in the settings table. Only scripts with numbers greater than this number are applied when this method is called.
self |
Definition at line 49 of file bll_database.py.
def db.bll_database.BLLDatabase.select_codes | ( | self, | |
table | |||
) |
This method creates Code objects containing all the options for a particular type of code (transcriber, lena_notes, speaker).
self | |
table | (string) name of the table to select from. |
Definition at line 157 of file bll_database.py.
def db.bll_database.BLLDatabase.select_enum | ( | self, | |
table | |||
) |
Builds an Enum based upon a selection from a particular property or table.
self | |
table | (string) name of the table to select from |
Definition at line 167 of file bll_database.py.
|
static |
Definition at line 20 of file bll_database.py.
|
static |
Definition at line 19 of file bll_database.py.
|
static |
Definition at line 21 of file bll_database.py.
|
static |
Definition at line 23 of file bll_database.py.
|
static |
Definition at line 22 of file bll_database.py.