summaryrefslogtreecommitdiff
path: root/examples/big/postedit.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-11-03 21:47:56 +0000
committeraarne <aarne@cs.chalmers.se>2006-11-03 21:47:56 +0000
commit048ef7d1d1121aa6c056dfb9e2070d4b9d931ba0 (patch)
treed5a8a8b31d625699b7459e633a5478f124e4bb0a /examples/big/postedit.hs
parentdb95cbad6d2b3a5ba8ca90dafbb8e7513637a7e3 (diff)
big lex compiles again
Diffstat (limited to 'examples/big/postedit.hs')
-rw-r--r--examples/big/postedit.hs13
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"]