[ 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 Both sides next revision
external:tectomt:tutorial [2009/01/21 11:30]
kravalova
external:tectomt:tutorial [2009/01/21 11:33]
kravalova
Line 368: Line 368:
   * 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 406: Line 407:
  
 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)''
  

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