Operating System - HP-UX
1837513 Members
3700 Online
110117 Solutions
New Discussion

Does anyone know how to dump into ascii the dictionary ?

 
Alan Wyskowski
Frequent Advisor

Does anyone know how to dump into ascii the dictionary ?

I'm trying to get the english dictionary into a flat file in ascii form.
The best I've been able to do is get it into hashcode.
Does anyone know how to get the /usr/share/dict/hlista into something readable. Thanks......
7 REPLIES 7
harry d brown jr
Honored Contributor

Re: Does anyone know how to dump into ascii the dictionary ?

Have you tried this:

cat /usr/share/dict/hlista | /usr/lbin/spell/hashcheck >tmp1

live free or die
harry

Live Free or Die
Alan Wyskowski
Frequent Advisor

Re: Does anyone know how to dump into ascii the dictionary ?

Yes, but that just gives me the words in number format. One per line. I haven't been able to convert that to ascii.
Alan Riggs
Honored Contributor

Re: Does anyone know how to dump into ascii the dictionary ?

That command only yields the hashed values. I don't know of any way to decode those hashed values back into text.
A. Clay Stephenson
Acclaimed Contributor

Re: Does anyone know how to dump into ascii the dictionary ?

Hi:

Since a hash is by definition a many (or at least a few) to one relationship what you are asking can't be done.
If it ain't broke, I can fix that.
Alan Wyskowski
Frequent Advisor

Re: Does anyone know how to dump into ascii the dictionary ?

You say it can't be done, how does spell do it then when it's looking up words in that file?
Thanks.
Frank Slootweg
Honored Contributor

Re: Does anyone know how to dump into ascii the dictionary ?

spell(1) is apparently a one way street.

I have found no 'official' references', but an unofficial one (our/HP reference DY012804 "Cannot extract words from spell dictionary") says:

[start quote:]
The hashmake command reduces words to 9 digit codes which can be placed in a binary hash table. This allows quick lookup, but makes it a one-way street. You can't go back & create words from the hash codes.
[end quote.]

[Perhaps this document is available in ITRC. I have not checked.]
Alan Wyskowski
Frequent Advisor

Re: Does anyone know how to dump into ascii the dictionary ?

Thanks everyone for the replies. This saves me countless hours of looking.