Skip to content

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

@Rigonz

Description

@Rigonz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions