/** * Prints a generic string representation of a given segmented text, with optional * markers to indicate the segments boundaries. * @param container The container to output. * @param showSegments True if segment boundaries should be shown. * @return A string with the segmented text output. */ public String printSegmentedContent (TextContainer container, boolean showSegments) { return printSegmentedContent(container, showSegments, false); }
private boolean writeTextContainer(TextContainer tc) { try { if (tc == null) { return false; } String tmp; tmp = formatter.printSegmentedContent(tc, false, false); // replace with original format linefeeds tmp = tmp.replace("\n", linebreak); writer.write(tmp); // No wrapping needed if (tmp.endsWith("\n")) { return true; } return false; } catch (IOException e) { throw new OkapiIOException("Error writing TextContainer.", e); } } }
writer.write(sampleOutput.printSegmentedContent(textCont, true, true));
tmp = fmt.printSegmentedContent(tc, false, !params.getOutputGeneric());
sampleText.getSegments().create(segmenter.getRanges()); edResults.setText(sampleOutput.printSegmentedContent(sampleText, true, true));