@Test
public void testEmbeddedContexts() {
System.out.println("Embedded Suffix Tree Test");
int counter = 0;
for (EmbeddedInterval embeddedInterval : embeddedExtractor) {
Context context = new EmbeddedContext(embeddedInterval);
IntSequence left = context.leftSequence();
IntSequence right = context.rightSequence();
Multiset<IntSequence> expectedSet = fillerSet(left, right);
Multiset<IntSequence> resultSet = context.fillerSet();
if (!resultSet.equals(expectedSet)) {
String leftString = corpus.toString(left, " ");
String rightString = corpus.toString(right, " ");
String expectedString = corpus.toString(expectedSet, " ");
String resultString = corpus.toString(resultSet, " ");
System.out.printf("%s %s %s\n", leftString, expectedString, rightString);
System.err.printf("%s %s %s\n", leftString, resultString, rightString);
fail("fill mismatch");
}
if (expectedSet.size() != context.fillerSetSize()) {
System.err.printf("%d != %d\n", expectedSet.size(), context.fillerSetSize());
fail("filler set size mismatch");
}
counter++;
}
System.out.printf("total contexts: %d\n", counter);