}
}
}
public void visualizeEmbeddedSuffixesInWindow(Drawing drawing, SuffixArray sa, Interval interval, int windowSize) {
IntSequence indices = interval.indices();
int lcp = interval.lcp();
int[] inverseSuffixTable = sa.getInverseSuffixTable();
SortedMap<Integer, Integer> embeddedSuffixTableIndices = new TreeMap<Integer, Integer>();
int counter = 0;
for (int i = 0; i < interval.size(); i++) {
int start = indices.get(i) + lcp;
for (int j = start; j < start + windowSize && j < sequence.size(); j++) {
drawing.drawCell(0, counter, Integer.toString(j), TikzConstants.RED_CELL);
drawing.drawCell(1, counter, Integer.toString(inverseSuffixTable[j]), TikzConstants.GREEN_CELL);
IntSequence subSequence = sequence.subSequence(j, sequence.size());
Integer startIndex = embeddedSuffixTableIndices.get(inverseSuffixTable[j]);
if (startIndex == null || startIndex < start) {
embeddedSuffixTableIndices.put(inverseSuffixTable[j], start);
}
for (int k = 0; k < subSequence.size(); k++) {
drawing.drawCell(k + 2, counter, symbolTable.toToken(subSequence.get(k)).toString(),
Integer.toString(j + k), TikzConstants.LIGHT_BLUE_CELL);
}
counter++;
}
}