private static void annotatedTerm(StringBuilder destination, IndexedItem w, String annotations) { if (annotations.length() > 0) { destination.append("([{").append(annotations).append("}]"); } destination.append('"'); escape(w.getIndexedString(), destination).append('"'); if (annotations.length() > 0) { destination.append(')'); } }
public String getIndexedString() { StringBuilder buf = new StringBuilder(); for (Iterator<Item> i = getItemIterator(); i.hasNext();) { IndexedItem indexedItem = (IndexedItem) i.next(); buf.append(indexedItem.getIndexedString()); if (i.hasNext()) { buf.append(' '); } } return buf.toString(); }
public String getIndexedString() { StringBuilder buf = new StringBuilder(); for (Iterator<Item> i = getItemIterator(); i.hasNext();) { IndexedItem indexedItem = (IndexedItem) i.next(); buf.append(indexedItem.getIndexedString()); if (i.hasNext()) { buf.append(' '); } } return buf.toString(); }
terms.add(String.valueOf(item.getItemCount())); for (Iterator<Item> i = item.getItemIterator(); i.hasNext(); ) { terms.add(((IndexedItem)i.next()).getIndexedString());
@Override boolean serialize(StringBuilder destination, Item item) { EquivItem e = (EquivItem) item; String annotations = leafAnnotations(e); destination.append(getIndexName(e.getItem(0))).append(" contains "); if (annotations.length() > 0) { destination.append("([{").append(annotations).append("}]"); } destination.append(EQUIV).append('('); int initLen = destination.length(); for (Iterator<Item> i = e.getItemIterator(); i.hasNext();) { Item x = i.next(); if (destination.length() > initLen) { destination.append(", "); } if (x instanceof PhraseItem) { PhraseSerializer.serialize(destination, x, false); } else { destination.append('"'); escape(((IndexedItem) x).getIndexedString(), destination); destination.append('"'); } } if (annotations.length() > 0) { destination.append(')'); } destination.append(')'); return false; }