Chris4K commited on
Commit
c800eab
·
verified ·
1 Parent(s): 2156316

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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='koelner_phonetik'):
142
- if method == 'koelner_phonetik':
143
- text_phonetic = jellyfish.cologne_phonetic(text)
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