Subject: | CEDICT parsing |
Date: | Mon, 15 Mar 2010 10:42:06 +0100 |
To: | bug-Lingua-ZH-CEDICT [...] rt.cpan.org |
From: | Koen De Vleeschauwer <kdv [...] kdvelectronics.eu> |
Thanks. Lingua-ZH-CEDICT is just what I needed to be able to make my
HSK flashcards.
regards,
koen
Patch to parse latest CEDICT:
21:Downloads koen$ diff -cr Lingua-ZH-CEDICT-0.04/lib Lingua-ZH-
CEDICT-0.04.OK/lib
Only in Lingua-ZH-CEDICT-0.04.OK/lib/Lingua/ZH/CEDICT: CEDICT.store
diff -cr Lingua-ZH-CEDICT-0.04/lib/Lingua/ZH/CEDICT/Textfile.pm Lingua-
ZH-CEDICT-0.04.OK/lib/Lingua/ZH/CEDICT/Textfile.pm
*** Lingua-ZH-CEDICT-0.04/lib/Lingua/ZH/CEDICT/Textfile.pm Sat May 7
02:52:36 2005
--- Lingua-ZH-CEDICT-0.04.OK/lib/Lingua/ZH/CEDICT/Textfile.pm Sun Mar
14 09:40:25 2010
***************
*** 45,51 ****
next unless /\w/;
$_ = $iconv->convert($_) if defined $iconv;
! m|^(\S+)\s(\S+)\s\[([a-z0-9: ]+)\]\s/(.*)/\s*$| or
# m|^(\S+\|\S*)\s\[([a-z0-9: ]+)\]\s/(.*)/\s*$| or
die "Line $.: Invalid entry '$_'\n";
# my @zi = split /\|/, $1;
--- 45,51 ----
next unless /\w/;
$_ = $iconv->convert($_) if defined $iconv;
! m|^(\S+)\s(\S+)\s\[([A-Za-z0-9,ยท: ]+)\]\s/(.*)/\s*$| or
# m|^(\S+\|\S*)\s\[([a-z0-9: ]+)\]\s/(.*)/\s*$| or
die "Line $.: Invalid entry '$_'\n";
# my @zi = split /\|/, $1;
21:Downloads koen$