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 />

A c-commands B iff B is a sister <strong>of</strong> A, or B is dominated by a sister <strong>of</strong> A.<br />

This <strong>on</strong>e is easily implemented:<br />

c_commands(A,B,Tree) :- sisters(A,AncB,Tree), dominates_or_eq(AncB,B,Tree).<br />

(39) The relati<strong>on</strong> between a tree and the string <strong>of</strong> its leaves, sometimes called the yield relati<strong>on</strong>, is a little bit<br />

more tricky to define. I will present a definiti<strong>on</strong> here, but not discuss it any detail. (Maybe in discussi<strong>on</strong><br />

secti<strong>on</strong>s…)<br />

yield(Tree,L) :- yield(Tree,[],L).<br />

yield(W/[], L, [W|L]).<br />

yield(_/[T|Ts], L0, L) :- yields([T|Ts],L0,L).<br />

yields([], L, L).<br />

yields([T|Ts], L0, L) :- yields(Ts,L0,L1), yield(T,L1,L).<br />

NB: Notice that this does not distinguish empty categories with no yield from terminal vocabulary with<br />

no yield.<br />

3.7 Tree grammars<br />

(40) The rules we have been c<strong>on</strong>sidering so far rewrite strings. But it is not hard to formulate rules that<br />

rewrite trees. Suppose for example that we have a tree:<br />

s<br />

a b c<br />

(41) Suppose that we want to expand the category s in this tree with a rule that could be schematically<br />

expressed as follows, where X,Y,Z are variables standing in for any subtrees:<br />

s<br />

X Y Z ⇒<br />

x<br />

a X<br />

s<br />

y<br />

b Y<br />

z<br />

c Z<br />

(42) If we apply this rule to the particular tree we began with, we get the result:<br />

x<br />

a a<br />

s<br />

y<br />

b b<br />

We could apply the rule again to this tree, and so <strong>on</strong>.<br />

52<br />

z<br />

c c

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

Saved successfully!

Ooh no, something went wrong!