<< Prev | - Up - |
An example chart parse.
Let's look at an example. Let's see what happens when we give this recognizer the example we looked at before, that is, ``Vincent shot Marsellus''. Here is an abbreviated trace that shows you how the words are read and which arcs are added to the chart subsequently.
[trace] 12 ?- chart_recognize_bottomup([vincent,shot,marsellus]).
Exit: (11) scan(0, 1, vincent) ?
Exit: (11) assert(arc(0, 1, pn)) ?
Exit: (15) np--->[pn] ?
Exit: (15) assert(arc(0, 1, np)) ?
Exit: (11) scan(1, 2, shot) ?
Exit: (11) assert(arc(1, 2, tv)) ?
Exit: (11) scan(2, 3, marsellus) ?
Exit: (11) assert(arc(2, 3, pn)) ?
Exit: (15) np--->[pn] ?
Exit: (15) assert(arc(2, 3, np)) ?
Exit: (19) vp--->[tv, np] ?
Exit: (19) assert(arc(1, 3, vp)) ?
Exit: (23) s--->[np, vp] ?
Exit: (23) assert(arc(0, 3, s)) ?
Yes
And this is what the final chart looks like:
13 ?- listing(scan).
scan(0, 1, vincent).
scan(1, 2, shot).
scan(2, 3, marsellus).
Yes
14 ?- listing(arc).
arc(0, 1, pn).
arc(0, 1, np).
arc(1, 2, tv).
arc(2, 3, pn).
arc(2, 3, np).
arc(1, 3, vp).
arc(0, 3, s).
Yes
<< Prev | - Up - |