Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,10 +138,11 @@ def preprocess_text(text, lang='german'):
|
|
| 138 |
|
| 139 |
return ' '.join(tokens)
|
| 140 |
|
| 141 |
-
def phonetic_match(text, query, method='
|
| 142 |
-
if method == '
|
| 143 |
-
text_phonetic = jellyfish.
|
| 144 |
-
query_phonetic = jellyfish.cologne_phonetic(query)
|
|
|
|
| 145 |
return jellyfish.jaro_winkler(text_phonetic, query_phonetic)
|
| 146 |
return 0
|
| 147 |
|
|
|
|
| 138 |
|
| 139 |
return ' '.join(tokens)
|
| 140 |
|
| 141 |
+
def phonetic_match(text, query, method='levenshtein_distance'):
|
| 142 |
+
if method == 'levenshtein_distance':
|
| 143 |
+
text_phonetic = jellyfish.levenshtein_distance(text)
|
| 144 |
+
#query_phonetic = jellyfish.cologne_phonetic(query)
|
| 145 |
+
query_phonetic = jellyfish.levenshtein_distance(query)
|
| 146 |
return jellyfish.jaro_winkler(text_phonetic, query_phonetic)
|
| 147 |
return 0
|
| 148 |
|