forked from GitHub/gf-core
biglex experiment
This commit is contained in:
10
examples/big/BigEnglish.gf
Normal file
10
examples/big/BigEnglish.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete BigEnglish of BigEnglishAbs =
|
||||||
|
LangEng,
|
||||||
|
IrregEng-[
|
||||||
|
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||||
|
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V],
|
||||||
|
ExtraEng,
|
||||||
|
BigLexEng
|
||||||
|
** {} ;
|
||||||
10
examples/big/BigEnglishAbs.gf
Normal file
10
examples/big/BigEnglishAbs.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
abstract BigEnglishAbs =
|
||||||
|
Lang,
|
||||||
|
IrregEngAbs-[
|
||||||
|
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||||
|
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V],
|
||||||
|
ExtraEngAbs,
|
||||||
|
BigLexEngAbs
|
||||||
|
** {} ;
|
||||||
5980
examples/big/BigLexEng.gf
Normal file
5980
examples/big/BigLexEng.gf
Normal file
File diff suppressed because it is too large
Load Diff
5968
examples/big/BigLexEngAbs.gf
Normal file
5968
examples/big/BigLexEngAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
11809
examples/big/BigLexSwe.gf
Normal file
11809
examples/big/BigLexSwe.gf
Normal file
File diff suppressed because it is too large
Load Diff
11809
examples/big/BigLexSweAbs.gf
Normal file
11809
examples/big/BigLexSweAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
28
examples/big/extract2gf.hs
Normal file
28
examples/big/extract2gf.hs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import System
|
||||||
|
import Char
|
||||||
|
|
||||||
|
-- usage: extract2gf <lang> <extracted>
|
||||||
|
|
||||||
|
main = do
|
||||||
|
la:f:_ <- getArgs
|
||||||
|
let cnc = f ++ ".gf"
|
||||||
|
let abs = f ++ "Abs.gf"
|
||||||
|
s <- readFile f
|
||||||
|
writeFile abs $ "abstract " ++ f ++ "Abs = Cat ** {\n"
|
||||||
|
writeFile cnc $ "concrete " ++ f ++ " of " ++ f ++
|
||||||
|
"Abs = Cat" ++ la ++ " ** open Paradigms" ++ la ++ " in {\n"
|
||||||
|
mapM_ (mkOne abs cnc . words) $ filter (not . empty) $ lines s
|
||||||
|
appendFile abs "}"
|
||||||
|
appendFile cnc "}"
|
||||||
|
|
||||||
|
-- format: cat oper args
|
||||||
|
|
||||||
|
mkOne abs cnc (cat : oper : args@(a1:_)) = do
|
||||||
|
appendFile abs $ " fun " ++ fun ++ " : " ++ cat ++ " ;\n"
|
||||||
|
appendFile cnc $ " lin " ++ fun ++ " = " ++ lin ++ " ;\n"
|
||||||
|
where
|
||||||
|
fun = a1 ++ "_" ++ cat ++ "_" ++ oper
|
||||||
|
lin = unwords $ oper:["\"" ++ s ++ "\"" | s <- args]
|
||||||
|
mkOne _ _ ws = putStrLn $ unwords ws
|
||||||
|
|
||||||
|
empty s = all isSpace s || take 2 s == "--"
|
||||||
Reference in New Issue
Block a user