5

There are few dictionaries available for natural language processing. Like positive, negative words dictionaries etc.

Is there any dictionary available which contains list of synonym for all dictionary words?

Like for nice

synonyms: enjoyable, pleasant, pleasurable, agreeable, delightful, satisfying, gratifying, acceptable, to one's liking, entertaining, amusing, diverting, marvellous, good; 
user2129623
  • 2,167
  • 3
  • 35
  • 64

2 Answers2

10

Although WordNet is a good resource to start for finding synonym, one must note its limitations, here's an example with python API in NLTK library:

Firstly, words have multiple meanings (i.e. senses):

>>> from nltk.corpus import wordnet as wn
>>> wn.synsets('nice')
[Synset('nice.n.01'), Synset('nice.a.01'), Synset('decent.s.01'), Synset('nice.s.03'), Synset('dainty.s.04'), Synset('courteous.s.01')]

And to access the correct sense of a word, you will need to know the correct sense of a word given a context.

>>> wn.synset('nice.a.01').definition()
u'pleasant or pleasing or agreeable in nature or appearance'

You can try Word Sense Disambiguation software but they are not perfect (see Anyone know of some good Word Sense Disambiguation software?). Even if you know the sense of the word, the entries of wordnet are limited. You cannot expect much:

>>> wn.synset('nice.a.01').lemma_names()
[u'nice']
>>> wn.synset('nice.a.01').similar_tos()
[Synset('good.s.06'), Synset('pleasant.s.02')]
>>> [i.lemma_names() for i in wn.synset('nice.a.01').similar_tos()]
[[u'good'], [u'pleasant']]
Community
  • 1
  • 1
alvas
  • 115,346
  • 109
  • 446
  • 738
  • thanks. What I want is: for any given words/pharase, I want its synonym word/pharase in my application. I am working in PHP. Any further reference? – user2129623 May 18 '14 at 07:19
  • you can try crawling http://thesaurus.com/ but beware of the legal implications if you try to store a local copy of their data =) – alvas May 18 '14 at 10:01
  • No, that is not good solution. I want any offline database. like text dictionary file – user2129623 May 18 '14 at 10:44
  • so i guess, you have to pay for one or build one =( – alvas May 18 '14 at 11:16
  • do you know about wordnet(or other) api which gives synonym for words offline? possibly to be used in php – user2129623 May 21 '14 at 20:21
  • 1
    @programming_crazy, three are php api for wordnet: http://www.foxsurfer.com/wordnet/ – alvas May 21 '14 at 20:29
  • i worked on developing tools with wordnets (english and non-english) and getting synonyms automatically is no easy task. It either involves lots of machine learning or manual dictionary crafting. The latter is expensive and the former gives noisy output. Sooo, it's still considered a hard task in NLP. try googling for `paraphrase NLP` – alvas May 21 '14 at 20:37
2

"WordNet® is a large lexical database of English. Nouns, verbs, adjectives and adverbs are grouped into sets of cognitive synonyms (synsets), each expressing a distinct concept.": http://wordnet.princeton.edu/

Daniel Naber
  • 1,594
  • 12
  • 19
  • thanks. What I want is: for any given words/pharase, I want its synonym word/pharase in my application. I am working in PHP. Any further reference? – user2129623 May 18 '14 at 07:19