mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
subcat in verbs
This commit is contained in:
39
lib/resource/french/MkVerbs.hs
Normal file
39
lib/resource/french/MkVerbs.hs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
|
||||||
|
s <- readFile "verbs"
|
||||||
|
mapM_ putRule $ combine $ map words $ lines s -- to create fun/lin
|
||||||
|
-- mapM_ putConjug [1..100] -- to create oper
|
||||||
|
|
||||||
|
putRule = appendFile "verbs.gf" . mkRule
|
||||||
|
|
||||||
|
mkRule s = case s of
|
||||||
|
n:v:cs ->
|
||||||
|
"fun " ++ v ++ cat ++ " : " ++ cat ++ " ;\n" ++
|
||||||
|
"lin " ++ v ++ cat ++
|
||||||
|
" = v_nancy" ++ n ++ " \"" ++ v ++ "\"" ++ ext ++ " ;\n"
|
||||||
|
where
|
||||||
|
(cat,ext) = case cs of
|
||||||
|
"I":"T":_ -> ("VN2", " ** {aux = VHabere ; c = Acc}")
|
||||||
|
"T":_ -> ("VN2", " ** {aux = VHabere ; c = Acc}")
|
||||||
|
"a":au -> ("VN2", " ** {aux = " ++ aux au ++ " ; c = Dat}")
|
||||||
|
"de":au -> ("VN2", " ** {aux = " ++ aux au ++ " ; c = Gen}")
|
||||||
|
au -> ("VN", " ** {aux = " ++ aux au ++ "}")
|
||||||
|
aux au = case au of
|
||||||
|
"etre":_ -> "VEsse"
|
||||||
|
_ -> "VHabere"
|
||||||
|
|
||||||
|
combine ls = case ls of
|
||||||
|
l@(n:v:_:c:_):vs ->
|
||||||
|
let (vv,rest) = span ((==v) . (!!1)) vs in
|
||||||
|
([n,v,c] ++ map (!!3) vs) : combine rest
|
||||||
|
_ -> ls
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
putConjug = appendFile "nancy_conjugs.gf" . mkConjug
|
||||||
|
|
||||||
|
mkConjug :: Integer -> String
|
||||||
|
mkConjug i = "oper v_nancy" ++ show i ++
|
||||||
|
" : Str -> V = \\s -> conj v ++ {lock_V = <>} ;\n"
|
||||||
6543
lib/resource/french/OldVerbesFre.gf
Normal file
6543
lib/resource/french/OldVerbesFre.gf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
|||||||
abstract TestVerbesAbs = TestResource, VerbesAbs ** {
|
abstract TestVerbesAbs = TestResource, VerbesAbs ** {
|
||||||
fun UseVN : VN -> V ;
|
fun UseVN : VN -> V ;
|
||||||
|
fun UseVN2 : VN2 -> V2 ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
concrete TestVerbesFre of TestVerbesAbs =
|
concrete TestVerbesFre of TestVerbesAbs =
|
||||||
TestResourceFre, VerbesFre ** open TypesFre in {
|
TestResourceFre, VerbesFre ** open TypesFre in {
|
||||||
|
|
||||||
lin UseVN ve = verbPres ve.s AHabere ; ---- VEsse
|
lin UseVN ve = verbPres ve.s ve.aux ;
|
||||||
|
lin UseVN2 ve = verbPres ve.s ve.aux ** {s2 = [] ; c = ve.c} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user