Add my script PLAGIARISM_DETECTOR to the repo (#218)

This commit is contained in:
Akshita Singhal 2021-10-02 16:30:44 +05:30 committed by GitHub
parent d68ab3408e
commit 5df866d1d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View 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

View 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)

View File

@ -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)|
|[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)|
|[Plagiarism_detector](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Plagiarism_detector)|[Akshita Singhal](https://github.com/akshitasinghal4444)|
## How to use :