Thursday, July 19, 2012

Build a customized DICT database

Prepare the original word-definition pair file (foobar.txt) in the following format:
:foo:definition of foo
:bar:definition of bar
Create the database (.dict, .index) using dictfmt
dictfmt --utf8 --allchars -s "Foobar Dictionary" -j foobar < foobar.txt
Move to the proper folder, and restart the DICT server dictd
mv foobar.dict foobar.index /usr/share/dictd/
/usr/sbin/dictdconfig -—write
/etc/init.d/dictd restart
You may have DICT client dict to do such query
dict foo

No comments:

Post a Comment