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.

Source Distribution

pycodesim-0.0.2.tar.gz (2.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page