-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9886cba
commit 4444f34
Showing
7 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule rapidfuzz-cpp
updated
from 5083fb to b2240f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import unittest | ||
|
||
from rapidfuzz.distance import Indel | ||
|
||
def test_similar_strings(): | ||
""" | ||
Test similar strings | ||
""" | ||
assert Indel.distance("test", "test") == 0 | ||
assert Indel.similarity("test", "test") == 8 | ||
assert Indel.normalized_distance("test", "test") == 0 | ||
assert Indel.normalized_similarity("test", "test") == 1.0 | ||
|
||
def test_different_strings(): | ||
""" | ||
Test completly different strings | ||
""" | ||
assert Indel.distance("aaaa", "bbbb") == 8 | ||
assert Indel.similarity("aaaa", "bbbb") == 0 | ||
assert Indel.normalized_distance("aaaa", "bbbb") == 1.0 | ||
assert Indel.normalized_similarity("aaaa", "bbbb") == 0.0 | ||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|