Package name.neil.fraser.plaintext

Examples of name.neil.fraser.plaintext.diff_match_patch$LinesToCharsResult


    // Since we can't tell which new paragraph mapped to which old one to do a straight up diff,
    // this method gets the edit distance between each remaining new paragraph
    // and each remaining old paragraph.  It finds the minimum edit distance for each new
    // paragraph, and if it's higher than the threshold,  we highlight it.
    if (!newParagraphs.isEmpty()) {
      diff_match_patch dmp = new diff_match_patch();
      for (Node newParagraph : newParagraphs) {
        int minEditDistance = Integer.MAX_VALUE;
        for (Node oldParagraph : oldParagraphs) {
          LinkedList<Diff> diffs = dmp.diff_main(
              getTextContent(oldParagraph), getTextContent(newParagraph));
          minEditDistance = Math.min(minEditDistance, modifiedLevenshteinDistance(diffs));
        }
        if (minEditDistance > EDIT_DISTANCE_THRESHOLD) {
          Element paragraphElement = (Element) newParagraph;
View Full Code Here

TOP

Related Classes of name.neil.fraser.plaintext.diff_match_patch$LinesToCharsResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.