mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
resource lib name changed
This commit is contained in:
24
lib/resource/api/examples/mkgfs.hs
Normal file
24
lib/resource/api/examples/mkgfs.hs
Normal file
@@ -0,0 +1,24 @@
|
||||
-- to process constructor examples to lin commans
|
||||
|
||||
main = mkgfs
|
||||
|
||||
src = "ExxI.gf"
|
||||
script = "exx.gfs"
|
||||
linkfile ex = "links/" ++ ex ++ ".txt"
|
||||
|
||||
mkgfs = do
|
||||
writeFile script ""
|
||||
readFile src >>= (mapM addLin . lines)
|
||||
|
||||
|
||||
addLin s = case words s of
|
||||
c@('e':'x':_):"=":def -> do
|
||||
appendFile script ("ps \"" ++ unwords (init def) ++ "\\n\\n\" | wf " ++ linkfile c ++ "\n")
|
||||
appendFile script ("l -multi " ++ cc ++ " | af " ++ linkfile c ++ "\n")
|
||||
|
||||
where
|
||||
cc = case take 2 (reverse c) of
|
||||
"PV" -> "utt " ++ c
|
||||
_ -> c
|
||||
_ -> return ()
|
||||
|
||||
Reference in New Issue
Block a user