use of org.trie4j.louds.bvtree.LOUDSBvTree in project trie4j by takawitter.
the class AbstractWikipediaSerializeTest method getBvTreeClassName.
static String getBvTreeClassName(Trie trie) {
if (trie instanceof TailLOUDSTrie) {
StringBuilder b = new StringBuilder("(");
BvTree bvTree = ((TailLOUDSTrie) trie).getBvTree();
b.append(bvTree.getClass().getSimpleName());
if (bvTree instanceof LOUDSBvTree) {
b.append("(");
b.append(((LOUDSBvTree) bvTree).getSbv().getClass().getSimpleName());
b.append(")");
} else if (bvTree instanceof LOUDSPPBvTree) {
b.append("(");
LOUDSPPBvTree pbvt = (LOUDSPPBvTree) bvTree;
b.append("r0:").append(pbvt.getR0().getClass().getSimpleName()).append(",r1:").append(pbvt.getR1().getClass().getSimpleName()).append(")");
}
b.append(")");
return b.toString();
} else {
return "";
}
}
use of org.trie4j.louds.bvtree.LOUDSBvTree in project trie4j by takawitter.
the class TrieWriter method writeBvTree.
public void writeBvTree(BvTree bvTree) throws IOException {
if (bvTree instanceof LOUDSBvTree) {
dos.writeShort(TYPE_BVTREE_LOUDS);
writeLOUDSBvTree((LOUDSBvTree) bvTree);
} else if (bvTree instanceof LOUDSPPBvTree) {
dos.writeShort(TYPE_BVTREE_LOUDSPP);
writeLOUDSPPBvTree((LOUDSPPBvTree) bvTree);
} else {
throw new IOException("unknown bv tree: " + bvTree.getClass().getName());
}
}
use of org.trie4j.louds.bvtree.LOUDSBvTree in project trie4j by takawitter.
the class TailLOUDSTrieWithSuffixTrieTailArrayWikipediaMonitoredSBVTest method buildSecondTrie.
@Override
protected Trie buildSecondTrie(Trie first) {
bv.resetCounts();
TailLOUDSTrie t = new TailLOUDSTrie(first, new LOUDSBvTree(bv), new SuffixTrieTailArray(first.size()), new NodeListener() {
@Override
public void listen(Node node, int id) {
}
});
t.trimToSize();
return t;
}
Aggregations