[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
external:tectomt:tutorial [2009/01/21 00:44]
popel
external:tectomt:tutorial [2009/01/21 11:06]
kravalova
Line 288: Line 288:
 ==== Task ==== ==== Task ====
 A block which, given an analytical tree (''SEnglishA''), fills each ''a-node'' with boolean attribute ''is_clause_head'' which is set to ''1'' if the ''a-node'' corresponds to a finite verb, and to ''0'' otherwise. A block which, given an analytical tree (''SEnglishA''), fills each ''a-node'' with boolean attribute ''is_clause_head'' which is set to ''1'' if the ''a-node'' corresponds to a finite verb, and to ''0'' otherwise.
 +
  
  
Line 328: Line 329:
 You are going to need these methods: You are going to need these methods:
  
-  * ''my $root = $bundle->get_tree('tree_name')'' +  * ''my $root = $bundle<nowiki>-></nowiki>get_tree('tree_name')'' 
-  * ''my $attr = $node->get_attr('attr_name')'' +  * ''my $attr = $node<nowiki>-></nowiki>get_attr('attr_name')'' 
-  * ''$node->set_attr('attr_name',$attr_value)'' +  * ''$node<nowiki>-></nowiki>set_attr('attr_name',$attr_value)'' 
-  * ''my @eff_children = $node->get_eff_children()''+  * ''my @eff_children = $node<nowiki>-></nowiki>get_eff_children()''
  
 //Note//: ''get_children()'' returns topological node children in a tree, while ''get_eff_children()'' returns node children in a linguistic sense. Mostly, these do not differ. //Note//: ''get_children()'' returns topological node children in a tree, while ''get_eff_children()'' returns node children in a linguistic sense. Mostly, these do not differ.
Line 342: Line 343:
  
 ===== Your turn: more tasks ===== ===== Your turn: more tasks =====
 +
  
  
Line 359: Line 361:
  
   * To find an object to a verb, look for objects among effective children of a verb (''$child->get_attr('afun') eq 'Obj' ''). That implies working on analytical layer.   * To find an object to a verb, look for objects among effective children of a verb (''$child->get_attr('afun') eq 'Obj' ''). That implies working on analytical layer.
-  * Once you have node ''$object'' and node ''$verb'', use method TODO  +  * For debugging, a method returning surface word order of a node is useful: ''$node->get_attr('ord')''. It can be used to print out nodes sorted by attribute ''ord''. 
-  * For debugging, a method returning word order of a node is useful: ''$node->get_attr('ord')''. It can be used to print out nodes sorted by attribute ''ord''.+  * Once you have node ''$object'' and node ''$verb'', use method ''$object->shift_before_node($verb)''. This method takes the whole subtree under node ''$object'' and counts the attributes ''ord'' (surface word order) so that all nodes in subtree under ''$object'' have smaller ''ord'' than ''$verb''. That is, the method rearranges the surface word order from VO to OV. 
 + 
 + 
 + 
 + 
 + 
 + 
  
  
Line 382: Line 391:
  
 ==== Prepositions ==== ==== Prepositions ====
 +
 +{{ external:tectomt:preps.png?200x80|}}
  
 **Motivation**: In dependency approach a question "where to hang prepositions" arises. In praguian style (PDT), prepositions are heads of the subtree and the noun/pronoun is dependent on the preposition. However, another ordering might be preferable: The noun/pronoun might be the head of subtree, while the preposition would take the role of a modifier. **Motivation**: In dependency approach a question "where to hang prepositions" arises. In praguian style (PDT), prepositions are heads of the subtree and the noun/pronoun is dependent on the preposition. However, another ordering might be preferable: The noun/pronoun might be the head of subtree, while the preposition would take the role of a modifier.
- 
-TODO obrazek 
  
 **Task**: The task is to rehang all prepositions as indicated at the picture. You may assume that prepositions have at most 1 child. **Task**: The task is to rehang all prepositions as indicated at the picture. You may assume that prepositions have at most 1 child.
Line 402: Line 411:
  
 //Advanced version//: What happens in case of multiword prepositions? For example, ''because of'', ''instead of''. Can you handle it? //Advanced version//: What happens in case of multiword prepositions? For example, ''because of'', ''instead of''. Can you handle it?
- 
- 
- 
- 
- 
  
  

[ Back to the navigation ] [ Back to the content ]