Bug 151914 - Allow to add / edit words with tags in custom dictionaries
Summary: Allow to add / edit words with tags in custom dictionaries
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
(earliest affected)
3.3.0 release
Hardware: All All
: low enhancement
Assignee: Not Assigned
: 157449 (view as bug list)
Depends on:
Blocks: Spell-Checking Dictionaries
  Show dependency treegraph
Reported: 2022-11-05 03:34 UTC by Shantanu
Modified: 2024-06-14 18:30 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Shantanu 2022-11-05 03:34:53 UTC
I can right click and add a word to custom dictionary. But tags are not allowed.

Steps to Reproduce:
1) Type Anna and spell check using English USA dictionary. There is no mistake. 
2) Type Anna's and there is no mistake either. 
3) Type Annas and it is considered incorrect. I can right click and add it custom dictionary. ""But tags are not allowed.""

Actual Results:
Word Annas is considered incorrect.

Expected Results:
Word Annas should be considered correct if I add Anna/MS in custom dict.

Reproducible: Always

User Profile Reset: No

Additional Info:
Let's assume this word is already there in the dict file.

I will like to change the entry to this:

I should be able to add this new entry in custom dictionary "with tags" that will overwrite the current word (if already present).
Comment 1 Rafael Lima 2022-11-05 20:20:23 UTC
In other words, you would like to edit the "raw" dictionary info related to the word?
Comment 2 Shantanu 2022-11-06 05:29:53 UTC
Yes. I am looking for a way to edit raw dictionary. This will be useful for non-english languages where not all words are added or their tags are wrong. In case of Asian Languages a single tag can replace hundreds of words in my custom dictionary.
Comment 3 Heiko Tietze 2022-11-09 10:06:14 UTC
The request to manipulate user dictionaries makes sense. I'd expect edit, delete, import, export functions. However, experienced users can access the dictionary at <.config>/libreoffice/4/user/wordbook. And ultimately kind of duplicate to bug 151625.

Regarding "tags" I don't know what this exactly means (guess some markup language) and whether we support this (the dictionary is plain text). => needsDevEval
Comment 4 Shantanu 2022-11-10 04:48:26 UTC
The dictionary is not just a list of words saved in a text file. Most of the words are followed by slash / and then a tag. For e.g. party/S would produce: parties, boy/S would produce: boys etc. You can read more about it here...


You can add words like "party" or "boy" in custom dictionary. But not with tags like "party/S". You can however add "party" AND "parties". But in case of non-english languages there are hundreds of words those are generated using tags. It is very difficult to add all of them in custom dictionary (that has a limit of 30000 words).
Comment 5 sophie 2022-11-10 13:46:11 UTC
I guess this is why the directory is called wordbook and not dictionary, it's only a collection of word with no suffix or prefix. This would be an interesting addition :)
Comment 6 Stéphane Guillou (stragu) 2023-10-10 13:18:22 UTC
*** Bug 157449 has been marked as a duplicate of this bug. ***
Comment 7 László Németh 2024-06-03 21:52:46 UTC
Since LibreOffice 6.0, it's possible to specify a dictionary word for every custom word to allow affixation and compound word support:



Comment 8 Shantanu 2024-06-04 03:12:07 UTC
>> "crowdfund" is the new word (missing from the American English dictionary), and "fund" is the model word in the new "Grammar By" field.

This enhancement request suggest that please allow crowdfund/xy (assuming the original dict file has an entry like fund/xy)
Using hunspell tags directly in custom dict is very useful option for power-users. They do not need to guess the matching entry. If no tags are used then the user is free to use "Grammar By" option.
Comment 9 László Németh 2024-06-14 18:30:22 UTC
Hunspell dictionary files are simple text files, so it's possible to extend it with the requested words and affixes, according to its format, i.e. affix-compressed or not:

After affix compression, it's not possible to add a simple /MS to the .dic file, but it needs to use an existing affix class defined in the .aff file, or defining a new affix class there, and use its index in the .dic file.

With the suggested LibreOffice enhancement, it wouldn't be possible to change the dictionary with its affix-compressed version without breaking the (Hunspell format-dependent) user dictionary. The existing "Grammar By" feature is similar to the affix-compressed Hunspell dictionary format: it's based on an affix class, i.e. a flag sequence. The only difference, that its index is not a number, but a dictionary word with the requested affix class. "Grammar By" works both with plain and affix compressed Hunspell dictionaries, too, as intended.