简体   繁体   English

在java中查找单词的同义词和根

[英]Find synonym and root of a word in java

I am developing a JAVA application where user enters a word in textbox,the synonyms of the word has to be autoprompted to him. 我正在开发一个JAVA应用程序,用户在文本框中输入一个单词,该单词的同义词必须自动提供给他。

Given a word,is it possible to find its synonyms and its root in JAVA?should i use a dictionary? 有一个词,是否有可能在JAVA中找到它的同义词及其根?我应该使用字典吗?

eg: 例如:

word:   killer
synonym: murderer butcher hitman

word:   killing
root:   kill

一种选择是将WordNet与Java API一起使用,例如JAWS: http//lyle.smu.edu/~tspell/jaws

As for roots this process is called stemming (google for that). 至于根,这个过程称为词干(google for that)。 There are some (Java) libraries like that: http://snowball.tartarus.org/download.php 有一些(Java)库类似: http//snowball.tartarus.org/download.php

I would suggest looking for an API for a online site where you can access a synonym dictionary instead of having to build your own. 我建议为在线网站寻找一个API,您可以在其中访问同义词词典而不必构建自己的词典。 It will be large enough that you will not want to keep it in memory therefore you are going to have to have some external storage location if you are going to do it yourself. 它足够大,你不会想把它留在内存中,所以如果你打算自己做,你将不得不有一些外部存储位置。

你必须使用字典,至少对于同义词,因为JRE中没有标准的“同义词列表”。

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

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