MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / findSimilarity

Function findSimilarity

Python/plagiarism.py:4–9  ·  view source on GitHub ↗
(f1, f2)

Source from the content-addressed store, hash-verified

2
3
4def findSimilarity(f1, f2):
5 with open(f1, errors="ignore") as file1, open(f2, errors="ignore") as file2:
6 f1_content = file1.read()
7 f2_content = file2.read()
8 similarity = SequenceMatcher(None, f1_content, f2_content).ratio()
9 print(f"The files are {similarity*100}% similar")
10
11
12if __name__ == '__main__':

Callers 1

plagiarism.pyFile · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected