360 likes | 474 Views
LING 581: Advanced Computational Linguistics. Lecture Notes April 6th. WordNet::QueryData. sudp cpan cpan[1]> install WordNet::QueryData perldoc WordNet::QueryData. WordNet::QueryData. t .perl : use WordNet::QueryData ; my $ wn = WordNet::QueryData ->new( noload => 1 );
E N D
LING 581: Advanced Computational Linguistics Lecture Notes April 6th
WordNet::QueryData • sudpcpan • cpan[1]> install WordNet::QueryData • perldocWordNet::QueryData
WordNet::QueryData • t.perl: use WordNet::QueryData; my $wn = WordNet::QueryData->new( noload => 1 ); print "Synset: ", join(", ", $wn->querySense("cat#n#7", "syns")), "\n"; • perlt.perl Synset: big_cat#n#1, cat#n#7 index caching off
WordNet::QueryData • Documentation • Query functions • ’querySense’ and ’queryWord’. • Both functions take as their first argument a query string that takes • one of three types: • (1) word (e.g. "dog") • (2) word#pos (e.g. "house#n") • (3) word#pos#sense (e.g. "ghostly#a#1”) • queryWord accesses lexical (word to word) relations. • also − also see • ants − antonyms • deri − derived forms (nouns and verbs only) • part − participle of verb (adjectives only) • pert − pertainym (pertains to noun) (adjectives only) • vgrp − verb group (verbs only) • WordNet Relations • http://wordnet.princeton.edu/wordnet/man/wninput.5WN.html • querySense accesses semantic (sense to sense) relations; • also − also see • glos − word definition • syns − synset words • hype − hypernyms • inst − instance of • hypes − hypernyms and "instance of” • hypo − hyponyms • hasi − has instance • hypos − hyponums and "has instance" • mmem − member meronyms • msub − substance meronyms • mprt − part meronyms • mero − all meronyms • hmem − member holonyms • hsub − substance holonyms • hprt − part holonyms • holo − all holonyms • attr − attributes (?) • sim − similar to (adjectives only) • enta − entailment (verbs only) • caus − cause (verbs only) • domn − domain − all • dmnc − domain − category • dmnu − domain − usage • dmnr − domain − region • domt − member of domain − all (nouns only) • dmtc − member of domain − category (nouns only) • dmtu − member of domain − usage (nouns only) • dmtr − member of domain − region (nouns only)
WordNet::Similarity • cpan[2]> install WordNet::Similarity