trftools.TextGrid

class trftools.TextGrid(realizations, tmin=0.0, tstep=0.001, n_samples=None, name=None)

TextGrid representation that associates phonemes with words

Parameters:
  • realizations (List[Realization]) – The realizations that constitute the TextGrid.

  • tmin (float) – The start time when converting the TextGrid to a uniform time series.

  • tstep (float) – The time step when converting the TextGrid to a uniform time series.

  • n_samples (int) – The number of samples when converting the TextGrid to a uniform time series.

  • name (str) – Name for the TextGrid.

Notes

Load an existing *.TextGrid file using TextGrid.from_file().

Methods

align_word_dataset(data[, words])

Align ds to the TextGrid

categories_to_array(tokens, codes, location)

Convert NUTS of categories to binary category x time array

concatenate(grid[, t0, name])

Concatenate two TextGrid instances

from_file(grid_file[, tmin, tstep, ...])

Load *.TextGrid file

get_indexes([feature, stop])

Event boundary indexes (in sample)

map_phones(mapping)

Replace each phoneme from mapping

merge_realizations(graphs1, graphs2)

Merge two realizations whenever graphs2 immediately follows graphs1

merge_silence()

Merge consecutive silence realizations

print([start, stop, segmentation, silence])

Print text with pronunciation

split_by_apostrophe([exceptions])

Split words with apostrophe

split_realization(graphs, phones1[, ...])

Split a realization into two separate realizations

strip_stress()

Remove stress digits from all phones (K AA1 R -> K AA R)

table([t_start, t_stop])

fmtxt.Table representation

values_to_array(values, value_location[, index])