![]() |
Baby Language Lab Scripts
A collection of data processing tools.
|
This class represents an Utterance. More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | __str__ |
Gives a string-representation of this utterance. More... | |
def | is_linkable |
Checks if this Utterance can be linked (chained via the next/prev instance vars) to other Utterances. More... | |
def | validate |
This method checks this Utterance for errors/warnings (e.g. More... | |
![]() | |
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 | |
speaker | |
trans_phrase | |
start | |
end | |
lena_notes | |
lena_codes | |
trans_codes | |
next | |
prev | |
is_trans_overlap | |
seg | |
is_dot_split | |
id | |
Static Public Attributes | |
int | next_id = 0 |
This class represents an Utterance.
For TRS files, an Utterance object corresponds to a single line of text following a "sync" or "who" tag. For CSV files, an Utterance object corresponds to a single row. Utterances are usually contained within a parent Segment object (corresponding to a "Turn" tag in a TRS file), and contain a pointer back to this parent Segment object. There may multiple utterances in a single Segment (see Segment.utters property), but each Utterance may only belong to one Segment. Utterances may be chained together (via transcriber C/I codes - see transcriber manual). Such a link is represented using the 'next' and 'prev' instance variables, which point to adjacent Utterances in the chain. These should never by linked circularly (i.e. it is impossible for a transcriber to code a circularly linked utterance). Unlike Segments, utterances are not stored in the database, and should never be manually constructed. Instead, they are generated by Parser objects (see parsers directory).
Definition at line 17 of file utterance.py.
def data_structs.utterance.Utterance.__init__ | ( | self | ) |
Constructor.
Typically, this object is not constructed manually, so no parameters are provided. Instead, the parser objects create Utterances and set their parameters as they process a CSV/TRS file.
self |
Definition at line 23 of file utterance.py.
def data_structs.utterance.Utterance.__str__ | ( | self | ) |
Gives a string-representation of this utterance.
Also see superclass definition.
@returns | (string) a string with formatted info suitable for printing to the console |
Definition at line 43 of file utterance.py.
def data_structs.utterance.Utterance.is_linkable | ( | self | ) |
Checks if this Utterance can be linked (chained via the next/prev instance vars) to other Utterances.
This is used by the parsers when they go through a file. Utterances that represent silence, for example, should not be linked.
self |
Definition at line 58 of file utterance.py.
def data_structs.utterance.Utterance.validate | ( | self, | |
error_collector | |||
) |
This method checks this Utterance for errors/warnings (e.g.
invalid transcriber codes, ambiguous I/C codes, etc.). These are added to the error_collector object.
self | |
error_collector | (ErrorCollector) An object used to organize and retreive errors in various ways (see data_structs.error_collector.py), so the UI can present them nicely. This method collects errors and adds them to this object. |
Definition at line 79 of file utterance.py.
data_structs.utterance.Utterance.end |
Definition at line 27 of file utterance.py.
data_structs.utterance.Utterance.id |
Definition at line 36 of file utterance.py.
data_structs.utterance.Utterance.is_dot_split |
Definition at line 35 of file utterance.py.
data_structs.utterance.Utterance.is_trans_overlap |
Definition at line 33 of file utterance.py.
data_structs.utterance.Utterance.lena_codes |
Definition at line 29 of file utterance.py.
data_structs.utterance.Utterance.lena_notes |
Definition at line 28 of file utterance.py.
data_structs.utterance.Utterance.next |
Definition at line 31 of file utterance.py.
|
static |
Definition at line 19 of file utterance.py.
data_structs.utterance.Utterance.prev |
Definition at line 32 of file utterance.py.
data_structs.utterance.Utterance.seg |
Definition at line 34 of file utterance.py.
data_structs.utterance.Utterance.speaker |
Definition at line 24 of file utterance.py.
data_structs.utterance.Utterance.start |
Definition at line 26 of file utterance.py.
data_structs.utterance.Utterance.trans_codes |
Definition at line 30 of file utterance.py.
data_structs.utterance.Utterance.trans_phrase |
Definition at line 25 of file utterance.py.