Skip to main content

A Python Code Similarity Detection Doll, just for fun.

Project description

A Python Code Similarity Detection Doll, just for fun. 用于计算python代码相似度的玩具。

背景

基于抽象语法树,有三种方法,第一种是最简单的jaccard相似度,第二种是树的编辑距离,第三种是遍历合适大小的子树计算anti-unification(不完全是)

demo

code_sim('codes/code1.py', 'codes/code2.py', 'jaccard')
code_sim('codes/code1.py', 'codes/code2.py', 'tree_edit')
code_sim('codes/code1.py', 'codes/code2.py', 'fake_anti_uni')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pycodesim, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size pycodesim-0.0.2.tar.gz (2.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page