1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-06-07 19:05:13 +02:00

🐛 Use Optional instead of | none, for Python <3.10

This commit is contained in:
Mike Gerber 2024-01-03 20:40:06 +01:00
parent 4832d1542f
commit 071766efc2

View file

@ -1,6 +1,7 @@
import math import math
import unicodedata import unicodedata
from math import ceil from math import ceil
from typing import Optional
from rapidfuzz.distance import Levenshtein from rapidfuzz.distance import Levenshtein
@ -14,7 +15,7 @@ def align(t1, t2):
return seq_align(s1, s2) return seq_align(s1, s2)
def score_hint(er: float, n: int) -> int | None: def score_hint(er: float, n: int) -> Optional[int]:
"""Calculate RapidFuzz score hint for a given error rate and count. """Calculate RapidFuzz score hint for a given error rate and count.
Gives the score hint for the distance functions (= expected distance) or None if Gives the score hint for the distance functions (= expected distance) or None if