mideind / GreynirEngine

A fast, efficient natural language processing engine for Icelandic.
https://greynir.is
Other
60 stars 10 forks source link

NounPhrase class returns a wrong word #33

Closed kristjanmik closed 4 years ago

kristjanmik commented 4 years ago

Thank you for the great project!

While using the python package, I ran into a bug with a wrong word being returned. The nominative case of Þór in "Ragnar Þór Valgeirsson" is wrong when using a NounPhrase.

How to reproduce

greynir_bug.py

from reynir import NounPhrase as Nl

nafn = Nl("Ragnar Þór Valgeirsson")

print(f"{nafn:nf}")

Results after executing ten times

for i in {1..10}; do python greynir_bug.py; done

Ragnar Þórr Valgeirsson Ragnar Þórr Valgeirsson Ragnar Þór Valgeirsson Ragnar Þórr Valgeirsson Ragnar Þórr Valgeirsson Ragnar Þór Valgeirsson Ragnar Þórr Valgeirsson Ragnar Þór Valgeirsson Ragnar Þór Valgeirsson Ragnar Þórr Valgeirsson

vthorsteinsson commented 4 years ago

Thanks for this! A commit fixing this is upcoming - it involves an addition to the config/Prefs.conf file. The fix will then be included in the next release.