Conversation
- Add regression tests to ensure current behavior is respected, and prevent future breakings. - [Kobo] Variants from different prefix groups were ignored (like in FR with "suis" which is a variant of "être"). As the device will ignore variants from different prefix group, I deleted the code to simplify the logic. It seems harlmess. - Fix variants pointing to an empty word itself pointing to another variant (only 1 level supported). - Variants are passed as a list of `str` to templates, allowing to merge the code for Kobo & DictFile formats. - Variants special cases are now also made available to DictFile, and its sub-formats. - The code to handle variants is greatly simplified now. - Removed the no more used `Word.empty()`.
| for variant in details.variants: | ||
| if root_details := self.words.get(variant): | ||
| variants_words[variant] = root_details | ||
| if word.endswith("s"): # crude detection of plural |
There was a problem hiding this comment.
Since our variants "detectors" are way better now, this hack is no more useful. Given the complexity of the variants code, I prefer to delete that piece.
Now that I think more about this, it might be better to do pollute dicts with useless data (they already are quite big). |
- simplify `handle_word()` - unrelated to this PR: fix off-by-one check for unicode ranges in .mobi
|
At the end, I mostly added more comments to your code @lasconic, thanks for the primary work :) |
strto templates, allowing to merge the code for Kobo & DictFile formats.Word.empty().Related to #2379.