infoscout / weighted-levenshtein

Weighted Levenshtein library
MIT License
105 stars 26 forks source link

Spezial characters #13

Open erikradisch opened 6 years ago

erikradisch commented 6 years ago

Hey! Awesome module! It is exactly what I need. I only have one problem. Do I understand it right, that it works only with ascii-code? I tried special characters and they lead into an error...

RevolutionTech commented 6 years ago

That's correct. weighted-levenshtein only support ASCII unfortunately. A PR to add UTF-8 support would be welcome though!

B3AU commented 6 years ago

Mapping with chr seems to work:

mapping = {s:chr(i+1) for i,s in enumerate(symbols)}

\x00 causes trouble, hence the +1