Sample Header Ad - 728x90

Multiple private ispell dictionaries

0 votes
1 answer
83 views
I have an application where I want to use ispell and have it use a dictionary constructed from three inputs: - The default language dictionary (in my case English, provided by the system). - A manually curated word list (asking ispell to "insert" a word should add to this). - A dynamically generated list of works. Importantly, the last source will be regenerated on a regular basis, adding and **removing** words which may or may not be in either of the other two sources. - Is there any way to do that will ispell? - Is there any way to do it with an alternative spell checking that has a similar feature set? --- I can sort of fake things by generating a per-use dictionary: ispell -p <(cat local.dict dynamic.dict | sort -u) $FILE But this doesn't work once I need to add a new word to local.dict: ispell has no way to find the original file and thus clearly can't modify it. What I'd hoped would work is to be able to pass multiple -p ispell -p local.dict -p dynamic.dict $FILE But it seems only the last one is even noticed. I've even tried exploiting the fact ispell will use a merge of both $PWD/.ispell_words and $HOME/.ispell_words (which would require overriding $HOME). That actually works for the most part, but it seems that when adding new words, ispell write out the **merged** dictionary with the result that it copies everything from the current dynamic dictionary to the permanent static one. --- At this point I'm starting to consider things like merging the English dictionary and the custom one into a temp file and passing that via -d. But that sort of thing seems to be an invitation for endless issues, like how to reliably find the dictionary in the first place?
Asked by BCS (101 rep)
Dec 5, 2021, 05:26 AM
Last activity: Dec 5, 2021, 05:59 AM