有没有人有任何经验如何使用python确定文本的语言?在python中是否有可用的模块?
我已经尝试过谷歌应用程序(http://ajax.googleapis.com/ajax/services/language/detect),它运行正常,但我不能长期使用它来加载大量文本文件.
乡亲
有人可以在这里说清楚
这个脚本:
use strict;
use BerkeleyDB;
my $filename = "/tmp/test" ;
unlink $filename ;
tie my %h, "BerkeleyDB::Hash", -Filename => $filename,-Flags => DB_CREATE or die
"Cannot open file $filename: $! $BerkeleyDB::Error\n" ;
$h{id1}{11111}{red}{2222}{3333}=1;
$h{id1}{11111}{red}{2222}{223}=1;
print "$h{id1}{11111}{red}{2222}{3333}";
untie %h ;
Run Code Online (Sandbox Code Playgroud)
删除警报:"不能使用字符串("HASH(0x822e638)")作为HASH引用,而在"./ber2.pl第17行使用"严格引用".
第17行是:$ h {id1} {11111} {red} {2222} {223} = 1;
这有什么问题?
如果我在没有Berkeley的情况下运行脚本它就像一个魅力,但我需要使用数据库,因为我有内存问题
请帮忙