Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Umlauts need additional edit distance #12

Open
then4p opened this issue Nov 9, 2021 · 0 comments
Open

Umlauts need additional edit distance #12

then4p opened this issue Nov 9, 2021 · 0 comments

Comments

@then4p
Copy link

then4p commented Nov 9, 2021

I built a test that looks like this:

def test_umlauts(self):
  dictionary_path = os.path.join(self.fortests_path, "umlaut_dict.txt")
  
  edit_distance_max = 1
  prefix_length = 5
  sym_spell = SymSpell(edit_distance_max, prefix_length)
  sym_spell.load_dictionary(dictionary_path, 0, 1)
  
  result = sym_spell.lookup("dämen", Verbosity.TOP, 2)
  self.assertEqual(1, len(result))
  self.assertEqual("damen", result[0].term)

With a dictionary that contains only this line: damen 1

However this test fails with edit_distance_max = 1 and passes with edit_distance_max = 2 even though there is only 1 character changed from dämen to damen

It seems like there is a bug so that umlauts like 'ä' are being interpreted as 'ae' or something like that?

If anyone has an idea where to look I'd gladly try to fix it but I haven't found anything yet.

@then4p then4p changed the title Umlauts need additionall edit distance Umlauts need additional edit distance Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant