void (int start1, int start2, int end1, int end2) { assert lastStart1 != -1 && lastStart2 != -1 && lastEnd1 != -1 && lastEnd2 != -1; if (lastStart1 == start1 && lastStart2 == start2) { // pair of adjustment matched words, match gap between ("A B" - "A B") assert lastEnd1 == end1 && lastEnd2 == end2; matchRange(start1, start2, end1, end2); return; } if (lastStart1 < start1 && lastStart2 < start2) { // pair of matched words, with few unmatched ones between ("A X B" - "A Y B") assert lastEnd1 <= start1 && lastEnd2 <= start2; matchRange(lastStart1, lastStart2, lastEnd1, lastEnd2); matchRange(start1, start2, end1, end2); return; } // one side adjustment, and other has non-matched words between ("A B" - "A Y B") matchComplexRange(lastStart1, lastStart2, lastEnd1, lastEnd2, start1, start2, end1, end2); }