Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
83
views
Multiple private ispell dictionaries
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...
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?
BCS
(101 rep)
Dec 5, 2021, 05:26 AM
• Last activity: Dec 5, 2021, 05:59 AM
4
votes
1
answers
970
views
Customize flyspell (ispell) dictionary
I know how to add custom words to ispell, but I would like to remove certain words from the dictionary. For example, although `ass` and `asses` are correct words, I rarely type them, and would like to flag them as likely typos to `as` and `assess`. Where does ispell store its dictionary? The man pag...
I know how to add custom words to ispell, but I would like to remove certain words from the dictionary. For example, although
ass
and asses
are correct words, I rarely type them, and would like to flag them as likely typos to as
and assess
.
Where does ispell store its dictionary? The man page does not provide the location. Also, the man page makes it seem like there are a lot of steps to build a new dictionary, and it isn't just an ASCII file where I can remove certain words. Any advice how to build a new dictionary without a given word?
**Edit**
From some hints on: http://docstore.mik.ua/orelly/unix/upt/ch29_05.htm
It seems like I can start with /usr/share/dict/words, remove the words I don't want, and then make a new ispell dictionary from that. However, I'm having trouble making the new dictionary. buildhash
is the key program here, but it wants an affixfile, and I do not know how to generate that file.
mankoff
(295 rep)
Mar 6, 2014, 01:34 PM
• Last activity: Jan 15, 2019, 09:33 AM
1
votes
0
answers
55
views
How do I create a custom ispell affix file to stub -isms and -ists?
I want to create an ispell stubber such that, echo communism | ispell -c echo communist | ispell -c echo communists | ispell -c All return the same thing. I'm making a website based on ideology, and I'm trying to create a more intelligent tagging system.
I want to create an ispell stubber such that,
echo communism | ispell -c
echo communist | ispell -c
echo communists | ispell -c
All return the same thing. I'm making a website based on ideology, and I'm trying to create a more intelligent tagging system.
Evan Carroll
(34663 rep)
May 17, 2016, 02:52 AM
• Last activity: May 19, 2016, 12:10 AM
Showing page 1 of 3 total questions