Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 896 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 896 Bytes

Difflib

用Java实现的简易版difflib.SequenceMatcher,目前功能主要是计算两个字符串的相似率以及从字符串a转换到字符串b所需要进行哪些操作

主要类 SequenceMatcher

使用方法:

        SequenceMatcher matcher = new SequenceMatcher("2055516", "205/55R16");
        System.out.println(matcher.ratio()+"\t" + matcher.getOpcodes());
        matcher.setNew("abcd","bcde");
        System.out.println(matcher.ratio()+"\t" + matcher.getOpcodes());
        matcher.setNew("abc","abc");
        System.out.println(matcher.ratio()+"\t" + matcher.getOpcodes());

参考