trftools.TextGrid.split_by_apostrophe

TextGrid.split_by_apostrophe(exceptions=())

Split words with apostrophe

Language models often represent words containing apostrophe as two tokens, for example:

  • he’s -> he ‘s

  • isn’t -> is n’t

Parameters:

exceptions (Sequence[str]) – Preserve these words with apostrophe instead of splitting them.

Return type:

A new TextGrid in which realizations with apostrophe are split accordingly.