From 0beda69f6cfc727f7eb059614538248a83c5e113 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 14 Apr 2010 16:25:17 +0000 Subject: [PATCH] small adjustments in Make.hs and some resources to make the lib compile with less warnings and without errors --- src/Make.hs | 27 +++++++++++----- src/Makefile | 6 ++-- src/danish/MorphoDan.gf | 4 +-- src/dutch/CatDut.gf | 4 +-- src/dutch/IdiomDut.gf | 2 +- src/dutch/StructuralDut.gf | 4 ++- src/dutch/VerbDut.gf | 2 +- src/italian/MakeStructuralIta.gf | 2 +- src/polish/VerbMorphoPol.gf | 38 +++++++++++----------- src/romanian/ResRon.gf | 54 +++++++++++++++++++------------- src/turkish/SymbolTur.gf | 41 ++++++++++++++++++++++++ 11 files changed, 127 insertions(+), 57 deletions(-) create mode 100644 src/turkish/SymbolTur.gf diff --git a/src/Make.hs b/src/Make.hs index d88c0388c..95f9ea55a 100644 --- a/src/Make.hs +++ b/src/Make.hs @@ -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 diff --git a/src/Makefile b/src/Makefile index bc2f1cafb..d3bbcd92c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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: diff --git a/src/danish/MorphoDan.gf b/src/danish/MorphoDan.gf index 4b2af88a9..a6b3fa302 100644 --- a/src/danish/MorphoDan.gf +++ b/src/danish/MorphoDan.gf @@ -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 ; diff --git a/src/dutch/CatDut.gf b/src/dutch/CatDut.gf index d523de3fe..0daa42479 100644 --- a/src/dutch/CatDut.gf +++ b/src/dutch/CatDut.gf @@ -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 diff --git a/src/dutch/IdiomDut.gf b/src/dutch/IdiomDut.gf index c57e50d5c..d73fb9652 100644 --- a/src/dutch/IdiomDut.gf +++ b/src/dutch/IdiomDut.gf @@ -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 ; diff --git a/src/dutch/StructuralDut.gf b/src/dutch/StructuralDut.gf index efb45b3e1..542c5b1a7 100644 --- a/src/dutch/StructuralDut.gf +++ b/src/dutch/StructuralDut.gf @@ -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" ; diff --git a/src/dutch/VerbDut.gf b/src/dutch/VerbDut.gf index 9e2167c26..e5e0bf6a8 100644 --- a/src/dutch/VerbDut.gf +++ b/src/dutch/VerbDut.gf @@ -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) ; } diff --git a/src/italian/MakeStructuralIta.gf b/src/italian/MakeStructuralIta.gf index 6df1d5f93..b4e7e18af 100644 --- a/src/italian/MakeStructuralIta.gf +++ b/src/italian/MakeStructuralIta.gf @@ -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 = <>} ; diff --git a/src/polish/VerbMorphoPol.gf b/src/polish/VerbMorphoPol.gf index f5226150e..2e9aa2d63 100644 --- a/src/polish/VerbMorphoPol.gf +++ b/src/polish/VerbMorphoPol.gf @@ -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 { - => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie ; - => nie ++ perf ! (VPraetM gn p) ++ sie ; - => nie ++ perf ! (VPraetM gn p) ++ sie ; - => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3); - => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie; - => nie ++ imperf ! (VCondM gn p) ++ sie; - => nie ++ perf ! (VCondM gn p) ++ sie + => nie ++ imperf ! (VFinM (extract_num!gn) p) ++ sie + ; --# notpresent + => nie ++ perf ! (VPraetM gn p) ++ sie ; --# notpresent + => nie ++ perf ! (VPraetM gn p) ++ sie ; --# notpresent + => nie ++ bedzie ! <(extract_num!gn), p> ++ sie ++ imperf ! (VPraetM gn P3); --# notpresent + => nie ++ perf ! (VFinM (extract_num!gn) p) ++ sie; --# notpresent + => nie ++ imperf ! (VCondM gn p) ++ sie; --# notpresent + => 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 { - => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; - => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; - => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; - => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; - => nie ++ case verb.asp of { - Perfective => zostac ! (VFinM (extract_num!gn) p); - _ => bedzie ! - } ++ verb.ppart ! AF gn Nom; - => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; - => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom; - => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom + => nie ++ byc ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom + ; --# notpresent + => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ byc ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ zostac ! (VPraetM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ case verb.asp of { --# notpresent + Perfective => zostac ! (VFinM (extract_num!gn) p); --# notpresent + _ => bedzie ! --# notpresent + } ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ zostac ! (VFinM (extract_num!gn) p) ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ byc ! (VCondM gn p) ++ verb.ppart ! AF gn Nom; --# notpresent + => nie ++ zostac ! (VCondM gn p) ++ verb.ppart ! AF gn Nom --# notpresent }; bedzie : Number * Person => Str = table { diff --git a/src/romanian/ResRon.gf b/src/romanian/ResRon.gf index 170d89349..8bc9131f3 100644 --- a/src/romanian/ResRon.gf +++ b/src/romanian/ResRon.gf @@ -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 < : RTense * Anteriority * Mood> of { diff --git a/src/turkish/SymbolTur.gf b/src/turkish/SymbolTur.gf new file mode 100644 index 000000000..c6c7ed00f --- /dev/null +++ b/src/turkish/SymbolTur.gf @@ -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 "," ; + + +}