}
}
public static <S> String toString(Interval interval, Corpus<S> corpus, boolean asLaTeX) {
if (interval instanceof EmbeddedInterval) {
EmbeddedInterval embeddedInterval = (EmbeddedInterval) interval;
String embeddingLabel = toString(embeddedInterval.getEmbeddingInterval(), corpus, asLaTeX);
String embeddedLabel = corpus.toString(embeddedInterval.label(), delimiter);
if (asLaTeX) {
return String.format("%s \\dots %s", embeddingLabel, embeddedLabel);
} else {
return String.format("%s %s %s", embeddingLabel,
corpus.toString(embeddedInterval.fillerSet(), delimiter), embeddedLabel);
}
}
return String.format("%s", corpus.toString(interval.label(), delimiter));
}