mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-23 20:11:07 +00:00
Add my script PLAGIARISM_DETECTOR to the repo (#218)
This commit is contained in:
parent
d68ab3408e
commit
5df866d1d2
8
Plagiarism_detector/README.md
Normal file
8
Plagiarism_detector/README.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Plagiarism Detector
|
||||||
|
This script helps to detect the amount (percentage) of similarity between 2 files .
|
||||||
|
|
||||||
|
## Input
|
||||||
|
It takes paths of 2 files you want to compare as input
|
||||||
|
|
||||||
|
## Output
|
||||||
|
It returns the percentage of similarity between the 2 files
|
13
Plagiarism_detector/plagiarism.py
Normal file
13
Plagiarism_detector/plagiarism.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
from difflib import SequenceMatcher
|
||||||
|
|
||||||
|
def similarity_per(f1,f2):
|
||||||
|
with open(f1,errors="ignore") as file1,open(f2,errors="ignore") as file2:
|
||||||
|
file1_data=file1.read()
|
||||||
|
file2_data=file2.read()
|
||||||
|
similarity=SequenceMatcher(None,file1_data,file2_data).ratio()
|
||||||
|
print(f"these 2 files are {similarity*100} % similar")
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
f1=input("file 1 path :")
|
||||||
|
f2=input("file 2 path :")
|
||||||
|
similarity_per(f1,f2)
|
|
@ -175,6 +175,7 @@ So far, the following projects have been integrated to this repo:
|
||||||
|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)|
|
|[Folder Locker and hider](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Folder%20Locker%20%26%20Hider)|[Prajjwal Pathak](https://github.com/pyguru123)|
|
||||||
|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)|
|
|[Image Compressor](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Image_Compressor)|[Prathima Kadari](https://github.com/prathimacode-hub)|
|
||||||
|[Test Your Internet Speed](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TestMyInternetSpeed)|[TheSmartDeveloperr](https://github.com/thesmartdeveloperr)|
|
|[Test Your Internet Speed](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/TestMyInternetSpeed)|[TheSmartDeveloperr](https://github.com/thesmartdeveloperr)|
|
||||||
|
|[Plagiarism_detector](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Plagiarism_detector)|[Akshita Singhal](https://github.com/akshitasinghal4444)|
|
||||||
|
|
||||||
## How to use :
|
## How to use :
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user