Friday, November 17, 2006

 

TAG, you're it


A nice little benefit of using a tree aligning grammar (TAG) in an ALG system is that you don't have to code separate semantic and surface realizers. Since each node in a given tree knows what it is and is whatever it is in a way that is only loosely coupled with other nodes, it pretty much has all the information it needs to assign itself a semiotic value and a surface form all in one operation. There's the little wrinkle of agreement (verbs to subjects, referring expressions, and the like) but that can be handled in the TAG structure as well. I assign such nodes IDs and IDs of their "partners," then link them up with a small bridge class that lives in a collection in the tree itself (outside the nodes). A node already knows if it wants to agree with something else and so just asks of the tree if it has a partner and if it does, asks the partner for information. The partner passes back an array of Objects that the requester spins through looking for pertinent data. If it finds it, it sets its surface realization context to it (them)--if not, it just falls over into its defaults. Wicked fast, really easy to code and very, very OOP: No node other than the root is ever aware of its place in the tree--it just does what it's told. Kind of like what folks have been trying to get me to do since I was 16--without any luck at all.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?