Skip to content

calculate code duplicate rate by calculating string similarity, mini string clone digger

Notifications You must be signed in to change notification settings

SKing7/mini-clone-digger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#mini-clone-digger 使用字符串相似度算法(编辑距离算法 Minimum Edit Distance)来计算检查文本的相似度,来近似计算文件的重复度

使用示例:

  var task = require('../lib/task');
  var instance = task('/your/path');
  instance.main([//对比的文件数组列表
     'navigation/navigation_index_content_bus_walk.html',
      'navigation/navigation_index_content_car.html',
      'navigation/navigation_index_content.html',
 ], function (rate) {
     console.log(rate);
  });

输出结果:

[ [ 1, 0.9258698940998487, 0.4193548387096774 ],
  [ 0.9258698940998487, 1, 0.3933434190620272 ],
  [ 0.4193548387096774, 0.3933434190620272, 1 ] ]

node test/autonavi.js -p ~/autonavi/mobile/src/tpl/

About

calculate code duplicate rate by calculating string similarity, mini string clone digger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published