how to print all terms inside a synset

12 views
Skip to first unread message

Mohanad abu baker

unread,
Aug 12, 2018, 8:46:21 PM8/12/18
to HyperGraphDB
Hi all,
I need to print the terms inside a synset and then print the frequency of each synset(the number before the synset in wordnet)
I have the following code

public static void main(String[] args) {

HGConfiguration config = new HGConfiguration();


config.setTransactional(false);


String wordnetDB = "c:/hypergraphdb1";


HyperGraph graph = HGEnvironment.get(wordnetDB,config);


WNGraph wngraph = new WNGraph(graph);


HGHandle LoveLemma = wngraph.findWord("car");


HGHandle RomanceLemma = wngraph.findWord("emotion");


List<HGHandle> syn = wngraph.getNounSenses(LoveLemma);


List<HGHandle> syn2 = wngraph.getNounSenses(RomanceLemma);


for(int i = 0; i < syn.size(); i++) {


System.out.println(graph.get(syn.get(i)).toString());


}

}




I get this result



Noun(a conveyance for passengers or freight on a cable railway; "they took a cable car to the top of the mountain")


Noun(a wheeled vehicle adapted to the rails of railroad; "three cars had jumped the rails")


Noun(where passengers ride up and down; "the car was on the top floor")


Noun(a motor vehicle with four wheels; usually propelled by an internal combustion engine; "he needs a car to get to work")


Noun(the compartment that is suspended from an airship and that carries personnel and the cargo and the power plant)



I need to print the terms inside each synset????

Regards,



Borislav Iordanov

unread,
Aug 16, 2018, 2:33:00 PM8/16/18
to hyperg...@googlegroups.com
Hi,

To print the terms inside each synset, you have to tokenize it yourself - it’s a free form text.

The frequency of a synset? Frequency in what corpus? I don’t know of any frequency being associated with a synset in the wordnet database.

If you want to compute the frequency of a term (a word in English) inside the corpus consisting of all synset glosses in WordNet, you should write a program to scan them, tokenize them and do the counting. It is not part of the database. 

Cheers,
Boris

--
You received this message because you are subscribed to the Google Groups "HyperGraphDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hypergraphdb...@googlegroups.com.
To post to this group, send email to hyperg...@googlegroups.com.
Visit this group at https://groups.google.com/group/hypergraphdb.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages