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

the frequency in the loaded dictionary is absolute, not relative #143

Open
Rigonz opened this issue Apr 21, 2023 · 0 comments
Open

the frequency in the loaded dictionary is absolute, not relative #143

Rigonz opened this issue Apr 21, 2023 · 0 comments

Comments

@Rigonz
Copy link

Rigonz commented Apr 21, 2023

Although the examples included in the documentation show absolute frequencies (counts, integers), frequencies can also be expressed in relative form, as a ratio, and then are of type float.
If the dictionary is loaded with relative frequencies, the load_dictionary returns True, but the calls to lookup do not actually work. In fact, the dictionary is not loaded (more precisely: it is empty as shown by a print(list(islice(sym_spell.words.items(), 5)))).
If this issue is related to the type of the frequency data, as I think, then I suggest that it is more clearly indicated in the documentation that the frequencies must be of type integer. It is true that the documentation of the load_dictionary states that the dictionary is a file of word/frequency count pairs , but still my suggestion is that this data type requirement is emphasized.
Alternatively, the loader could be made to convert the frequencies from relative to absolute form.

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