LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-20-2006, 03:16 AM   #1
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 64

Rep: Reputation: 15
How do I remove words from ispell dictionary.hash?


I have ispell installed on my Suse server with British English dictionaries. I want to remove the profanity from them - it's for young children.

I can download the 2.1MB englishxlg.hash file to my Mac, open it in textedit and spot the words, but when I simply cut them and replace the file on the server, I get 'wrong format' errors.

Looking at the man page for ispell, it seems I have to have a plain text word list which I then format as a hash file.

Can I edit > reformat the .hash file instead?

Is there a tool which I can use to edit the dictionary directly? E.g. adding/removing single/bulk words.
 
Old 04-20-2006, 05:55 AM   #2
geokker
Member
 
Registered: Jun 2004
Distribution: Ubuntu 6.10 Edgy Eft
Posts: 64

Original Poster
Rep: Reputation: 15
I've worked it out.

You cannot edit .hash files directly.

Instead,

1. Get a wordlist from somewhere - I found a British spelling wordlist text file from Google (one word per line).

2. Edit the list to your liking.

3. make copies of your existing .aff and .hash files.

4. run in the ispell dir: buildhash wordlist.txt current.aff current.hash

you'll see a bunch off nonsense scroll over the screen for a bit then when returned to the prompt, you're done.

I had an issue where I edited the wordlist.txt on a Mac in Textedit. When i transferred the file to the server, there were control-M's (^M) at the end of each line. I got rid of these with:

cat copy_of_wordlist.txt | col -b > wordlist.txt

So now, I can add/remove words from the system dictionary easily.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using hash value as key for other hash in Perl scuzzman Programming 6 02-14-2006 06:08 PM
ispell - remove word from dictionary? TangentSpace Linux - Software 0 10-19-2005 04:04 PM
Search and Replace: Asian Words to English Words ieeestd802 Linux - Software 0 10-27-2004 08:48 PM
edit words in aspell dictionary legolin Linux - Software 2 10-15-2004 07:22 AM
ispell on slackware? /usr/dict/words : no such device doublefailure Slackware 4 03-12-2003 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration