private void CompareMatched(IReadOnlyList <string> wmLeft, IReadOnlyList <string> wmRight, CharRepresenter charRep) { var matcher = new PatienceMatch(); int leftLineNo = 0, rightLineNo = 0; foreach (var line in this) { if (line.HasLeftLine && line.HasRightLine) { string left = wmLeft[leftLineNo], right = wmRight[rightLineNo]; if (left == right) { line.SetEqual(); } else { var match = matcher.Match(left, right, charRep.MaxWordChar); line.Compare(match, left, right, charRep); } } if (line.HasLeftLine) { leftLineNo++; } if (line.HasRightLine) { rightLineNo++; } } }
public void Recompare(MatchedLineNode node, string ourLine, string otherLine) { if (ourLine == otherLine) { node.SetEqual(); return; } var charRep = new CharRepresenter(); var wmLeft = charRep.WordsToChars(side ? otherLine : ourLine); var wmRight = charRep.WordsToChars(side ? ourLine : otherLine); var match = new PatienceMatch().Match(wmLeft, wmRight, charRep.MaxWordChar); node.Compare(match, wmLeft, wmRight, charRep); }