mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-09 11:50:00 +02:00
🐛 Fix docstring of distance() for grapheme clusters
This commit is contained in:
parent
e256526ea1
commit
618ea567de
1 changed files with 4 additions and 4 deletions
|
@ -9,11 +9,11 @@ from .extracted_text import ExtractedText
|
|||
|
||||
@multimethod
|
||||
def distance(seq1: list[str], seq2: list[str]):
|
||||
"""Compute the Levenshtein edit distance between two Unicode strings
|
||||
"""Compute the Levenshtein edit distance between two lists of grapheme clusters.
|
||||
|
||||
Note that this is different from levenshtein() as this function knows about Unicode
|
||||
normalization and grapheme clusters. This should be the correct way to compare two
|
||||
Unicode strings.
|
||||
This assumes that the grapheme clusters are already normalized.
|
||||
|
||||
Use distance(str, str) instead if you need to compare two Unicode strings.
|
||||
"""
|
||||
return Levenshtein.distance(seq1, seq2)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue