Transcription

class corpustools.corpus.classes.lexicon.Transcription(seg_list)[source]

Transcription object, sequence of symbols

Parameters:
seg_list : list

List of segments that form the transcription. Elements in the list, can be Segments, strings, or BaseAnnotations

Attributes:
_list : list

List of strings representing segment symbols

stress_pattern: dict

Dictionary with keys of segment indices and values of the stress for that segment

boundaries : dict

Possible keys of ‘morpheme’ or ‘tone’ that keeps track of where morpheme or tone boundaries are inserted

Methods

__init__(seg_list) Initialize self.
find(environment) Find instances of an EnvironmentFilter in the Transcription
find_nonmatch(environment[, is_sets]) Find all instances of an EnvironmentFilter in the Transcription that match in the middle segments, but don’t match on the sides
match_segments(segments) Returns a matching segments from a list of segments
with_word_boundaries() Return the string of segments with word boundaries surrounding them
find(environment)[source]

Find instances of an EnvironmentFilter in the Transcription

Parameters:
environment : EnvironmentFilter

EnvironmentFilter to search for

Returns:
list

List of Environments that fit the EnvironmentFilter

find_nonmatch(environment, is_sets=False)[source]

Find all instances of an EnvironmentFilter in the Transcription that match in the middle segments, but don’t match on the sides

Parameters:
environment : EnvironmentFilter

EnvironmentFilter to search for

Returns:
list

List of Environments that fit the EnvironmentFilter’s middle but not the sides

match_segments(segments)[source]

Returns a matching segments from a list of segments

Parameters:
segments : list

List of Segments or strings to filter the Transcription

Returns:
list

List of segments (in their original order) that match the segment parameter

with_word_boundaries()[source]

Return the string of segments with word boundaries surrounding them

Returns:
list

Transcription with word boundaries