$ python pycode_similar/tests/test_cases.py If you have the source code you can run the tests with And you can switch to TreeDiff when use it as a library. So, when run this tool in cmd, the default diff method is UnifiedDiff. TreeDiff, diff function AST, very slow and the result is not good for small functions. UnifiedDiff, diff normalized function AST string lines, naive but efficiency. This tool has implemented two diff methods: line based diff(UnifiedDiff) and tree edit distance based diff(TreeDiff), both of them are run in function AST level. UnifiedDiff, keep_prints = False, module_level = False ) Implementation Of course, you can use it as a python library, too. m, -module-level process module level nodes p P if plagiarism percentage of the function >= value then output detail (default: 0.5) l L if AST line of the function >= value then output detail (default: 4) h, -help show this help message and exit Usage: pycode_similar files filesĪ simple plagiarism detection tool for python code Just use it as a standard command line tool if pip install properly. Which will install the module(without tests) on your system.Īlso, you can just copy & paste the pycode_similar.py which require no third-party dependency. If you don’t have much time, just perform ![]() So, I have no accurate comparison between pycode_similar and Moss. And I have tried many ways to register account for Stanford Moss, but still can’t get a valid account. This tool was born before I know there is a Moss (for a Measure Of Software Similarity) to determine the similarity of programs. ![]() No third-party dependency (except zss when use TreeDiff) It only cost me a couple of hours to implement this tool, so there is still a long way to improve the speed and accuracy, but it already performs great in detecting the plagiarism of new recruits’ homeworks in our company. The plagiarism defined in pycode_similar is how many referenced code is plagiarized by candidate code, which means swap referenced code and candidate code will get different result. This is a simple plagiarism detection tool for python code, the basic idea is to normalize python AST representation and use difflib to get the modification from referenced code to candidate code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |