mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
big lex compiles again
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user