diff --git a/lib/resource-1.0/abstract/Structural.gf b/lib/resource-1.0/abstract/Structural.gf index ddc46f1e1..c56cf7173 100644 --- a/lib/resource-1.0/abstract/Structural.gf +++ b/lib/resource-1.0/abstract/Structural.gf @@ -86,7 +86,6 @@ abstract Structural = Cat ** { this_NP : NP ; those_NP : NP ; those_Quant : QuantPl ; - thou_Pron : Pron ; through_Prep : Prep ; to_Prep : Prep ; too_AdA : AdA ; @@ -106,8 +105,9 @@ abstract Structural = Cat ** { why_IAdv : IAdv ; with_Prep : Prep ; without_Prep : Prep ; - ye_Pron : Pron ; yes_Phr : Phr ; - you_Pron : Pron ; + youSg_Pron : Pron ; + youPl_Pron : Pron ; + youPol_Pron : Pron ; } diff --git a/lib/resource-1.0/english/StructuralEng.gf b/lib/resource-1.0/english/StructuralEng.gf index a1fa6cce2..07a2cba11 100644 --- a/lib/resource-1.0/english/StructuralEng.gf +++ b/lib/resource-1.0/english/StructuralEng.gf @@ -76,14 +76,13 @@ concrete StructuralEng of Structural = CatEng ** this_NP = regNP "this" Sg ; those_NP = regNP "those" Pl ; those_Quant = mkDeterminer Pl "those" ; - thou_Pron = mkNP "you" "you" "your" Sg P2 ; through_Prep = ss "through" ; too_AdA = ss "too" ; to_Prep = ss "to" ; under_Prep = ss "under" ; very_AdA = ss "very" ; want_VV = verbGen "want" ** {c2 = "to"} ; - we_Pron = mkNP "we" "us" "our" Pl P1 ; + we_Pron = mkNP "we" "us" "our" Pl P1 ; whatPl_IP = mkIP "what" "what" "what's" Sg ; whatSg_IP = mkIP "what" "what" "what's" Sg ; when_IAdv = ss "when" ; @@ -96,9 +95,10 @@ concrete StructuralEng of Structural = CatEng ** why_IAdv = ss "why" ; without_Prep = ss "without" ; with_Prep = ss "with" ; - ye_Pron = mkNP "you" "you" "your" Pl P2 ; - you_Pron = mkNP "you" "you" "your" Sg P2 ; yes_Phr = ss "yes" ; + youSg_Pron = mkNP "you" "you" "your" Sg P2 ; + youPl_Pron = mkNP "you" "you" "your" Pl P2 ; + youPol_Pron = mkNP "you" "you" "your" Sg P2 ; } diff --git a/lib/resource-1.0/french/StructuralFre.gf b/lib/resource-1.0/french/StructuralFre.gf index 9a2c548e4..88e37b127 100644 --- a/lib/resource-1.0/french/StructuralFre.gf +++ b/lib/resource-1.0/french/StructuralFre.gf @@ -59,7 +59,7 @@ lin most_Predet = {s = \\_,c => prepCase c ++ ["la plupart"] ; c = CPrep P_de} ; much_Det = {s = \\_,c => prepCase c ++ "beaucoup" ++ elisDe ; n = Pl} ; must_VV = mkVV (devoir_V2 ** {lock_V = <>}) ; - no_Phr = ss "non" ; --- and also Si! + no_Phr = ss "non" ; on_Prep = mkPreposition "sur" ; one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "une" ! g} ; only_Predet = {s = \\_,c => prepCase c ++ "seulement" ; c = Nom} ; --- seul(e)(s) @@ -95,9 +95,6 @@ lin this_NP = pn2np (mkPN ["ceci"] Masc) ; those_NP = pn2np (mkPN ["celles-là"] Fem) ; those_Quant = {s = \\_,c => prepCase c ++ "ces"} ; ---- là - thou_Pron = mkPronoun - "tu" (elision "t") (elision "t") "toi" "ton" (elisPoss "t") "tes" - Fem Sg P2 Clit1 ; through_Prep = mkPreposition "par" ; too_AdA = ss "trop" ; to_Prep = complDat ; @@ -119,11 +116,14 @@ lin why_IAdv = ss "pourquoi" ; without_Prep = mkPreposition "sans" ; with_Prep = mkPreposition "avec" ; - ye_Pron, you_Pron = + yes_Phr = ss "oui" ; --- si + youSg_Pron = mkPronoun + "tu" (elision "t") (elision "t") "toi" "ton" (elisPoss "t") "tes" + Fem Sg P2 Clit1 ; + youPl_Pron, youPol_Pron = mkPronoun "vous" "vous" "vous" "vous" "votre" "votre" "vos" Fem Pl P2 Clit3 ; - yes_Phr = ss "oui" ; --- si } diff --git a/lib/resource-1.0/german/StructuralGer.gf b/lib/resource-1.0/german/StructuralGer.gf index 0c47d3d7b..b2cb10084 100644 --- a/lib/resource-1.0/german/StructuralGer.gf +++ b/lib/resource-1.0/german/StructuralGer.gf @@ -95,7 +95,6 @@ concrete StructuralGer of Structural = CatGer ** this_NP = nameNounPhrase {s = caselist "dies" "dies" "diesem" "dieses"} ; ---- those_NP = {s = caselist "jene" "jene" "jenen" "jener" ; a = agrP3 Pl} ; those_Quant = detLikeAdj Pl "jen" ; - thou_Pron = mkPronPers "du" "dich" "dir" "deiner" "dein" Sg P2 ; through_Prep = mkPrep "durch" Acc ; too_AdA = ss "zu" ; to_Prep = mkPrep "nach" Dat ; @@ -123,7 +122,9 @@ concrete StructuralGer of Structural = CatGer ** why_IAdv = ss "warum" ; without_Prep = mkPrep "ohne" Acc ; with_Prep = mkPrep "mit" Dat ; - ye_Pron = mkPronPers "ihr" "euch" "euch" "eurer" "euer" Pl P2 ; ---- poss + youSg_Pron = mkPronPers "du" "dich" "dir" "deiner" "dein" Sg P2 ; + youPl_Pron = mkPronPers "ihr" "euch" "euch" "eurer" "euer" Pl P2 ; ---- poss + youPol_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Pl P3 ; yes_Phr = ss ["Ja ."] ; - you_Pron = mkPronPers "Sie" "Sie" "Ihnen" "Ihrer" "Ihr" Pl P3 ; + } diff --git a/lib/resource-1.0/scandinavian/AdjectiveScand.gf b/lib/resource-1.0/scandinavian/AdjectiveScand.gf index 5ae5bbe42..9f0e4a2a4 100644 --- a/lib/resource-1.0/scandinavian/AdjectiveScand.gf +++ b/lib/resource-1.0/scandinavian/AdjectiveScand.gf @@ -1,5 +1,5 @@ incomplete concrete AdjectiveScand of Adjective = - CatScand ** open DiffScand, ResScand, Prelude in { + CatScand ** open CommonScand, ResScand, Prelude in { lin diff --git a/lib/resource-1.0/scandinavian/AdverbScand.gf b/lib/resource-1.0/scandinavian/AdverbScand.gf index eec9d3e95..847b006fc 100644 --- a/lib/resource-1.0/scandinavian/AdverbScand.gf +++ b/lib/resource-1.0/scandinavian/AdverbScand.gf @@ -1,4 +1,4 @@ -incomplete concrete AdverbScand of Adverb = CatScand ** open DiffScand, ResScand, Prelude in { +incomplete concrete AdverbScand of Adverb = CatScand ** open CommonScand, ResScand, Prelude in { lin PositAdvAdj a = { diff --git a/lib/resource-1.0/scandinavian/CatScand.gf b/lib/resource-1.0/scandinavian/CatScand.gf index bfca2033a..93ee17801 100644 --- a/lib/resource-1.0/scandinavian/CatScand.gf +++ b/lib/resource-1.0/scandinavian/CatScand.gf @@ -1,5 +1,5 @@ incomplete concrete CatScand of Cat = - open ResScand, Prelude, DiffScand, (R = ParamX) in { + open ResScand, Prelude, CommonScand, (R = ParamX) in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/ConjunctionScand.gf b/lib/resource-1.0/scandinavian/ConjunctionScand.gf index 25ae49a30..bff2b4031 100644 --- a/lib/resource-1.0/scandinavian/ConjunctionScand.gf +++ b/lib/resource-1.0/scandinavian/ConjunctionScand.gf @@ -1,5 +1,5 @@ incomplete concrete ConjunctionScand of Conjunction = - CatScand ** open ResScand, Coordination, Prelude in { + CatScand ** open CommonScand, ResScand, Coordination, Prelude in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/DiffScand.gf b/lib/resource-1.0/scandinavian/DiffScand.gf index bc5b341bc..9a3fa2a9e 100644 --- a/lib/resource-1.0/scandinavian/DiffScand.gf +++ b/lib/resource-1.0/scandinavian/DiffScand.gf @@ -1,4 +1,4 @@ -interface DiffScand = open ResScand, Prelude in { +interface DiffScand = open CommonScand, Prelude in { -- Parameters. @@ -47,69 +47,7 @@ interface DiffScand = open ResScand, Prelude in { pronSuch : GenNum => Str ; ------------------------------------------------------------------------ --- --- The functions and parameters below are here because they depend on --- the parametrized constants, but their definitions are fully given --- here relative to the above. - - param - CardOrd = NCard Gender | NOrd AFormSup ; -- sic! (AFormSup) - - oper - agrP3 : Gender -> Number -> Agr = \g,n -> { - gn = gennum g n ; - p = P3 - } ; - - Noun = {s : Number => Species => Case => Str ; g : Gender} ; - - --- This function is here because it depends on $verbHave, auxFut, auxCond$. - - predV : Verb -> VP = \verb -> - let - diath = case verb.vtype of { - VPass => Pass ; - _ => Act - } ; - vfin : Tense -> Str = \t -> verb.s ! vFin t diath ; - vsup = verb.s ! VI (VSupin diath) ; - vinf = verb.s ! VI (VInfin diath) ; - - har : Tense -> Str = \t -> verbHave.s ! vFin t Act ; - ha : Str = verbHave.s ! VI (VInfin Act) ; - - vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> { - fin = fin ; inf = inf - } ; - - in { - s = table { - VPFinite t Simul => case t of { - Pres | Past => vf (vfin t) [] ; - Fut => vf auxFut vinf ; - Cond => vf auxCond vinf - } ; - VPFinite t Anter => case t of { - Pres | Past => vf (har t) vsup ; - Fut => vf auxFut (ha ++ vsup) ; - Cond => vf auxCond (ha ++ vsup) - } ; - VPImperat => vf (verb.s ! VF (VImper diath)) [] ; - VPInfinit Simul => vf [] vinf ; - VPInfinit Anter => vf [] (ha ++ vsup) - } ; - a1 : Polarity => Str = negation ; - n2 : Agr => Str = \\a => case verb.vtype of { - VRefl => reflPron a ; - _ => [] - } ; - a2 : Str = [] ; - ext : Str = [] ; - en2,ea2,eext : Bool = False -- indicate if the field exists - } ; - -reflPron : Agr -> Str ; + reflPron : Agr -> Str ; } + diff --git a/lib/resource-1.0/scandinavian/ExtScand.gf b/lib/resource-1.0/scandinavian/ExtScand.gf index 323e16790..7ec98ea9e 100644 --- a/lib/resource-1.0/scandinavian/ExtScand.gf +++ b/lib/resource-1.0/scandinavian/ExtScand.gf @@ -1,5 +1,5 @@ incomplete concrete ExtScand of ExtScandAbs = - CatScand ** open DiffScand, ResScand in { + CatScand ** open CommonScand, ResScand in { lin DefSgN predet noun = let g = noun.g in { diff --git a/lib/resource-1.0/scandinavian/NounScand.gf b/lib/resource-1.0/scandinavian/NounScand.gf index 853e489d2..1b46df831 100644 --- a/lib/resource-1.0/scandinavian/NounScand.gf +++ b/lib/resource-1.0/scandinavian/NounScand.gf @@ -1,5 +1,5 @@ incomplete concrete NounScand of Noun = - CatScand ** open DiffScand, ResScand, Prelude in { + CatScand ** open CommonScand, ResScand, Prelude in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/PhraseScand.gf b/lib/resource-1.0/scandinavian/PhraseScand.gf index feae4f76b..5aa702491 100644 --- a/lib/resource-1.0/scandinavian/PhraseScand.gf +++ b/lib/resource-1.0/scandinavian/PhraseScand.gf @@ -1,5 +1,5 @@ incomplete concrete PhraseScand of Phrase = - CatScand, TenseX ** open DiffScand, ResScand, Prelude in { + CatScand, TenseX ** open CommonScand, ResScand, Prelude in { lin PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; diff --git a/lib/resource-1.0/scandinavian/QuestionScand.gf b/lib/resource-1.0/scandinavian/QuestionScand.gf index 8444f4427..fa90c20b3 100644 --- a/lib/resource-1.0/scandinavian/QuestionScand.gf +++ b/lib/resource-1.0/scandinavian/QuestionScand.gf @@ -1,5 +1,5 @@ incomplete concrete QuestionScand of Question = - CatScand ** open DiffScand, ResScand in { + CatScand ** open CommonScand, ResScand in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/RelativeScand.gf b/lib/resource-1.0/scandinavian/RelativeScand.gf index cefc682fe..51dd8dfc8 100644 --- a/lib/resource-1.0/scandinavian/RelativeScand.gf +++ b/lib/resource-1.0/scandinavian/RelativeScand.gf @@ -1,5 +1,5 @@ incomplete concrete RelativeScand of Relative = - CatScand ** open DiffScand, ResScand in { + CatScand ** open CommonScand, ResScand in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/ResScand.gf b/lib/resource-1.0/scandinavian/ResScand.gf index b19330e3c..54ad3a23c 100644 --- a/lib/resource-1.0/scandinavian/ResScand.gf +++ b/lib/resource-1.0/scandinavian/ResScand.gf @@ -1,193 +1,63 @@ -----1 Scandinavian auxiliary operations. --- ----- This module contains operations that are needed to make the ----- resource syntax work. To define everything that is needed to ----- implement $Test$, it moreover contains regular lexical ----- patterns needed for $Lex$. --- -resource ResScand = ParamScand ** open Prelude in { +--1 Scandinavian auxiliary operations - flags optimize=all ; +interface ResScand = DiffScand ** open CommonScand, Prelude in { - oper +--2 Constants uniformly defined in terms of language-dependent constants --- For $Lex$. + param + CardOrd = NCard Gender | NOrd AFormSup ; -- sic! (AFormSup) --- For each lexical category, here are the worst-case constructors. --- --- But $mkNoun$ is fully defined only for each language, since --- $Gender$ varies. + oper + agrP3 : Gender -> Number -> Agr = \g,n -> { + gn = gennum g n ; + p = P3 + } ; - nounForms : (x1,_,_,x4 : Str) -> (Number => Species => Case => Str) = - \man,mannen,men,mennen -> \\n,d,c => case of { - => mkCase c man ; - => mkCase c mannen ; - => mkCase c men ; - => mkCase c mennen + Noun = {s : Number => Species => Case => Str ; g : Gender} ; + +-- This function is here because it depends on $verbHave, auxFut, auxCond$. + + predV : Verb -> VP = \verb -> + let + diath = case verb.vtype of { + VPass => Pass ; + _ => Act + } ; + vfin : Tense -> Str = \t -> verb.s ! vFin t diath ; + vsup = verb.s ! VI (VSupin diath) ; + vinf = verb.s ! VI (VInfin diath) ; + + har : Tense -> Str = \t -> verbHave.s ! vFin t Act ; + ha : Str = verbHave.s ! VI (VInfin Act) ; + + vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> { + fin = fin ; inf = inf } ; - Adjective : Type = {s : AForm => Str} ; - - mkAdjective : (x1,_,_,_,_,_,x7 : Str) -> {s : AForm => Str} = - \liten, litet, lilla, sma, mindre, minst, minsta -> { + in { s = table { - AF (APosit a) c => mkCase c (mkAdjPos a liten litet lilla sma) ; - AF ACompar c => mkCase c mindre ; - AF (ASuperl SupStrong) c => mkCase c minst ; - AF (ASuperl SupWeak) c => mkCase c minsta - } - } ; - - mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> {s : VForm => Str ; vtype : VType} = - \finna,finner,finn,fann,funnit,funnen,funnet,funna -> { - s = table { - VF (VPres Act) => finner ; - VF (VPres Pass) => mkVoice Pass finn ; - VF (VPret v) => mkVoice v fann ; - VF (VImper v) => mkVoice v finn ; - VI (VInfin v) => mkVoice v finna ; - VI (VSupin v) => mkVoice v funnit ; - VI (VPtPret a c)=> mkCase c (mkAdjPos a funnen funnet funna funna) - } ; - vtype = VAct - } ; - --- These are useful auxiliaries. - - mkCase : Case -> Str -> Str = \c,f -> case c of { - Nom => f ; - Gen => f + case last f of { - "s" | "x" => [] ; - _ => "s" - } - } ; - - mkAdjPos : AFormPos -> (s1,_,_,s4 : Str) -> Str = - \a, liten, litet, lilla, sma -> - case a of { - Strong gn => case gn of { - SgUtr => liten ; - SgNeutr => litet ; - Plg => sma - } ; - Weak Sg => lilla ; - Weak Pl => sma - } ; - - mkVoice : Voice -> Str -> Str = \v,s -> case v of { - Act => s ; - Pass => s + case last s of { - "s" => "es" ; - _ => "s" - } - } ; - - --- For $Noun$. - - artDef : GenNum -> Str = \gn -> gennumForms "den" "det" "de" ! gn ; - - mkNP : (x1,_,_,_,x5 : Str) -> GenNum -> Person -> - {s : NPForm => Str ; a : Agr} = \du,dig,din,ditt,dina,gn,p -> { - s = table { - NPNom => du ; - NPAcc => dig ; - NPPoss g => gennumForms din ditt dina ! g - } ; - a = { - gn = gn ; - p = p - } - } ; - - gennumForms : (x1,x2,x3 : Str) -> GenNum => Str = \den,det,de -> - table { - SgUtr => den ; - SgNeutr => det ; - _ => de - } ; - - regNP : Str -> Str -> GenNum -> {s : NPForm => Str ; a : Agr} = - \det,dess,gn -> - mkNP det det dess dess dess gn P3 ; - - --- For $Verb$. - - Verb : Type = { - s : VForm => Str ; - vtype : VType - } ; - - VP = { - s : VPForm => { - fin : Str ; -- V1 har ---s1 - inf : Str -- V2 sagt ---s4 + VPFinite t Simul => case t of { + Pres | Past => vf (vfin t) [] ; + Fut => vf auxFut vinf ; + Cond => vf auxCond vinf } ; - a1 : Polarity => Str ; -- A1 inte ---s3 - n2 : Agr => Str ; -- N2 dig ---s5 - a2 : Str ; -- A2 idag ---s6 - ext : Str ; -- S-Ext att hon går ---s7 - --- ea1,ev2, --- these depend on params of v and a1 - en2,ea2,eext : Bool -- indicate if the field exists + VPFinite t Anter => case t of { + Pres | Past => vf (har t) vsup ; + Fut => vf auxFut (ha ++ vsup) ; + Cond => vf auxCond (ha ++ vsup) + } ; + VPImperat => vf (verb.s ! VF (VImper diath)) [] ; + VPInfinit Simul => vf [] vinf ; + VPInfinit Anter => vf [] (ha ++ vsup) } ; - - - insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { - s = vp.s ; - a1 = vp.a1 ; - n2 = \\a => vp.n2 ! a ++ obj ! a ; - a2 = vp.a2 ; - ext = vp.ext ; - en2 = True ; - ea2 = vp.ea2 ; - eext = vp.eext - } ; - - insertAdv : Str -> VP -> VP = \adv,vp -> { - s = vp.s ; - a1 = vp.a1 ; - n2 = vp.n2 ; - a2 = vp.a2 ++ adv ; - ext = vp.ext ; - en2 = vp.en2 ; - ea2 = True ; - eext = vp.eext - } ; - - insertAdV : Str -> VP -> VP = \adv,vp -> { - s = vp.s ; - a1 = \\b => vp.a1 ! b ++ adv ; - n2 = vp.n2 ; - a2 = vp.a2 ; - ext = vp.ext ; - en2 = vp.en2 ; - ea2 = vp.ea2 ; - eext = vp.eext - } ; - - infVP : VP -> Agr -> Str = \vp,a -> - (vp.s ! VPInfinit Simul).inf ++ vp.n2 ! a ++ vp.a2 ++ vp.ext ; --- a1 - - --- For $Sentence$. - - Clause : Type = { - s : Tense => Anteriority => Polarity => Order => Str - } ; - - mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { - s = \\t,a,b,o => - let - verb = vp.s ! VPFinite t a ; - neg = vp.a1 ! b ; - compl = vp.n2 ! agr ++ vp.a2 ++ vp.ext - in - case o of { - Main => subj ++ verb.fin ++ neg ++ verb.inf ++ compl ; - Inv => verb.fin ++ subj ++ neg ++ verb.inf ++ compl ; - Sub => subj ++ neg ++ verb.fin ++ verb.inf ++ compl - } + a1 : Polarity => Str = negation ; + n2 : Agr => Str = \\a => case verb.vtype of { + VRefl => reflPron a ; + _ => [] + } ; + a2 : Str = [] ; + ext : Str = [] ; + en2,ea2,eext : Bool = False -- indicate if the field exists } ; } diff --git a/lib/resource-1.0/scandinavian/SentenceScand.gf b/lib/resource-1.0/scandinavian/SentenceScand.gf index 6f657553d..a4dc19470 100644 --- a/lib/resource-1.0/scandinavian/SentenceScand.gf +++ b/lib/resource-1.0/scandinavian/SentenceScand.gf @@ -1,5 +1,5 @@ incomplete concrete SentenceScand of Sentence = - CatScand ** open DiffScand, ResScand in { + CatScand ** open CommonScand, ResScand in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/scandinavian/VerbScand.gf b/lib/resource-1.0/scandinavian/VerbScand.gf index f19e93d2d..9a94b2b5f 100644 --- a/lib/resource-1.0/scandinavian/VerbScand.gf +++ b/lib/resource-1.0/scandinavian/VerbScand.gf @@ -1,4 +1,4 @@ -incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in { +incomplete concrete VerbScand of Verb = CatScand ** open CommonScand, ResScand in { flags optimize=all_subs ; diff --git a/lib/resource-1.0/swedish/AdjectiveSwe.gf b/lib/resource-1.0/swedish/AdjectiveSwe.gf index cdcde3831..00603805b 100644 --- a/lib/resource-1.0/swedish/AdjectiveSwe.gf +++ b/lib/resource-1.0/swedish/AdjectiveSwe.gf @@ -1,2 +1,2 @@ concrete AdjectiveSwe of Adjective = CatSwe ** AdjectiveScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/AdverbSwe.gf b/lib/resource-1.0/swedish/AdverbSwe.gf index 731130296..4ecd8aff4 100644 --- a/lib/resource-1.0/swedish/AdverbSwe.gf +++ b/lib/resource-1.0/swedish/AdverbSwe.gf @@ -1,2 +1,2 @@ concrete AdverbSwe of Adverb = CatSwe ** AdverbScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/CatSwe.gf b/lib/resource-1.0/swedish/CatSwe.gf index 3b975e962..51b5e4a4f 100644 --- a/lib/resource-1.0/swedish/CatSwe.gf +++ b/lib/resource-1.0/swedish/CatSwe.gf @@ -1,2 +1,2 @@ concrete CatSwe of Cat = CatScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/ConjunctionSwe.gf b/lib/resource-1.0/swedish/ConjunctionSwe.gf index 43a288df1..dca410032 100644 --- a/lib/resource-1.0/swedish/ConjunctionSwe.gf +++ b/lib/resource-1.0/swedish/ConjunctionSwe.gf @@ -1,2 +1,2 @@ concrete ConjunctionSwe of Conjunction = CatSwe ** ConjunctionScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/DiffSwe.gf b/lib/resource-1.0/swedish/DiffSwe.gf index 8a5592b8a..a79654b1b 100644 --- a/lib/resource-1.0/swedish/DiffSwe.gf +++ b/lib/resource-1.0/swedish/DiffSwe.gf @@ -1,4 +1,4 @@ -instance DiffSwe of DiffScand = open ResScand, Prelude in { +instance DiffSwe of DiffScand = open CommonScand, Prelude in { -- Parameters. @@ -53,14 +53,6 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in { Neutr => allt } ; - reflPron : Agr -> Str = \a -> case a of { - {gn = Plg ; p = P1} => "oss" ; - {gn = Plg ; p = P2} => "er" ; - {p = P1} => "mig" ; - {p = P2} => "dig" ; - {p = P3} => "sig" - } ; - relPron : GenNum => RCase => Str = \\gn,c => case c of { RNom => "som" ; RGen => "vars" ; @@ -69,6 +61,12 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in { pronSuch = gennumForms "sådan" "sådant" "sådana" ; - + reflPron : Agr -> Str = \a -> case a of { + {gn = Plg ; p = P1} => "oss" ; + {gn = Plg ; p = P2} => "er" ; + {p = P1} => "mig" ; + {p = P2} => "dig" ; + {p = P3} => "sig" + } ; } diff --git a/lib/resource-1.0/swedish/MorphoSwe.gf b/lib/resource-1.0/swedish/MorphoSwe.gf index f5dc7af09..853b9f36c 100644 --- a/lib/resource-1.0/swedish/MorphoSwe.gf +++ b/lib/resource-1.0/swedish/MorphoSwe.gf @@ -8,7 +8,7 @@ -- syntax. To build a lexicon, it is better to use $ParadigmsSwe$, which -- gives a higher-level access to this module. -resource MorphoSwe = ResScand, DiffSwe ** open Prelude, (Predef=Predef) in { +resource MorphoSwe = CommonScand, ResSwe ** open Prelude, (Predef=Predef) in { -- Nouns diff --git a/lib/resource-1.0/swedish/NounSwe.gf b/lib/resource-1.0/swedish/NounSwe.gf index aa5d48a68..d866558a4 100644 --- a/lib/resource-1.0/swedish/NounSwe.gf +++ b/lib/resource-1.0/swedish/NounSwe.gf @@ -1,2 +1,2 @@ concrete NounSwe of Noun = CatSwe ** NounScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/ParadigmsSwe.gf b/lib/resource-1.0/swedish/ParadigmsSwe.gf index bd8803132..e3b7e83e2 100644 --- a/lib/resource-1.0/swedish/ParadigmsSwe.gf +++ b/lib/resource-1.0/swedish/ParadigmsSwe.gf @@ -28,8 +28,8 @@ resource ParadigmsSwe = open (Predef=Predef), Prelude, - ResScand, - DiffSwe, + CommonScand, + ResSwe, MorphoSwe, CatSwe in { @@ -280,9 +280,9 @@ oper -- hidden from the document. --. - Gender = DiffSwe.Gender ; - Number = ResScand.Number ; - Case = ResScand.Case ; + Gender = ResSwe.Gender ; + Number = CommonScand.Number ; + Case = CommonScand.Case ; utrum = Utr ; neutrum = Neutr ; singular = Sg ; diff --git a/lib/resource-1.0/swedish/PhraseSwe.gf b/lib/resource-1.0/swedish/PhraseSwe.gf index 41183723f..c1ce445ef 100644 --- a/lib/resource-1.0/swedish/PhraseSwe.gf +++ b/lib/resource-1.0/swedish/PhraseSwe.gf @@ -1,2 +1,2 @@ concrete PhraseSwe of Phrase = CatSwe, TenseX ** PhraseScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/QuestionSwe.gf b/lib/resource-1.0/swedish/QuestionSwe.gf index 001cecf53..642fd0353 100644 --- a/lib/resource-1.0/swedish/QuestionSwe.gf +++ b/lib/resource-1.0/swedish/QuestionSwe.gf @@ -1,2 +1,2 @@ concrete QuestionSwe of Question = CatSwe ** QuestionScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/RelativeSwe.gf b/lib/resource-1.0/swedish/RelativeSwe.gf index 2ffc183e5..3bf74a3d6 100644 --- a/lib/resource-1.0/swedish/RelativeSwe.gf +++ b/lib/resource-1.0/swedish/RelativeSwe.gf @@ -1,2 +1,2 @@ concrete RelativeSwe of Relative = CatSwe ** RelativeScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/ResSwe.gf b/lib/resource-1.0/swedish/ResSwe.gf index 7c55e8082..7b5a52a88 100644 --- a/lib/resource-1.0/swedish/ResSwe.gf +++ b/lib/resource-1.0/swedish/ResSwe.gf @@ -1,268 +1,3 @@ -----1 Swedish auxiliary operations. --- ----- This module contains operations that are needed to make the ----- resource syntax work. To define everything that is needed to ----- implement $Test$, it moreover contains regular lexical ----- patterns needed for $Lex$. --- -resource ResSwe = ParamScand, ResScand, DiffSwe ** open Prelude in { +instance ResSwe of ResScand = DiffSwe ** open CommonScand, Prelude in { +} ; - flags optimize=all ; - - oper - --- For $Lex$. - --- For each lexical category, here are the worst-case constructors. - - mkNoun : (_,_,_,_ : Str) -> Gender -> - {s : Number => Species => Case => Str ; g : Gender} = - \man,mannen,men,mennen,g -> { - s = nounForms man mannen men mennen ; - g = g - } ; - --- mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str} = --- \good,better,best,well -> { --- s = table { --- AAdj Posit => good ; --- AAdj Compar => better ; --- AAdj Superl => best ; --- AAdv => well --- } --- } ; --- --- mkVerb : (_,_,_,_,_ : Str) -> {s : VForm => Str} = --- \go,goes,went,gone,going -> { --- s = table { --- VInf => go ; --- VPres => goes ; --- VPast => went ; --- VPPart => gone ; --- VPresPart => going --- } --- } ; --- --- mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = --- \i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ; --- --- mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} = --- \i,me,my,n,p -> { --- s = table { --- Nom => i ; --- Acc => me ; --- Gen => my --- } ; --- a = { --- n = n ; --- p = p --- } --- } ; --- ----- These functions cover many cases; full coverage inflectional patterns are ----- in $MorphoScand$. --- --- regN : Str -> {s : Number => Case => Str} = \car -> --- mkNoun car (car + "'s") (car + "s") (car + "s'") ; --- --- regA : Str -> {s : AForm => Str} = \warm -> --- mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ; --- --- regV : Str -> {s : VForm => Str} = \walk -> --- mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ; --- --- regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> --- mkNP that that (that + "'s") n P3 ; --- ----- We have just a heuristic definition of the indefinite article. ----- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic ----- "o" ("one-sided"), vocalic "u" ("umbrella"). --- --- artIndef = pre { --- "a" ; --- "an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" } --- } ; --- --- artDef = "the" ; --- ----- For $Verb$. --- --- Verb : Type = { --- s : VForm => Str --- } ; --- --- VerbForms : Type = --- Tense => Anteriority => Polarity => Ord => Agr => {fin, inf : Str} ; --- --- VP : Type = { --- s : VerbForms ; --- s2 : Agr => Str --- } ; --- --- predV : Verb -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.s ! VInf ; --- fin = presVerb verb agr ; --- past = verb.s ! VPast ; --- part = verb.s ! VPPart ; --- vf : Str -> Str -> {fin, inf : Str} = \x,y -> --- {fin = x ; inf = y} ; --- in --- case of { --- => vf fin [] ; --- => vf (does agr) inf ; --- => vf (doesnt agr) inf ; --- => vf (have agr) part ; --- => vf (havent agr) part ; --- => vf past [] ; --- => vf "did" inf ; --- => vf "didn't" inf ; --- => vf "had" part ; --- => vf "hadn't" part ; --- => vf "will" inf ; --- => vf "won't" inf ; --- => vf "will" ("have" ++ part) ; --- => vf "won't" ("have" ++ part) ; --- => vf "would" inf ; --- => vf "wouldn't" inf ; --- => vf "would" ("have" ++ part) ; --- => vf "wouldn't" ("have" ++ part) --- } ; --- s2 = \\_ => [] --- } ; --- --- predAux : Aux -> VP = \verb -> { --- s = \\t,ant,b,ord,agr => --- let --- inf = verb.inf ; --- fin = verb.pres ! b ! agr ; --- past = verb.past ! b ! agr ; --- part = verb.ppart ; --- vf : Str -> Str -> {fin, inf : Str} = \x,y -> --- {fin = x ; inf = y} ; --- in --- case of { --- => vf fin [] ; --- => vf (have agr) part ; --- => vf (havent agr) part ; --- => vf past [] ; --- => vf "had" part ; --- => vf "hadn't" part ; --- => vf "will" inf ; --- => vf "won't" inf ; --- => vf "will" ("have" ++ part) ; --- => vf "won't" ("have" ++ part) ; --- => vf "would" inf ; --- => vf "wouldn't" inf ; --- => vf "would" ("have" ++ part) ; --- => vf "wouldn't" ("have" ++ part) --- } ; --- s2 = \\_ => [] --- } ; --- --- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { --- s = vp.s ; --- s2 = \\a => vp.s2 ! a ++ obj ! a --- } ; --- ------ This is not functional. --- --- insertAdV : Str -> VP -> VP = \adv,vp -> { --- s = vp.s ; --- s2 = vp.s2 --- } ; --- --- presVerb : {s : VForm => Str} -> Agr -> Str = \verb -> --- agrVerb (verb.s ! VPres) (verb.s ! VInf) ; --- --- infVP : VP -> Agr -> Str = \vp,a -> --- (vp.s ! Fut ! Simul ! Neg ! ODir ! a).inf ++ vp.s2 ! a ; --- --- agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> --- case agr of { --- {n = Sg ; p = P3} => has ; --- _ => have --- } ; --- --- have = agrVerb "has" "have" ; --- havent = agrVerb "hasn't" "haven't" ; --- does = agrVerb "does" "do" ; --- doesnt = agrVerb "doesn't" "don't" ; --- --- Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ; --- --- auxBe : Aux = { --- pres = \\b,a => case of { --- => "am" ; --- => ["am not"] ; --- am not I --- _ => agrVerb (posneg b "is") (posneg b "are") a --- } ; --- past = \\b,a => agrVerb (posneg b "was") (posneg b "were") a ; --- inf = "be" ; --- ppart = "been" --- } ; --- --- posneg : Polarity -> Str -> Str = \p,s -> case p of { --- Pos => s ; --- Neg => s + "n't" --- } ; --- --- conjThat : Str = "that" ; --- --- reflPron : Agr => Str = table { --- {n = Sg ; p = P1} => "myself" ; --- {n = Sg ; p = P2} => "yourself" ; --- {n = Sg ; p = P3} => "itself" ; ---- --- {n = Pl ; p = P1} => "ourselves" ; --- {n = Pl ; p = P2} => "yourselves" ; --- {n = Pl ; p = P3} => "themselves" --- } ; --- ----- For $Sentence$. --- --- Clause : Type = { --- s : Tense => Anteriority => Polarity => Ord => Str --- } ; --- --- mkS : Str -> Agr -> VerbForms -> (Agr => Str) -> Clause = --- \subj,agr,verb,compl0 -> { --- s = \\t,a,b,o => --- let --- verb = verb ! t ! a ! b ! o ! agr ; --- compl = compl0 ! agr --- in --- case o of { --- ODir => subj ++ verb.fin ++ verb.inf ++ compl ; --- OQuest => verb.fin ++ subj ++ verb.inf ++ compl --- } --- } ; --- --- ----- For $Numeral$. --- --- mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} = --- \two, twelve, twenty, second -> --- {s = table { --- unit => table {NCard => two ; NOrd => second} ; --- teen => \\c => mkCard c twelve ; --- ten => \\c => mkCard c twenty --- } --- } ; --- --- regNum : Str -> {s : DForm => CardOrd => Str} = --- \six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ; --- --- regCardOrd : Str -> {s : CardOrd => Str} = \ten -> --- {s = table {NCard => ten ; NOrd => regOrd ten}} ; --- --- mkCard : CardOrd -> Str -> Str = \c,ten -> --- (regCardOrd ten).s ! c ; --- --- regOrd : Str -> Str = \ten -> --- case last ten of { --- "y" => init ten + "ieth" ; --- _ => ten + "th" --- } ; --- -} diff --git a/lib/resource-1.0/swedish/SentenceSwe.gf b/lib/resource-1.0/swedish/SentenceSwe.gf index 82430d5d3..553af3b46 100644 --- a/lib/resource-1.0/swedish/SentenceSwe.gf +++ b/lib/resource-1.0/swedish/SentenceSwe.gf @@ -1,2 +1,2 @@ concrete SentenceSwe of Sentence = CatSwe ** SentenceScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/StructuralSwe.gf b/lib/resource-1.0/swedish/StructuralSwe.gf index 6138e3041..f8a706c5e 100644 --- a/lib/resource-1.0/swedish/StructuralSwe.gf +++ b/lib/resource-1.0/swedish/StructuralSwe.gf @@ -80,7 +80,6 @@ concrete StructuralSwe of Structural = CatSwe ** this_NP = regNP ["det här"] ["det härs"] SgNeutr ; those_NP = regNP ["de där"] ["det därs"] Plg ; those_Quant = {s = \\_,_ => ["de där"] ; n = Pl ; det = DDef Def} ; - thou_Pron = mkNP "du" "dig" "din" "ditt" "dina" SgUtr P2 ; through_Prep = ss "genom" ; too_AdA = ss "för" ; to_Prep = ss "till" ; @@ -102,9 +101,10 @@ concrete StructuralSwe of Structural = CatSwe ** why_IAdv = ss "varför" ; without_Prep = ss "utan" ; with_Prep = ss "med" ; - ye_Pron = mkNP "ni" "er" "er" "ert" "era" Plg P2 ; yes_Phr = ss ["ja"] ; - you_Pron = mkNP "ni" "er" "er" "ert" "era" SgUtr P2 ; --- wrong in refl + youSg_Pron = mkNP "du" "dig" "din" "ditt" "dina" SgUtr P2 ; + youPl_Pron = mkNP "ni" "er" "er" "ert" "era" Plg P2 ; + youPol_Pron = mkNP "ni" "er" "er" "ert" "era" SgUtr P2 ; --- wrong in refl -- Auxiliaries that are used repeatedly. diff --git a/lib/resource-1.0/swedish/TensedSwe.gf b/lib/resource-1.0/swedish/TensedSwe.gf index 1f7d8d331..2767e5cca 100644 --- a/lib/resource-1.0/swedish/TensedSwe.gf +++ b/lib/resource-1.0/swedish/TensedSwe.gf @@ -1,2 +1,2 @@ concrete TensedSwe of Tensed = CatSwe, TenseX ** TensedScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/UntensedSwe.gf b/lib/resource-1.0/swedish/UntensedSwe.gf index c3b830463..50673166b 100644 --- a/lib/resource-1.0/swedish/UntensedSwe.gf +++ b/lib/resource-1.0/swedish/UntensedSwe.gf @@ -1,2 +1,2 @@ concrete UntensedSwe of Untensed = CatSwe ** UntensedScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/swedish/VerbSwe.gf b/lib/resource-1.0/swedish/VerbSwe.gf index 4814d2d13..e918f4809 100644 --- a/lib/resource-1.0/swedish/VerbSwe.gf +++ b/lib/resource-1.0/swedish/VerbSwe.gf @@ -1,2 +1,2 @@ concrete VerbSwe of Verb = CatSwe ** VerbScand with - (DiffScand = DiffSwe) ; + (ResScand = ResSwe) ; diff --git a/lib/resource/doc/gf-resource.html b/lib/resource/doc/gf-resource.html index 760a6f70c..570cf09d3 100644 --- a/lib/resource/doc/gf-resource.html +++ b/lib/resource/doc/gf-resource.html @@ -994,11 +994,11 @@ The structure looks like this. Danish - X -- - - English X X XX X X Finnish X + -X X 0 -French X X -X X X +French X X XX X X German X - XX - - Italian X X -X X X Norwegian - X -X X X -Russian X * -* - - +Russian X X -* - - Spanish - X -X X X Swedish X X XX X X