[Techtalk] Re: dict format
dominik.schramm at gmxpro.net
dominik.schramm at gmxpro.net
Sat Mar 20 20:36:09 EST 2004
Hi,
sorry, I lost the original email, that's why I'm replying to the
archive entry without a reference header.
Avery Ke wrote:
> As I said above, I often pull up a dozen or so words that match my
> text. It would be *much* easier to use this in dict, but I don't see
> a simple way to convert it.
>
> If anyone could give me tips on converting to dict form, I'd be
> thankful.
Has this already been answered?
Your question reminded me that I wanted to try this out some time,
too. And since I'm an Esperantist myself, I simply started with
the same dictionary. :-)
There are conversion programs available in the package dictfmt at
ftp://ftp.dict.org/pub/dict/
or as part of your Linux distro (at least Debian has it).
dictfmt is one of the aforementioned programs, and it accepts
dictionaries in the format (actually in some others as well, but I
didn't look further):
headword
definition (indented by one or more spaces or tabs)
I converted the file with the following perl script:
#!/usr/bin/perl
while (<STDIN>)
{
m/^([a-z]+)[ \t]*([-!?a-zA-Z])[ \t]*([-!?a-zA-Z])[ \t]*(.*)$/;
print "$1 ($2, $3)\n",
" $4\n";
}
Unfortunately so far it doesn't work, but this seems to be the way.
hope this helps
regards,
dominik
--
Dominik Schramm <dominik.schramm at gmxpro.net>
pgp key via http://www.cam.ac.uk.pgp.net/pgpnet/wwwkeys.html
More information about the Techtalk
mailing list