Subject: | 'Line N: Invalid Entry...' problem of Lingua::ZH::CEDICT::Textfile |
The regex used in Lingua::ZH::CEDICT::Textfile is inconsistent with the
latest cedict release (21 December 2005). A quick fix is attached.
$ tar zxvf Lingua-ZH-CEDICT-0.04.tar.gz
$ patch p0 < Lingua-ZH-CEDICT-0.04.patch
Subject: | Lingua-ZH-CEDICT-0.04.patch |
diff -Naur Lingua-ZH-CEDICT-0.04/lib/Lingua/ZH/CEDICT/Textfile.pm Lingua-ZH-CEDICT-0.04-fix/lib/Lingua/ZH/CEDICT/Textfile.pm
--- Lingua-ZH-CEDICT-0.04/lib/Lingua/ZH/CEDICT/Textfile.pm Sat May 7 08:52:36 2005
+++ Lingua-ZH-CEDICT-0.04-fix/lib/Lingua/ZH/CEDICT/Textfile.pm Fri Oct 13 17:49:48 2006
@@ -45,7 +45,7 @@
next unless /\w/;
$_ = $iconv->convert($_) if defined $iconv;
- m|^(\S+)\s(\S+)\s\[([a-z0-9: ]+)\]\s/(.*)/\s*$| or
+ 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;