简体   繁体   English

跨越不同平台的附魔词典

[英]Enchant dictionary across different platforms

Different results for enchant library (enchant 1.6.6) 附魔图书馆的不同结果(附魔1.6.6)

In MAC OSX 10.11.12 (El Capitan): 在MAC OSX 10.11.12(El Capitan)中:

>>> import enchant
>>> d = enchant.Dict("en_US")
>>> d.suggest("prfomnc")
['performance', 'prominence', 'preform', 'perform']

In Linux Ubuntu 14.04 LTS: 在Linux Ubuntu 14.04 LTS中:

>>> import enchant
>>> d = enchant.Dict("en_US")
>>> d.suggest("prfomnc")
['princedom', 'preferment', 'preform']

Any ideas why I get different results and other alternatives in NLTK for "suggest" functionality? 任何想法为什么我在NLTK中获得“建议”功能的不同结果和其他替代方案?


MAC OS 苹果系统

>>> enchant.list_dicts()
[('de_DE', <Enchant: Myspell Provider>), ('en_AU', <Enchant: Myspell Provider>), ('en_GB', <Enchant: Myspell Provider>), ('en_US', <Enchant: Myspell Provider>), ('fr_FR', <Enchant: Myspell Provider>)]

Ubuntu Ubuntu的

>>> enchant.list_dicts()
[('en', <Enchant: Aspell Provider>), ('en_CA', <Enchant: Aspell Provider>), ('en_GB', <Enchant: Aspell Provider>), ('en_US', <Enchant: Aspell Provider>), ('en_ZA', <Enchant: Myspell Provider>), ('en_AU', <Enchant: Myspell Provider>)]

In my Ubuntu tried: 在我的Ubuntu尝试过:

>>> b = enchant.Broker()
>>> b.set_ordering("en_US","myspell,aspell")
>>> b.set_ordering("*","aspell,myspell")
>>> b.request_dict("en_US").provider
<Enchant: Myspell Provider>
>>> b.request_dict("en_GB").provider
<Enchant: Aspell Provider>
>>> d.suggest("prfomnc")
['princedom', 'preferment', 'preform']

But still same results 但结果仍然相同

The enchant library is not a spell-correction library. enchant库不是拼写修正库。 Instead, it is an aggregator, searching for an interfacing with a variety of supported systems. 相反,它是一个聚合器,搜索与各种支持系统的接口。

From the documentation: 文档:

Enchant is capable of having multiple backends loaded at once. 附魔能够同时加载多个后端。 Currently, Enchant has 8 backends: 目前,Enchant有8个后端:

 Aspell/Pspell (intends to replace Ispell) Ispell (old as sin, could be interpreted as a defacto standard) MySpell/Hunspell (an OOo project, also used by Mozilla) Uspell (primarily Yiddish, Hebrew, and Eastern European languages - hosted in AbiWord's CVS under the module "uspell") Hspell (Hebrew) Zemberek (Turkish) Voikko (Finnish) AppleSpell (Mac OSX) 

Notice the last one? 注意最后一个?

I suspect, without expending any energy to confirm it, that you're getting different results because your MacOS system and your Linux system have different spelling software installed, or perhaps they have the same software installed but maybe they are in a different order in the searchpath used by enchant . 我怀疑,你没有花费任何精力来证实它,你得到的结果不同,因为你的MacOS系统和你的Linux系统安装了不同的拼写软件,或者他们可能安装了相同的软件,但也许它们的顺序不同enchant使用的搜索路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM