How do I create words.db from words.txt using gdbm?
I'm working on updating and fixing a broken Makefile to create the rhyming dictionary. [[Originally pub domain from CMU]] Thru surfing all over I finally found the three missing *.txt files. The makefile doesn't give the instructions on howto create the three database files. It dies instantly when it can't find the first one.
I'm using the source rather than a pre-built binary for two reasons.
One, I'm a wool-died hacker; two, I want to port this to the Berkeley Unix distros. Some lexicographer put in a lot of effort in getting this (command-line) tool updated. I'd like to finish the build work.
Sorry for posting here; wasn't sure exactly *where*... .
What sources are you using? I'm looking at the one in the Debian repo, and the db files are created by makedb. The source for this is included with the rhyme package, and is compiled and run by the makefile. The makefile is not broken, except for 'make test'. The db files are created from cmudict*, not the text files mentioned in the makefile.
880 -rw-r--r-- 1 kline 896013 2008-12-14 11:44 rhyme-0.9.tar.gz
that seems to be identical with the .zip file. Good to know that the cmudict stuff is used; unless there is an ``official'' Debian tarball, I'll untar this and give it a go.
Is makedb part of Ubuntu or do i need to fetch is? locate doesn't see it. I'll fess up further to not have done any programming on my Ubuntu desktop. (I did try "gcc x.c" when I was running the last LTS release and got some err output. Returned to my FreeBSD box.)
Be nice if this tarball just-worked, but then, you know how it goes, :-)
makedb is part of rhyme - you should see makedb.c and makedb.h in the tarball. This is from the tarball obtained by "apt-get source rhyme".
Yeo, apt-get got the source, untarred, etc. But same or similar gotchas as before. This time I understand more. gcc can't see my #include headers. Probably more.
So, if this is too far OT, please let me know. Time to learn how to build stuff with gcc and g++. At a min. Hopefully, it is push-button.
If not, I'll put up a new post.
What errors do you get? Do you have the gdbm dev library package installed?
main.c:5:22: error: readline.h: No such file or directory
main.c:6:21: error: history.h: No such file or directory
main.c: In function \xe2\x80\x98getWord\xe2\x80\x99:
main.c:15: warning: implicit declaration of function \xe2\x80\x98readline\xe2\x80\x99
main.c:15: warning: return makes pointer from integer without a cast
main.c:17: warning: return makes pointer from integer without a cast
main.c:19: warning: return makes pointer from integer without a cast
main.c: In function \xe2\x80\x98main\xe2\x80\x99:
main.c:36: warning: implicit declaration of function \xe2\x80\x98using_history\xe2\x80\x99
main.c:37: warning: implicit declaration of function \xe2\x80\x98rl_bind_key\xe2\x80\x99
main.c:37: error: \xe2\x80\x98rl_insert\xe2\x80\x99 undeclared (first use in this function)
main.c:37: error: (Each undeclared identifier is reported only once
main.c:37: error: for each function it appears in.)
main.c:54: warning: implicit declaration of function \xe2\x80\x98add_history\xe2\x80\x99
main.c:63: warning: implicit declaration of function \xe2\x80\x98clear_history\xe2\x80\x99
make: *** [rhyme] Error 1
Yep. Okay the hex triplets are the html "``" and "''"; I'm almost positive. This is fairly easy to resolve with tr or perl, &c.
Another thing is that the headers are just not seen. Note the first two lines. I also tried a dummy x.c with
gcc complained about not finding stdio.h in my first try. The second time, x.c compiled to a.out perfectly and printed a newline. Is is cpp that finds the header files? Or the linker?
cpp finds the header files, as they are compiled like all other source code.
The failure with headers is interesting, but do you actually have readline.h? (readline dev libraries)
thanks for your help!
|All times are GMT -5. The time now is 11:44 PM.|