mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
small adjustments in Make.hs and some resources to make the lib compile with less warnings and without errors
This commit is contained in:
@@ -10,7 +10,7 @@ import System.Exit
|
||||
-- Make commands for compiling and testing resource grammars.
|
||||
-- usage: runghc Make ((present? OPT?) | (clone FILE))? LANGS?
|
||||
-- where
|
||||
-- - OPT = (lang | api | math | pgf | test | parse | clean | clone)
|
||||
-- - OPT = (lang | api | pgf | test | parse | clean | clone)
|
||||
-- - LANGS has the form e.g. langs=Eng,Fin,Rus
|
||||
-- - clone with a flag file=FILENAME clones the file to the specified languages,
|
||||
-- by replacing the 3-letter language name of the original in both
|
||||
@@ -56,11 +56,17 @@ implied (_,lan) = [fun | ((_,la),fun) <- langsCoding, la == lan, fun /= ""]
|
||||
|
||||
langs = map fst langsCoding
|
||||
|
||||
-- languagues for which to compile Lang
|
||||
langsLang = langs `except` ["Tur"]
|
||||
-- all languagues for which Lang can be compiled
|
||||
langsLangAll = langs
|
||||
|
||||
-- languagues that are almost complete and for which Lang is normally compiled
|
||||
langsLang = langs `except` ["Ara","Hin","Lat","Tha","Tur"]
|
||||
|
||||
-- languages for which to compile Try
|
||||
langsAPI = langsLang `except` ["Ara","Hin","Ina","Lat","Rus","Tha"]
|
||||
langsAPI = langsLang `except` ["Ina"]
|
||||
|
||||
-- languages for which to compile Symbolic
|
||||
langsSymbolic = langsLang `except` ["Rus","Ina"]
|
||||
|
||||
-- languages for which to compile minimal Syntax
|
||||
langsMinimal = langs `only` ["Ara","Eng","Bul","Rus"]
|
||||
@@ -108,12 +114,17 @@ make xx = do
|
||||
ifx "api" $ do
|
||||
let lans = optl langsAPI
|
||||
mapM_ (gfc pres presApiPath . try) lans
|
||||
copy "api/Constructors.gfo api/Combinators.gfo api/Syntax.gfo" dir
|
||||
copyld lans "api/*" ".gfo" dir
|
||||
ifx "symbolic" $ do
|
||||
let lans = optl langsSymbolic
|
||||
mapM_ (gfc pres presApiPath . symbolic) lans
|
||||
copyld lans "api" ".gfo" dir
|
||||
copy "api/Symbolic.gfo" dir
|
||||
copyld lans "api/Symbolic" ".gfo" dir
|
||||
ifx "minimal" $ do
|
||||
let lans = optl langsMinimal
|
||||
mapM_ (gfcmin presApiPath . syntax) lans
|
||||
copyld lans "api" ".gfo" "../minimal"
|
||||
copyld lans "api/*" ".gfo" "../minimal"
|
||||
ifxx "pgf" $ do
|
||||
run_gfc $ ["-s","--make","--name=langs","--parser=off",
|
||||
"--output-dir=" ++ dir]
|
||||
@@ -227,8 +238,8 @@ copyl lans from to = do
|
||||
|
||||
copyld :: [(String,String)] -> String -> String -> String -> IO ()
|
||||
copyld lans dir from to = do
|
||||
mapM_ (\lan -> echosystem $ "cp " ++ dir ++ "/*" ++ lan ++ from ++ " " ++ to)
|
||||
(map snd lans ++ if (dir == "api") then [] else concatMap implied lans)
|
||||
mapM_ (\lan -> echosystem $ "cp " ++ dir ++ lan ++ from ++ " " ++ to)
|
||||
(map snd lans ++ if (take 3 dir == "api") then [] else concatMap implied lans)
|
||||
return ()
|
||||
|
||||
echosystem c = do
|
||||
|
||||
@@ -5,15 +5,17 @@ GF_LIB_PATH=..
|
||||
|
||||
.PHONY: all present alltenses lang api math prelude test demo parse synopsis link compiled constructX clean
|
||||
|
||||
all: link prelude constructX present alltenses compat
|
||||
all: link prelude constructX present alltenses
|
||||
|
||||
present:
|
||||
$(RUNMAKE) present lang
|
||||
$(RUNMAKE) present api
|
||||
$(RUNMAKE) present symbolic
|
||||
|
||||
alltenses:
|
||||
$(RUNMAKE) lang
|
||||
$(RUNMAKE) api
|
||||
$(RUNMAKE) symbolic
|
||||
|
||||
lang:
|
||||
$(RUNMAKE) lang
|
||||
@@ -21,7 +23,7 @@ lang:
|
||||
api:
|
||||
$(RUNMAKE) api
|
||||
|
||||
compat:
|
||||
compatibility:
|
||||
$(RUNMAKE) present compat
|
||||
|
||||
prelude:
|
||||
|
||||
@@ -48,8 +48,8 @@ oper
|
||||
|
||||
mkAdject : (_,_,_,_,_ : Str) -> Adj =
|
||||
\stor,stort,store,storre,storst -> {s = table {
|
||||
AF (APosit (Strong SgUtr )) c => mkCase c stor ;
|
||||
AF (APosit (Strong SgNeutr)) c => mkCase c stort ;
|
||||
AF (APosit (Strong (GSg Utr))) c => mkCase c stor ;
|
||||
AF (APosit (Strong (GSg Neutr))) c => mkCase c stort ;
|
||||
AF (APosit _) c => mkCase c store ;
|
||||
AF ACompar c => mkCase c storre ;
|
||||
AF (ASuperl SupStrong) c => mkCase c storst ;
|
||||
|
||||
@@ -20,7 +20,7 @@ concrete CatDut of Cat =
|
||||
|
||||
-- Question
|
||||
|
||||
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
|
||||
QCl = {s : ResDut.Tense => Anteriority => Polarity => QForm => Str} ;
|
||||
IP = {s : NPCase => Str ; n : Number} ;
|
||||
IComp = {s : Agr => Str} ;
|
||||
IDet = {s : Gender => Str ; n : Number} ;
|
||||
@@ -28,7 +28,7 @@ concrete CatDut of Cat =
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = {s : Tense => Anteriority => Polarity => Gender => Number => Str} ;
|
||||
RCl = {s : ResDut.Tense => Anteriority => Polarity => Gender => Number => Str} ;
|
||||
RP = {s : Gender => Number => Str ; a : RAgr} ;
|
||||
|
||||
-- Verb
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete IdiomDut of Idiom = CatDut **
|
||||
open MorphoDut, ParadigmsDut, IrregDut, Prelude in {
|
||||
open MorphoDut, (P = ParadigmsDut), IrregDut, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
||||
here7from_Adv = ss ["van hier"] ; ----
|
||||
here_Adv = ss "hier" ;
|
||||
how_IAdv = ss "hoe" ;
|
||||
how8much_IAdv = ss "hoeveel" ;
|
||||
how8many_IDet = mkDet "hoeveel" "hoeveel" Pl ;
|
||||
if_Subj = ss "als" ;
|
||||
in8front_Prep = mkPrep "voor" ;
|
||||
@@ -71,6 +72,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
||||
something_NP = mkNP "iets" Utr Sg ;
|
||||
somewhere_Adv = ss "ergens" ;
|
||||
that_Quant = mkQuant "die" "dat" ;
|
||||
that_Subj = ss "dat" ;
|
||||
there_Adv = ss "daar" ;
|
||||
there7to_Adv = ss "daar" ;
|
||||
there7from_Adv = ss "van daar" ;
|
||||
@@ -116,7 +118,7 @@ concrete StructuralDut of Structural = CatDut, Prelude **
|
||||
except_Prep = mkPrep "met uitzondering van" ;
|
||||
|
||||
as_CAdv = X.mkCAdv "zo" "als" ;
|
||||
have_V2 = mkV2 hebben_V ;
|
||||
have_V2 = mkV2 ParadigmsDut.hebben_V ;
|
||||
|
||||
lin language_title_Utt = ss "nederlands" ;
|
||||
|
||||
|
||||
@@ -79,5 +79,5 @@ concrete VerbDut of Verb = CatDut ** open Prelude, ResDut in {
|
||||
oper
|
||||
v2v : VVerb -> VVerb = \v ->
|
||||
{s = v.s ; aux = v.aux ; prefix = v.prefix ; vtype = v.vtype} ;
|
||||
predVv : V -> VP = \v -> predV (v2v v) ;
|
||||
predVv : VVerb -> ResDut.VP = \v -> predV (v2v v) ;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
resource MakeStructuralIta = open CatIta, ParadigmsIta, MorphoIta, Prelude in {
|
||||
|
||||
oper
|
||||
mkConj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||
mkConj : Str -> Str -> ParadigmsIta.Number -> Conj = \x,y,n ->
|
||||
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
|
||||
mkSubj : Str -> Subj = \x ->
|
||||
{s = x ; m = Indic ; lock_Subj = <>} ;
|
||||
|
||||
@@ -406,13 +406,14 @@ resource VerbMorphoPol = ResPol ** open Prelude, CatPol, (Predef=Predef), (Adj=A
|
||||
let perf = verb.sp; in
|
||||
let imperf = verb.si; in
|
||||
table {
|
||||
<Pres, Simul, gn, p> => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie ;
|
||||
<Pres, Anter, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ;
|
||||
<Past, _, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ;
|
||||
<Fut, Simul, gn, p> => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3);
|
||||
<Fut, Anter, gn, p> => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie;
|
||||
<Cond, Simul, gn, p> => nie ++ imperf ! (VCondM gn p) ++ sie;
|
||||
<Cond, Anter, gn, p> => nie ++ perf ! (VCondM gn p) ++ sie
|
||||
<Pres, Simul, gn, p> => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie
|
||||
; --# notpresent
|
||||
<Pres, Anter, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ; --# notpresent
|
||||
<Past, _, gn, p> => nie ++ perf ! (VPraetM gn p) ++ sie ; --# notpresent
|
||||
<Fut, Simul, gn, p> => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3); --# notpresent
|
||||
<Fut, Anter, gn, p> => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie; --# notpresent
|
||||
<Cond, Simul, gn, p> => nie ++ imperf ! (VCondM gn p) ++ sie; --# notpresent
|
||||
<Cond, Anter, gn, p> => nie ++ perf ! (VCondM gn p) ++ sie --# notpresent
|
||||
}
|
||||
};
|
||||
|
||||
@@ -422,17 +423,18 @@ resource VerbMorphoPol = ResPol ** open Prelude, CatPol, (Predef=Predef), (Adj=A
|
||||
let zostac = (case verb.asp of { Imperfective => conj1 "być"; _ => conj3 "zostać" }).s; in
|
||||
let nie = case pol of { Pos => "" ; Neg => "nie" }; in
|
||||
table {
|
||||
<Pres, Simul, gn, p> => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom;
|
||||
<Pres, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Past, Simul, gn, p> => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Past, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Fut, Simul, gn, p> => nie ++ case verb.asp of {
|
||||
Perfective => zostac ! (VFinM (extract_num!gn) p);
|
||||
_ => bedzie ! <extract_num!gn, p>
|
||||
} ++ verb.ppart ! AF gn Nom;
|
||||
<Fut, Anter, gn, p> => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom;
|
||||
<Cond, Simul, gn, p> => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom;
|
||||
<Cond, Anter, gn, p> => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom
|
||||
<Pres, Simul, gn, p> => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom
|
||||
; --# notpresent
|
||||
<Pres, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Past, Simul, gn, p> => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Past, Anter, gn, p> => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Fut, Simul, gn, p> => nie ++ case verb.asp of { --# notpresent
|
||||
Perfective => zostac ! (VFinM (extract_num!gn) p); --# notpresent
|
||||
_ => bedzie ! <extract_num!gn, p> --# notpresent
|
||||
} ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Fut, Anter, gn, p> => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Cond, Simul, gn, p> => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent
|
||||
<Cond, Anter, gn, p> => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom --# notpresent
|
||||
};
|
||||
|
||||
bedzie : Number * Person => Str = table {
|
||||
|
||||
@@ -100,7 +100,13 @@ param
|
||||
| Ger
|
||||
| PPasse Gender Number Species ACase ;
|
||||
|
||||
TMood = VPres Mood | VImperff | VPasse Mood | VFut | VCondit ;
|
||||
TMood =
|
||||
VPres Mood
|
||||
| VImperff --# notpresent
|
||||
| VPasse Mood --# notpresent
|
||||
| VFut --# notpresent
|
||||
| VCondit --# notpresent
|
||||
;
|
||||
|
||||
NumPersI = SgP2 | PlP1 | PlP2 ;
|
||||
|
||||
@@ -109,7 +115,12 @@ param
|
||||
| VPGerund
|
||||
| VPInfinit Anteriority Bool ;
|
||||
|
||||
RTense = RPres | RPast | RFut | RCond ;
|
||||
RTense =
|
||||
RPres
|
||||
| RPast --# notpresent
|
||||
| RFut --# notpresent
|
||||
| RCond --# notpresent
|
||||
;
|
||||
|
||||
oper
|
||||
copula : VerbPhrase =
|
||||
@@ -193,22 +204,23 @@ oper
|
||||
in {
|
||||
s = table {
|
||||
VPFinite tm Simul => case tm of
|
||||
{VPres Indic => vf "" (\a -> verb ! Indi Presn a.n a.p) ;
|
||||
VPres Conjunct => vf "să" (\a -> verb ! Subjo SPres a.n a.p) ;
|
||||
VImperff => vf "" (\a -> verb ! Indi Imparf a.n a.p) ;
|
||||
VPasse Indic => vf "" (\a -> pComp ! a.n ! a.p ++ verb ! PPasse Masc Sg Indef ANomAcc) ;
|
||||
VPasse Conjunct => vf "să" (\a -> copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ;
|
||||
VFut => vf "" (\a -> pFut ! a.n ! a.p ++ verb ! Inf) ;
|
||||
VCondit => vf "" (\a -> pCond ! a.n ! a.p ++ verb ! Inf)
|
||||
} ;
|
||||
VPFinite tm Anter => case tm of
|
||||
{VPres Indic => vf "" (\a -> pComp ! a.n ! a.p ++ verb ! PPasse Masc Sg Indef ANomAcc) ;
|
||||
(VPres Conjunct | VPasse Conjunct) => vf "să" (\a -> copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ;
|
||||
VFut => vf "" (\a -> pFut !a.n ! a.p ++ copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ;
|
||||
VCondit => vf "" (\a -> pCond ! a.n ! a.p ++ copula.s ! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc);
|
||||
_ => vf "" (\a -> verb ! Indi PPerfect a.n a.p)
|
||||
};
|
||||
VPInfinit Anter b=> vf "a" (\a -> copula.s ! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc);
|
||||
{
|
||||
VPres Indic => vf "" (\a -> verb ! Indi Presn a.n a.p) ;
|
||||
VPres Conjunct => vf "să" (\a -> verb ! Subjo SPres a.n a.p)
|
||||
; VImperff => vf "" (\a -> verb ! Indi Imparf a.n a.p) --# notpresent
|
||||
; VPasse Indic => vf "" (\a -> pComp ! a.n ! a.p ++ verb ! PPasse Masc Sg Indef ANomAcc) ; --# notpresent
|
||||
VPasse Conjunct => vf "să" (\a -> copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ; --# notpresent
|
||||
VFut => vf "" (\a -> pFut ! a.n ! a.p ++ verb ! Inf) ; --# notpresent
|
||||
VCondit => vf "" (\a -> pCond ! a.n ! a.p ++ verb ! Inf) --# notpresent
|
||||
} ;
|
||||
VPFinite tm Anter => case tm of { --# notpresent
|
||||
VPres Indic => vf "" (\a -> pComp ! a.n ! a.p ++ verb ! PPasse Masc Sg Indef ANomAcc) ; --# notpresent
|
||||
(VPres Conjunct | VPasse Conjunct) => vf "să" (\a -> copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ; --# notpresent
|
||||
VFut => vf "" (\a -> pFut !a.n ! a.p ++ copula.s! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc) ; --# notpresent
|
||||
VCondit => vf "" (\a -> pCond ! a.n ! a.p ++ copula.s ! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc); --# notpresent
|
||||
_ => vf "" (\a -> verb ! Indi PPerfect a.n a.p) --# notpresent
|
||||
}; --# notpresentx
|
||||
VPInfinit Anter b=> vf "a" (\a -> copula.s ! Inf ++ verb ! PPasse Masc Sg Indef ANomAcc); --# notpresent
|
||||
VPImperat => vf "să" (\a -> verb ! Subjo SPres a.n a.p) ; -- fix it later !
|
||||
VPGerund => vf "" (\a -> vger) ;
|
||||
VPInfinit Simul b => vf "a" (\a -> verb ! Inf)
|
||||
@@ -506,9 +518,9 @@ oper
|
||||
s = \\d,t,a,b,m =>
|
||||
let
|
||||
tm = case t of {
|
||||
RPast => VPasse m ;
|
||||
RFut => VFut ;
|
||||
RCond => VCondit ;
|
||||
RPast => VPasse m ; --# notpresent
|
||||
RFut => VFut ; --# notpresent
|
||||
RCond => VCondit ; --# notpresent
|
||||
RPres => VPres m
|
||||
} ;
|
||||
cmp = case <<t,a,m> : RTense * Anteriority * Mood> of {
|
||||
|
||||
41
lib/src/turkish/SymbolTur.gf
Normal file
41
lib/src/turkish/SymbolTur.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
--# -path=.:../abstract:../common
|
||||
|
||||
concrete SymbolTur of Symbol = CatTur ** open Prelude, ResTur in {
|
||||
|
||||
{- TODO!
|
||||
lin
|
||||
SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ;
|
||||
NumPN i = {s = i.s ; g = Neutr} ;
|
||||
CNIntNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
} ;
|
||||
CNSymbNP det cn xs = {
|
||||
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ;
|
||||
a = agrgP3 det.n cn.g
|
||||
} ;
|
||||
CNNumNP cn i = {
|
||||
s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ;
|
||||
a = agrgP3 Sg cn.g
|
||||
} ;
|
||||
|
||||
SymbS sy = sy ;
|
||||
|
||||
SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||
-}
|
||||
|
||||
lincat
|
||||
|
||||
Symb, [Symb] = SS ;
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
|
||||
-- BaseSymb = infixSS "and" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user