@Test public void testAppendWord() throws Exception { assertXpath("count(/Document/Page[1]/Zone[1]/Line[1]/Word[1]/WordCorners)", 1); assertXpath("count(/Document/Page[1]/Zone[1]/Line[1]/Word[1]/WordID)", 1); assertXpath("count(/Document/Page[1]/Zone[1]/Line[1]/Word[1]/WordNext)", 1); assertXpath("count(/Document/Page[1]/Zone[1]/Line[1]/Word[1]/WordNumChars)", 1); assertXpath("count(/Document/Page[1]/Zone[1]/Line[1]/Word[1]/Character)", 2); }
private void appendWord(Document doc, Element parent, BxWord word, Object... hints) { Element node = doc.createElement("Word"); appendPropertyIfNotNull(doc, node, "WordID", word.getId()); appendBounds(doc, node, "WordCorners", word.getBounds(), hints); appendPropertyIfNotNull(doc, node, "WordNext", word.getNextId()); appendProperty(doc, node, "WordNumChars", ""); for (BxChunk chunk : word) { appendCharacter(doc, node, chunk, hints); } parent.appendChild(node); }
BxDocumentToTrueVizWriter { private void appendWord(Document doc, Element parent, BxWord word, Object... hints) { Element node = doc.createElement("Word"); appendPropertyIfNotNull(doc, node, "WordID", word.getId()); appendBounds(doc, node, "WordCorners", word.getBounds(), hints); appendPropertyIfNotNull(doc, node, "WordNext", word.getNextId()); appendProperty(doc, node, "WordNumChars", ""); for (BxChunk chunk : word) { appendCharacter(doc, node, chunk, hints); } parent.appendChild(node); } }
BxDocumentToTrueVizWriter { private void appendWord(Document doc, Element parent, BxWord word, Object... hints) { Element node = doc.createElement("Word"); appendPropertyIfNotNull(doc, node, "WordID", word.getId()); appendBounds(doc, node, "WordCorners", word.getBounds(), hints); appendPropertyIfNotNull(doc, node, "WordNext", word.getNextId()); appendProperty(doc, node, "WordNumChars", ""); for (BxChunk chunk : word) { appendCharacter(doc, node, chunk, hints); } parent.appendChild(node); }  }
BxDocumentToTrueVizWriter { private void appendWord(Document doc, Element parent, BxWord word, Object... hints) { Element node = doc.createElement("Word"); appendPropertyIfNotNull(doc, node, "WordID", word.getId()); appendBounds(doc, node, "WordCorners", word.getBounds(), hints); appendPropertyIfNotNull(doc, node, "WordNext", word.getNextId()); appendProperty(doc, node, "WordNumChars", ""); for (BxChunk chunk : word) { appendCharacter(doc, node, chunk, hints); } parent.appendChild(node); }  String write(List<BxPage> objects, Object... hints); void write(Writer writer, List<BxPage> objects, Object... hints); }
BxDocumentToTrueVizWriter { private void appendWord(Document doc, Element parent, BxWord word, Object... hints) { Element node = doc.createElement("Word"); appendPropertyIfNotNull(doc, node, "WordID", word.getId()); appendBounds(doc, node, "WordCorners", word.getBounds(), hints); appendPropertyIfNotNull(doc, node, "WordNext", word.getNextId()); appendProperty(doc, node, "WordNumChars", ""); for (BxChunk chunk : word) { appendCharacter(doc, node, chunk, hints); } parent.appendChild(node); }  String write(List<BxPage> objects, Object... hints); void write(Writer writer, List<BxPage> objects, Object... hints); static final String MINIMAL_OUTPUT_SIZE; static final Map<BxZoneLabel, String> ZONE_LABEL_MAP; }