diff options
Diffstat (limited to 'examples/big/postedit.hs')
| -rw-r--r-- | examples/big/postedit.hs | 13 |
1 files changed, 12 insertions, 1 deletions
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"] |
