1
0
forked from GitHub/gf-core

first incarnation of the bracketed string API

This commit is contained in:
krasimir
2010-04-30 14:36:06 +00:00
parent 7a4cb3c271
commit 8460598801
12 changed files with 632 additions and 468 deletions

View File

@@ -41,17 +41,20 @@ convertFile conf src file = do
convEx (cat,ex) = do
appn "("
let typ = maybe (error "no valid cat") id $ readType cat
let ts = rank $ parse pgf lang typ ex
ws <- case ts of
[] -> do
ws <- case fst (parse pgf lang typ ex) of
ParseFailed _ -> do
let ws = morphoMissing morpho (words ex)
appv ("WARNING: cannot parse example " ++ ex)
case ws of
[] -> return ()
_ -> appv (" missing words: " ++ unwords ws)
return ws
t:tt -> appv ("WARNING: ambiguous example " ++ ex) >>
appn t >> mapM_ (appn . (" --- " ++)) tt >> return []
return ws
TypeError _ _ ->
return []
ParseResult ts ->
case rank ts of
(t:tt) -> appv ("WARNING: ambiguous example " ++ ex) >>
appn t >> mapM_ (appn . (" --- " ++)) tt >> return []
appn ")"
return ws
rank ts = case probs conf of