PROLOG and WordNet (3)

Source: Internet
Author: User
(9) The wn_at.pl file describes the attribute relationship between nouns and the synonym set of adjectives. An attribute is an entity feature described by a noun. Various attributes have various values and are described by adjectives. For example, the term size is an attribute and the value is little, small, big, large. The relationship between nouns and adjectives is defined by the predicate at: At (synset_id_1, synset_id_2 ). therefore, the entry at (Listen 322959,301148236 ). and at (Listen 322959,301149766 ). it is determined that weight is an attribute in synonym set 104322959 and is related to heavy in synonym set 301148236 and light in set 301149766. The attribute relationship between nouns and adjectives is at the semantic level. (10) wn_ant.plant is the abbreviation of antonus us. The wn_ant.pl file stores the antonyms of the two opposite groups. For example, natural object and artefact are a pair of antonyms. There are four predicates indicating the antsense relationship: ant (synset_id_1, w_num_1, synset_id_2, w_num_2 ). ant (synset_id_2, w_num_2, synset_id_1, w_num_1 ). synset_id_1 and w_num_1 point to a word. synset_id_2 and w_num_2 point to their antonyms. Assignees are mutual, literally because they involve two words, not two synonym sets. (11) the correct word in the wn_sa.pl file is in the relationship that one word supplements the information of the other word. This literal relationship exists only between verbs or between adjectives. There are four predicates for this relationship: SA (synset_id_2, w_num_2, synset_id_1, w_num_1). Let's first look at its application to verbs. The first two Parameters specify a verb, and the last two parameters define verb groups with similar meanings. A verb group consists of a verb and a prefix, and its meaning is different from that of the original verb. For example, give up is a verb group that indicates the meaning of stop, different from the original word give. SA (200001742,1, 200003768,3). SA (200001742,1, 200004389,3). Wherein, the Synonym Group 200001742 and number 1 specify the word breathe. The 3rd and 4th parameters are the phrases breathe out and breathe in. The given phrase only contains those that do not change the meaning of the original verb. For adjectives, the first two Parameters specify one adjective, the last two Parameters specify another adjective, and the latter describes the former. If the synonym set has only one adjective, the word number w_num is 0. For example, the synonym set 300012315 has only one abstract word. Therefore, the predicate SA (300012315,0, 302319830,0 ). SA (300012315,0, 301928363,0 ). represents the invisible words in the collection 302319830 and the abstract words in the collection 301928363. (12) wn_ppl.pl predicate ppl indicates the word segmentation relationship between the verb and the adverbs. The current Word Segmentation and past word segmentation are used to describe the tense. Because the information stored in WordNet does not differentiate the tense, the predicate ppl describes the word segmentation relationship between verb-adverbs. Add-ing at the end of the verb to represent the current word segmentation. For example, in the phrase a walking person, the verb walk becomes the adjective walking. Add-ed to the end of the word to represent the past word segmentation. For example, the stressed person and the adjective stressed are changed by the verb stress. This predicate has four parameters: PPL (synset_id_1, w_num_1, synset_id_2, w_num _). The last two parameters point to the verb, and the first two parameters determine the relevant adjectives. This relationship is literal. (13) wn_per.pl predicate per/4 indicates the subordination between two words. Per (synset_id_1, w_num_1, synset_id_2, w_num_2). The first two Parameters specify 1st words, which are adjectives or adverbs. If it is an adjective, the first 2nd words must be a noun or another adjective. Therefore, the original adjective belongs to this noun or the second adjective. For example, the first word is weekly, which belongs to the term Week. Or transatlantic belongs to the Atlantic. If the first two parameters represent an adverbs, the first 2nd words are the adjectives produced by them. For example, the adverbs "essential" are generated in the adjective "essential. (14) wn_fr.pl is the last Prolog database file. It provides a general statement framework for verbs in the same set. The predicate is FR (synset_id, f_num, w_num). The 1st parameters indicate the synonym set of the relevant verb. The first parameter specifies a word by number. If the value is 0, it applies to all words in the set. 2nd the form parameter specifies the statement framework applicable to the verb. Unfortunately, the prolog database does not provide any information about the statement framework. Therefore, this predicate is useless. You should query the WordNet document (fellbaum et al. 2003d) to find the statement corresponding to f_num. In the software package included in this article, I put a file wn_sen.pl, which should be used as the original WordNet file. Then, the predicate Sen (short for sentence) is added ). Sen (f_num, string_1, string_2). The form parameter string_1 is the statement part before the detected verb, and string_2 is the statement part after the verb. For example, if prefer is the only word in the synonym set 201433968 and queries fr_wn.pl, we get the predicate FR (,15, 0). Therefore, we know that there is only one verb in this set and the number is 15. Then, we can query the new predicates. From Sen (15, 'somebody','s something to somebody'), we can find that the verb prefer uses "Somebody prefers something to somebody ". To test the predicates fr/3 and Sen/3, you can run the following programs. Of course, you must first run the consult command to load the wn_s.pl, wn_fr.pl and wn_sen.pl files into the memory. % Predicate sentence_frame (+ verb) % takes "atom" as the parameter. It should be a verb and print the statement sentence_frame (verb):-s (Num, w_num, verb, V, _, _), FR (Num, f_num, w_num), Sen (f_num, string_1, string_2), write (string_1), write (verb ), write (string_2), NL. sentence_frame (verb):-s (Num, _, verb, V, _, _), FR (Num, f_num, 0), Sen (f_num, string_1, string_2 ), write (string_1), write (verb), write (string_2), NL. the predicate sentence_frame/1 identifies its synonym set from the input verb through S/6, and then queries the predicate. Fr/3. After w_num is matched, query sen/3 to obtain the context string of the verb and print it. If w_num fails to match, it is traced back to the second clause of sentence_frame/1. At this time, the value of w_num is 0, that is, there is only one context between the verbs in the set and printed them. Example :? -Sentence_frame ('prefer '). Somebody prefers something .? -Sentence_frame ('Walk '). Somebody walks .? -Sentence_frame ('give'). Somebody gives somebody something.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.