cltl / OpenDutchWordnet

This repo provides a python module to work with Open Dutch WordNet. It was created using python 3.4.
Other
64 stars 15 forks source link

How do I obtain synonyms? #4

Open MartenPostma opened 8 years ago

MartenPostma commented 8 years ago

In order to get all synonyms from a lemma, simply call instance.les_lemma_synonyms(LEMMA). for example:

instance.les_lemma_synonyms('huis') {'behuizing', 'bouw', 'bouwen', 'bouwwerk', 'constructie', 'familie', 'gebouw', 'geslacht', 'heem', 'home', 'honk', 'huis', 'huisje', 'hulsel', 'kas', 'maagschap', 'omhulsel', 'omkleedsel', 'pand', 'perceel', 'staak', 'stam', 'tak', 'tehuis', 'thuis', 'woning', 'woongelegenheid', 'woonhuis', 'woonruimte'}

MartenPostma commented 8 years ago

In addition to that, we compiled a tsv synonyms file at: https://github.com/MartenPostma/OpenDutchWordnet/blob/master/synonyms.tsv

pmkruyen commented 8 years ago

Thanks! But which specific script do I need to run to call "instance.les...."? I tried to call it using the les.py script among others (in the powershell) but this script does not seem to do the job. Which one should I use?

MartenPostma commented 8 years ago

You first have to load the module as indicated in the README:

from OpenDutchWordnet import Wn_grid_parser

please check the attribute LICENSE before using this module

print(Wn_grid_parser.LICENSE)

the attribute 'odwn' stores the path to the most recent version

print(Wn_grid_parser.odwn)

example of how to use module

instance = Wn_grid_parser(Wn_grid_parser.odwn)

then you can use this method. Although, it's only tested on Mac Os X and Linux. So no garanties there. That is why I create the synonym file to be on the safe side.

pmkruyen commented 8 years ago

Thanks Marten, I tried and tried, but did not succeed in getting the module running (note, I guess it is wn instead of Wn). However the synonym file does the trick.