20.07.2013 Views

Notes on computational linguistics.pdf - UCLA Department of ...

Notes on computational linguistics.pdf - UCLA Department of ...

Notes on computational linguistics.pdf - UCLA Department of ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Stabler - Lx 185/209 2003<br />

node with a ph<strong>on</strong>ological form with terms <strong>of</strong> the form Label/–Ph<strong>on</strong>, whereLabel isthenodelabeland<br />

Ph<strong>on</strong> is that node’s ph<strong>on</strong>ological form. The tree fragment depicted above is represented by the term<br />

VP/[ DP/ -Mary, V ′<br />

/[ V/-walks, VP/[V ′<br />

/[V/[]]]]].<br />

From a computati<strong>on</strong>al perspective, the primary advantage <strong>of</strong> this representati<strong>on</strong> is that it provides a<br />

simple, structural distincti<strong>on</strong> between (trees c<strong>on</strong>sisting <strong>of</strong>) a node with no ph<strong>on</strong>ological c<strong>on</strong>tent and a<br />

node with no ph<strong>on</strong>ological c<strong>on</strong>tent.<br />

(3) As noted by Gorn (1969), a node can be identified by a sequence <strong>of</strong> integers representing the choices<br />

made <strong>on</strong> the path from the root to the node.<br />

We can see how this method works in the following tree, while identifying nodes by their labels does<br />

not:<br />

b[1]<br />

c [1,1]<br />

a[]<br />

b[2]<br />

c [2,1]<br />

(4) Gorn’s path representati<strong>on</strong>s <strong>of</strong> notes are difficult to reas<strong>on</strong> about if the tree is c<strong>on</strong>structed in a n<strong>on</strong>-topdown<br />

fashi<strong>on</strong>, so we c<strong>on</strong>sider a another representati<strong>on</strong> is proposed by Hirschman and Dowding (1990)<br />

and modified slightly by Johns<strong>on</strong> (1991), Johns<strong>on</strong> and Stabler (1993).<br />

A node is represented by a term<br />

node(Pedigree,Tree,Parent)<br />

where Pedigree is the integer positi<strong>on</strong> <strong>of</strong> the node with respect to its sisters, or else root if the node<br />

is root; Tree is the subtree rooted at this node, and Parent is the representati<strong>on</strong> <strong>of</strong> the parent node, or<br />

else n<strong>on</strong>e if the node is root.<br />

(5) Even though the printed representati<strong>on</strong> <strong>of</strong> a node can be quadratically larger than the printed representati<strong>on</strong><br />

<strong>of</strong> the tree that c<strong>on</strong>tains it, it turns out that in most implementati<strong>on</strong>s structure-sharing will<br />

occur between subtrees so that the size <strong>of</strong> a node is linear in the size <strong>of</strong> the tree.<br />

(6) With this representati<strong>on</strong> scheme, the leftmost leaf <strong>of</strong> the tree above is represented by the term<br />

n(1,c/[],n(1,b/[c/[]],n(root,a/[b/[c/[]],b/[c/[]]],n<strong>on</strong>e)))<br />

(7) With this notati<strong>on</strong>, we can define standard relati<strong>on</strong>s <strong>on</strong> nodes, where the nodes are unambiguously<br />

denoted by our terms:<br />

% child(I, Parent, Child) is true if Child is the Ith child <strong>of</strong> Parent.<br />

child(I, Parent, n(I,Tree,Parent)) :- Parent = n(_, _/ Trees, _), nth(I, Trees, Tree).<br />

% ancestor(Ancestor, Descendant) is true iff Ancestor dominates Descendant.<br />

% There are two versi<strong>on</strong>s <strong>of</strong> ancestor, <strong>on</strong>e that works from the<br />

% Descendant up to the Ancestor, and the other that works from the<br />

% Ancestor down to the descendant.<br />

ancestor_up(Ancestor, Descendant) :- child(_I, Ancestor, Descendant).<br />

ancestor_up(Ancestor, Descendant) :- child(_I, Parent, Descendant), ancestor_up(Ancestor, Parent).<br />

ancestor_down(Ancestor, Descendant) :- child(_I, Ancestor, Descendant).<br />

ancestor_down(Ancestor, Descendant) :- child(_I, Ancestor, Child), ancestor_down(Child, Descendant).<br />

% root(Node) is true iff Node has no parent<br />

root(n(root,_,n<strong>on</strong>e)).<br />

% subtree(Node, Tree) iff Tree is the subtree rooted at Node.<br />

subtree(n(_,Tree,_), Tree).<br />

% label(Node, Label) is true iff Label is the label <strong>on</strong> Node.<br />

label(n(_,Label/_,_), Label).<br />

% c<strong>on</strong>tents(Node, C<strong>on</strong>tents) is true iff C<strong>on</strong>tents is either<br />

% the ph<strong>on</strong>etic c<strong>on</strong>tent <strong>of</strong> node or the subtrees <strong>of</strong> node<br />

c<strong>on</strong>tents(n(_,_/C<strong>on</strong>tents,_),C<strong>on</strong>tents).<br />

% children(Parent, Children) is true if the list <strong>of</strong> Parent’s<br />

% children is Children.<br />

63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!