From 048ef7d1d1121aa6c056dfb9e2070d4b9d931ba0 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 3 Nov 2006 21:47:56 +0000 Subject: big lex compiles again --- examples/big/postedit.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'examples/big/postedit.hs') diff --git a/examples/big/postedit.hs b/examples/big/postedit.hs index ce67739db..628b64752 100644 --- a/examples/big/postedit.hs +++ b/examples/big/postedit.hs @@ -7,7 +7,8 @@ tmp = "tm" main = do writeFile tmp "" s <- readFile infile - mapM_ (appendFile tmp . mkOne) $ lines s --- $ chop s + mapM_ (appendFile tmp . mkTwo) $ lines s --- $ chop s + system "cp BigLexEng.gf bak" system "mv tm BigLexEng.gf" chop s = case s of @@ -15,6 +16,16 @@ chop s = case s of c:cs -> c:chop cs _ -> s +mkTwo s = case words s of + lin:tie:eq:"dirV3":tie_V:ws -> + let prep = case reverse (takeWhile (/='_') (reverse tie)) of + "loc" -> "in" --- + p -> p + in unwords $ + [lin,tie,eq,"dirV3",show (take (length tie_V - 2) tie_V),show prep] ++ + ws ++ ["\n"] + _ -> s ++ "\n" + mkOne s = case words s of lin:a2:eq:pa2:ws | take 6 pa2 == "prepA2" -> unwords $ [lin,a2,eq,"prepA2"] ++ ws ++ ["\n"] -- cgit v1.2.3