[ 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 11:30]
kravalova
external:tectomt:tutorial [2009/01/21 11:35]
kravalova
Line 348: Line 348:
  
 ===== Your turn: more tasks ===== ===== Your turn: more tasks =====
 +
  
  
Line 359: Line 360:
 ==== SVO to SOV ==== ==== SVO to SOV ====
  
-**Motivation**: During translation from an SVO based language (English) to an SOV based language (Korean) we might need to change the word order from SVO to SOV. +**Motivation**: During translation from an SVO based language (e.g. English) to an SOV based language (e.g. Korean) we might need to change the word order from SVO to SOV. 
  
 **Task**: Change the word order from SVO to SOV. **Task**: Change the word order from SVO to SOV.
Line 368: Line 369:
   * For debugging, a method returning surface word order of a node is useful: ''$node<nowiki>-></nowiki>get_attr('ord')''. It can be used to print out nodes sorted by attribute ''ord''.   * For debugging, a method returning surface word order of a node is useful: ''$node<nowiki>-></nowiki>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<nowiki>-></nowiki>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.   * Once you have node ''$object'' and node ''$verb'', use method ''$object<nowiki>-></nowiki>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 397: Line 401:
 ==== Prepositions ==== ==== Prepositions ====
  
-{{ external:tectomt:preps.png?200x80|}}+{{ external:tectomt:preps.png?200x80|Prepositions example}}
  
 **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.
Line 406: Line 410:
  
 You are going to need these new methods: You are going to need these new methods:
-  * ''my @children = $node<nowiki>-></nowiki>get_children'' +  * ''my @children = $node<nowiki>-></nowiki>get_children()'' 
-  * ''my $parent = $node<nowiki>-></nowiki>get_parent''+  * ''my $parent = $node<nowiki>-></nowiki>get_parent()''
   * ''$node<nowiki>-></nowiki>set_parent($parent)''   * ''$node<nowiki>-></nowiki>set_parent($parent)''
  
 //Hint//:  //Hint//: 
   * On analytical layer, you can use this test to recognize prepositions: ''$node<nowiki>-></nowiki>get_attr('afun') eq 'AuxP' ''    * On analytical layer, you can use this test to recognize prepositions: ''$node<nowiki>-></nowiki>get_attr('afun') eq 'AuxP' '' 
-  * You can use block template in ''libs/blocks/BlockTemplate.pm''. To see the results, you can again use TrEd (''tmttred sample.tmt'')+  * You can use block template in ''libs/blocks/BlockTemplate.pm'' 
 +  * To see the results, you can again use TrEd (''tmttred sample.tmt'')
  
  

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