英语词典为txt或xml文件,支持同义词

Sim*_*mon 19 dictionary nlp wordnet

有人能指出我可以将英文字典下载为txt或xml文件.我正在为自己构建一个简单的应用程序,并寻找可以立即开始使用的东西,而无需学习复杂的API.

对同义词的支持会很棒,也就是说检索特定单词的所有同义词应该更容易.

如果字典列出英国和美国拼写的单词,那将是绝对精彩的.

即使它是小字典(几千字)也没关系,我只需要一个小项目.

如果价格合理,我甚至愿意买一个,字典很容易使用 - 简单的XML会很棒.

任何方向请.

dmc*_*cer 16

WordNet就是你想要的.它很大,包含超过十万个条目,并且它是免费提供的.

但是,它不是以XML格式存储的.要访问数据,您需要使用现有的WordNet API之一作为您选择的语言.

使用API​​通常非常简单,所以我认为你不必担心"学习(a)复杂的API".例如,借用WordNet如何使用基于Python的自然语言工具包(NLTK):

 >>> from nltk.corpus import wordnet
 >>> 
 >>> # Get All Synsets for 'dog'
 >>> # This is essentially all senses of the word in the db
 >>> wordnet.synsets('dog')
 [Synset('dog.n.01'), Synset('frump.n.01'), Synset('dog.n.03'), 
  Synset('cad.n.01'), Synset('frank.n.02'),Synset('pawl.n.01'), 
  Synset('andiron.n.01'), Synset('chase.v.01')]

 >>> # Get the definition and usage for the first synset
 >>> wn.synset('dog.n.01').definition
 'a member of the genus Canis (probably descended from the common 
 wolf) that has been domesticated by man since prehistoric times; 
 occurs in many breeds'
 >>> wn.synset('dog.n.01').examples
 ['the dog barked all night']

 >>> # Get antonyms for 'good'
 >>> wordnet.synset('good.a.01').lemmas[0].antonyms()
 [Lemma('bad.a.01.bad')]

 >>> # Get synonyms for the first noun sense of 'dog'
 >>> wordnet.synset('dog.n.01').lemmas
 [Lemma('dog.n.01.dog'), Lemma('dog.n.01.domestic_dog'), 
 Lemma('dog.n.01.Canis_familiaris')]

 >>> # Get synonyms for all senses of 'dog'
 >>> for synset in wordnet.synsets('dog'): print synset.lemmas
 [Lemma('dog.n.01.dog'), Lemma('dog.n.01.domestic_dog'), 
 Lemma('dog.n.01.Canis_familiaris')]
 ...
 [Lemma('frank.n.02.frank'), Lemma('frank.n.02.frankfurter'), 
 ...
Run Code Online (Sandbox Code Playgroud)

虽然WordNet中存在美国英语偏见,但它支持英国拼写和使用.例如,您可以查找"颜色",其中一个"提升"的同义词是"elevator.n.01".

关于XML的说明

如果将数据表示为XML是必不可少的,您可以轻松地使用其中一个API访问WordNet数据库并将其转换为XML,例如,请参阅Thinking XML:将WordNet作为XML查询.

  • 如果您更喜欢原始 xml,Guy Lapalme(蒙特利尔大学)[已经完成了这项工作](http://www.iro.umontreal.ca/~lapalme/WordNet-XML/) (2认同)

pc_*_*pc_ 8

我知道这个问题已经很老了但是我自己发现这是一个txt文件的问题,所以如果有人会查找同义词和反义词txt文件数据库最简单但非常详细的尝试 https://ia801407.us.archive.org/ 10/items/synonymsantonyms00ordwiala/synonymsantonyms00ordwiala_djvu.txt.


has*_*ble 6

我过去使用过Roget 的同义词库。它具有纯文本文件中的同义词信息。还有一些java代码可以帮助您解析文本。

这些页面提供了大量同义词库/词汇资源的链接,其中一些可以免费下载。

http://www.w3.org/2001/sw/Europe/reports/thes/thes_links.html

http://www-a2k.is.tokushima-u.ac.jp/member/kita/NLP/lex.html


Mar*_*ald 3

尝试WordNet