Noun Synonyms in WordNet

I want to use tkenfilter synonym in Elasticsearch for index. I downloaded the Prolog version of WordNet 3.0 and found a wn_s.pl file that wn_s.pl can understand. However, it seems that the file contains synonyms for all kinds of words and phrases, while I'm really only interested in supporting synonyms for nouns. Is there any way to extract these entries?

+4
source share
1 answer

Given that the format of wn_s.pl is equal to

 s(112947045,1,'usance',n,1,0). s(200001742,1,'breathe',v,1,25). 

A very crude way to do this would be to do the following in your terminal only to take lines from this file with the line ", n".

 grep ",n," wn_s.pl > wn_s_nouns_only.pl 

The wn_s_nouns_only.pl file will contain only those entries that are marked as nouns.

+8
source

Source: https://habr.com/ru/post/1493875/


All Articles