mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-11 04:02:52 -06:00
Generation with metavariables.
This commit is contained in:
2
bin/jgf2
2
bin/jgf2
@@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
# change the value of GFHOME to the directory where you have the gf binary
|
# change the value of GFHOME to the directory where you have the gf binary
|
||||||
GFHOME=/home/aarne/GF/bin
|
GFHOME=/home/aarne/GF2/bin
|
||||||
|
|
||||||
JGUILIB=$GFHOME/java/
|
JGUILIB=$GFHOME/java/
|
||||||
GF=$GFHOME/gf2
|
GF=$GFHOME/gf2
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ gr2sgr gr = [(trId f, ty') | (f,ty) <- funRulesOf gr, ty' <- trTy ty] where
|
|||||||
-- str2tr :: STree -> Exp
|
-- str2tr :: STree -> Exp
|
||||||
str2tr t = case t of
|
str2tr t = case t of
|
||||||
SApp (f,ts) -> mkApp (trId f) (map str2tr ts)
|
SApp (f,ts) -> mkApp (trId f) (map str2tr ts)
|
||||||
|
SMeta _ -> mkMeta 0
|
||||||
|
---- SString s -> K s
|
||||||
where
|
where
|
||||||
trId = cn . zIdent
|
trId = cn . zIdent
|
||||||
|
|
||||||
@@ -75,7 +76,8 @@ generate gr cat i mn mt = case mt of
|
|||||||
gen (n+1) (nub [(c,SApp (f, xs)) | (f,(cs,c)) <- gr, xs <- args cs cts] ++ cts)
|
gen (n+1) (nub [(c,SApp (f, xs)) | (f,(cs,c)) <- gr, xs <- args cs cts] ++ cts)
|
||||||
|
|
||||||
args :: [SCat] -> [(SCat,STree)] -> [[STree]]
|
args :: [SCat] -> [(SCat,STree)] -> [[STree]]
|
||||||
args cs cts = combinations [constr [t | (k,t) <- cts, k == c] | c <- cs]
|
args cs cts = combinations
|
||||||
|
[constr (SMeta c : [t | (k,t) <- cts, k == c]) | c <- cs]
|
||||||
|
|
||||||
constr = maybe id take mn
|
constr = maybe id take mn
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
module Today where today = "Sun May 2 15:21:39 CEST 2004"
|
module Today where today = "Mon May 3 10:59:20 CEST 2004"
|
||||||
|
|||||||
Reference in New Issue
Block a user