from aligned_textgrid import AlignedTextGrid, custom_classes
= AlignedTextGrid(
tg ="../resources/josef-fruehwald_speaker.TextGrid",
textgrid_path=custom_classes(["Word", "Phone"])
entry_classes )
Pickling Aligned TextGrids
Due to the number of dynamically created classes, the default python pickle
library doesn’t currently work for AlignedTextGrid
s. However, the cloudpickle
library does.
import cloudpickle
from pathlib import Path
= Path("test.pickle") out_file
with out_file.open('wb') as f:
cloudpickle.dump(tg, f)
with out_file.open('rb') as f:
= cloudpickle.load(f) new_tg
Reuse
GPLv3