semantics extended to questions

This commit is contained in:
aarne
2007-10-20 09:51:26 +00:00
parent e86db4d8c8
commit 192f55e2f5
6 changed files with 187 additions and 17 deletions

View File

@@ -12,9 +12,10 @@ main = do
loop :: MultiGrammar -> IO ()
loop gr = do
s <- getLine
let t:_ = parse gr "BaseEng" "S" s
putStrLn $ showTree t
let p = iS $ fg t
putStrLn $ show p
case parse gr "BaseEng" "Question" s of
[] -> putStrLn "no parse"
ts -> mapM_ answer ts
loop gr
where
answer t = putStrLn $ linearize gr "BaseEng" $ gf $ question2answer $ fg t