ComplexTextStructure cts = getTextStructure(document);
addSegmentInformation(document, cts);
}
private ComplexTextStructure getTextStructure(TextDocument document) {
TextStructure structure = document.getDataStructure();
if (structure == null) {
structure = document.createTextStructure();
}
if (structure instanceof ComplexTextStructure) {
return (ComplexTextStructure) structure;