When a dictionary is initialized, a maximum number of words is assigned, by
default 4096 + number of words in init dic file.
When using ps_add_word, if that limit is reached, the memory allocated is
increased and the max number of words is also increased, but the word is not
added, and an error code is returned. If ps_add_word is called again, then the
word is added correctly.
I don't understand why it returns an error if the word can still be added once
memory allocation is done. Should ps_add_word (or maybe dict_add_word) be a
little be "smarter" and attempts adding the word again once more memory is
allocated?
Thanks a lot in advance,
Sylvain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Not sure whether this should be considered a bug.
When a dictionary is initialized, a maximum number of words is assigned, by
default 4096 + number of words in init dic file.
When using ps_add_word, if that limit is reached, the memory allocated is
increased and the max number of words is also increased, but the word is not
added, and an error code is returned. If ps_add_word is called again, then the
word is added correctly.
I don't understand why it returns an error if the word can still be added once
memory allocation is done. Should ps_add_word (or maybe dict_add_word) be a
little be "smarter" and attempts adding the word again once more memory is
allocated?
Thanks a lot in advance,
Sylvain
This is a bug which is fixed in trunk just now. Thanks for the report.