mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-07-12 20:09:58 +02:00
🐛 Move source into src/ to fix install
Installing was broken since moving to pyproject.toml, which we didn't notice because of
leftover files in build/. Fix this by using the convention of having the source files
in src/ and adjusting pyproject.toml accordingly.
Fixes gh-86. 🤞
This commit is contained in:
parent
db7c051b22
commit
325e5af5f5
84 changed files with 2 additions and 3 deletions
24
src/dinglehopper/tests/test_edit_distance.py
Normal file
24
src/dinglehopper/tests/test_edit_distance.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from __future__ import division, print_function
|
||||
|
||||
import unicodedata
|
||||
|
||||
from .. import distance
|
||||
|
||||
|
||||
def test_distance():
|
||||
assert distance("Fnord", "Food") == 2
|
||||
assert distance("Müll", "Mull") == 1
|
||||
|
||||
word1 = unicodedata.normalize("NFC", "Schlyñ")
|
||||
word2 = unicodedata.normalize("NFD", "Schlyñ") # Different, decomposed!
|
||||
assert distance(word1, word2) == 0
|
||||
|
||||
word1 = "Schlyñ"
|
||||
assert (
|
||||
len(word1) == 6
|
||||
) # This ends with LATIN SMALL LETTER N WITH TILDE, so 6 code points
|
||||
word2 = "Schlym̃"
|
||||
assert (
|
||||
len(word2) == 7
|
||||
) # This, OTOH, ends with LATIN SMALL LETTER M + COMBINING TILDE, 7 code points
|
||||
assert distance(word1, word2) == 1
|
Loading…
Add table
Add a link
Reference in a new issue