Skip to content

m2ci-msp/jtgt

Repository files navigation

CI License: LGPL v3

JTGT

JTGT is a Java library for loading, manipulating, and writing Praat TextGrid files, and similar annotation files, such as XWaves lab. It's inspired by the TextGridTools module for Python.

Dependency Information

Snapshot builds are OSSRH. Release versions are hosted on OSSRH and indexed in Maven Central.

Examples

Loading a TextGrid file

String tgStr = new File("path/to/my.TextGrid").getText();
TextGrid tg = new TextGridSerializer().fromString(tgStr);

Iterating over intervals

for (Annotation annot : tg.getTiers().get(0).getAnnotations()) {
    System.out.println(annot.getText());
}