/* "The executive assistant forgot that the student who [VP was waiting [PP for the exam] ] was standing in the hallway."; "The executive assistant forgot that the student who [VP knew [CP that the exam was important]] was standing in the hallway." */ declare Gvandyke_lc = [ 'S'#['DP']#['VP'] 'DP'#['D']#['NP'] % omit single bar level for D since we never use it 'Srel'#['NPrel']#['VP'] % unreduced RC 'VP'#['Aux']#['VP'] 'VP'#['Vp']#['PP'] 'VP'#['Va']#['AP'] % give copula and Aux verb same category 'VP'#['Vc']#['CP'] 'AP'#['A1']#nil 'A1'#['A']#nil 'CP'#['C']#['S'] 'PP'#['P']#['DP'] 'NP'#['N1']#nil 'N1'#['N']#nil % no adjuncts 'N1'#['A']#['N1'] % optional premodifier 'N1'#['N1']#['Srel'] % optional postmodifier 'D'#[the]#nil 'A'#[executive]#nil 'A'#[important]#nil 'P'#['for']#nil % these are Oz keywords 'P'#['in']#nil 'Vp'#[standing]#nil 'Vp'#[waiting]#nil 'Va'#[was]#nil 'Vc'#[forgot]#nil 'Vc'#[knew]#nil 'NPrel'#[who]#nil 'Aux'#[was]#nil 'C'#[that]#nil 'N'#[assistant]#nil 'N'#[student]#nil 'N'#[exam]#nil 'N'#[hallway]#nil ] GDvandyke_lc = {DictByTrigger Gvandyke_lc} LTvandyke_lc = {LongestTrigger Gvandyke_lc} VanDykeOracle={BeginningOf Gvandyke_lc} VD0=[the executive assistant forgot that the student who was waiting 'for' the exam was standing 'in' the hallway] VD1=[the executive assistant forgot that the student who knew that the exam was important was standing 'in' the hallway] MarkFinal={MakeMarkFinal nil } % specify which rules have Final Arguments %% MarkFinal={MakeMarkFinal [ 'DP'#['D' 'NP'] ]} % specify which rules have Final Arguments % make sure to feed several files before trying this % 1. glc.oz (the parser) % 2. beginningof.oz (the oracle-maker) % 3. faucet.oz (indoor plumbing technology) % 3. move-visualizer (replaces System.show) % set up a portal that will receive news of parser actions local MyStream Portal GardenHose in {NewPort MyStream Portal} % connect it to a file GardenHose={MakeFaucet 'vd0' MyStream} % start busily copying from the stream to the file % takes two arguments: a Faucet and a VirtualString-ifier % defined in faucet.oz and move-visualizer.oz respectively thread {TeeFaucet GardenHose SpellMove} end {Send Portal 'VD0\n'} % run the parser {Browse {SolveOne proc {$ Sol} Derivation Tree in % once included Derivation Sol=Tree {GLC MarkFinal VanDykeOracle LTvandyke_lc GDvandyke_lc ['S'] VD0 [Tree] Derivation Portal} end } } % clean up {TurnOffFaucet GardenHose} end