Learning the syntax

drupal_add_js("misc/clips-turorial.js");
?>

Learning the CLIPS syntax

You can now try experiment writing simple WSD rules using CLIPS. Please write the statements in the text box in the form. This will generate the CLIPS code in the 4th coloumn. Notice the syntax of CLIPS.

The form is divided in to two parts.

  • First part has simple facts about the rule
  • Second part contains the frame for writing conditions.
























Simple(General) Facts

Rule-Id














Saliency














Root/Word














Sentence Type













Conditions

Related

This condition is given when you feel that a particular sense is indicated because the word to be translated has a particular grammatical relationship with another word in the sentence. For instance, when the word 'catch', which is a verb, has a concrete object, it has the sense of पकड (as in 'I want to catch the ball.'); whereas when it has an object like 'sleep' it has the sense of 'ल' (as in 'Catch some sleep if you can.'). You will find that grammatical relatedness will account for larger number of senses than the other options listed in the menu for this item.

The frame have two text boxes and each text box will have a drop-down menu. 
If ........ is ..... and it has ....... as its ....... 
For instance: 
if catch is क्रिया and it has sleep as its object 















If







is




'




And it has




As
its














Explanation

(id-root ?word1 "word1") :


(id-root ?word2 "word2") :
"id-root" is the binary relation.(i.e the first part is "id" of the word and second part is the "root" form of the word.). In the first line "id" is "?word1" and root is "your word1" and in the second line "id" is "?word2" and "root" is "your word2".
(relation1-relation2 ?word1 ?word2)
The relation between two words having id "?word1" and "?word2" is the "relation1-relation2". The relation1 and relation2 are separated by a "-" hyphen. The underscores in relation1 or relation2 are the part of the relation. The underscores are given for making the whole name a single unit. For e.g "det_विशेषण" is a single relation which states, it is a विशेषण of "det" type).

Semantic

The possible semantic properties of a word, e.g., concrete, abstract, animate,inanimate, human, male, female etc.

For instance, in the following sentences:

The hut does not afford protection from the elements. 
The seat afforded her a good view of the stage. 

If 'afford' is the word for which we have to frame a rule. The default meaning of afford is 'समर्थ/हैसियत' which does not seem to be the sense in which the word is used in the above sentences. Instead, we get a sense of 'give':'द'.If we think this sense is triggered by the fact that the subject of the verb 'afford' has the semantic property 'inanimate', then our 'if...' statement will be

if afford is क्रिया and it has ?noun as its subject 
and
if ?noun has the semantic property inanimate. 

Note:The symbol '?' indicates that the entity following it is variable, i.e., it can be 'any' item from the category mentioned. In the above sentences, for example, first we state that the verb has 'any or ?' noun as its subject. Then in the next step we go on to give specific characteristics of the ?noun because we want to say that it is not enough to have any noun as the subject but it is the nature of the noun (here, the semantic property of being 'inanimate') that triggers the particular sense of 'द' for afford word.












If







has the semantic property




'










Explanation

(id-word ?semantic_id yourword&:(gdbm_lookup_p "youlist.gdbm" your word))

In the above syntax "id-word" is the binary relation. "?semantic_id" is the unique id of the word and "yourword&:(gdbm_lookup_p "youlist.gdbm" your word)". is the syntax for looking up "your word" in the given semantic list.

Category

The drop-down menu consists of grammatical categories like noun, verb, adjective,
adverb etc.

You may need to use this option when dealing with sentences like the following:

  1. There is a marked improvement in her performance.
  2. The manager marked the files he needed for the meeting.

In (1) marked is an adjective and its Hindi meaning would be "उल्लेखनीय" whereas in (2)
it is a verb and would mean "चिह्नित_कर" . If we take (2) as the default sense, then our
'if...' statement for the sense "उल्लेखनीय" will be the following:

if marked is an adjective...











If







is an














Explanation

(id-cat_coarse ?id category)
Here the relation is id-cat_coarse. Hence ?id is the word id and "category" is the pos(part of speech) category of the given word.

List

In this option one can make a list of words that may be associated with our word and
trigger a particular sense of a word.

For instance,
The default sense of 'switch on', which is a verb, is चलाना but when it has words like
'lamp, tube light, bulb...'
as its object, its Hindi meaning will be जलाना .
Our 'if-statement' will be

        if switch-on is क्रिया and it has ?noun as its object
        and
        if ?noun belongs to the list 'lamp, tube light, bulb...'.











If







belongs to list


















Explanation

(id-root "your-word" word1|word2|word3...)

Here the relation is id-root. Hence ?id is the word id and "word1|word2|word3" is the list of the words.
The relation can be id-word instead of id-root, where instead of root form , you can give the word form as a list.

form input

Root/Word