diff --git a/examples/stoneage/StoneageFre.gf b/examples/stoneage/StoneageFre.gf index 6696b2659..56f719d74 100644 --- a/examples/stoneage/StoneageFre.gf +++ b/examples/stoneage/StoneageFre.gf @@ -66,9 +66,9 @@ lin Fly = PresV fly_V ; Walk = PresV walk_V ; Come = PresV come_V ; - Lie = PresV lie_V ; - Sit = PresV sit_V ; - Stand = PresV stand_V ; + Lie = PresReflV lie_V ; + Sit = PresReflV sit_V ; + Stand = PresReflV stand_V ; Turn = PresV turn_V ; Fall = PresV fall_V ; Sing = PresV sing_V ; diff --git a/examples/stoneage/StoneageResFre.gf b/examples/stoneage/StoneageResFre.gf index c1aedf59a..cd5c90a5a 100644 --- a/examples/stoneage/StoneageResFre.gf +++ b/examples/stoneage/StoneageResFre.gf @@ -8,6 +8,10 @@ oper PresCl (insertObject (mkSatsObject s v o) v.c3 v.s3 r) ; PresVasV2 : V -> NP -> NP -> Phr = \ v -> PresV2 (dirV2 v) ; + PresReflV : V -> NP -> Phr = \v,s -> + PresCl (insertObject (mkSats s v) accusative.p1 [] + (reflPronNounPhrase (pgen2gen s.g) s.n s.p)) ; + PresCl : Sats -> Phr = \c -> {s = (UseCl (PosTP TPresent ASimul) (sats2clause c ** {lock_Cl = <>}) diff --git a/lib/resource/danish/MorphoDan.gf b/lib/resource/danish/MorphoDan.gf index 8338791bb..ec0a88da7 100644 --- a/lib/resource/danish/MorphoDan.gf +++ b/lib/resource/danish/MorphoDan.gf @@ -226,6 +226,8 @@ oper mkTal : Str -> Str -> Str -> {s : DForm => Str} = \to, tolv, tyve -> {s = table {ental => to ; ton => tolv ; tiotal => tyve}} ; oper regTal : Str -> {s : DForm => Str} = \fem -> mkTal fem (fem + "ton") (fem + "tio") ; + numPl : Str -> {s : Gender => Str ; n : Number} = \n -> + {s = \\_ => n ; n = Pl} ; } diff --git a/lib/resource/danish/NumeralsDan.gf b/lib/resource/danish/NumeralsDan.gf index b243b94da..b96865333 100644 --- a/lib/resource/danish/NumeralsDan.gf +++ b/lib/resource/danish/NumeralsDan.gf @@ -1,13 +1,14 @@ -- AR 12/10/2002 following www.geocities.com/tsca.geo/dansk/dknummer.html -concrete NumeralsDan of Numerals = open Prelude, MorphoDan in { +concrete NumeralsDan of Numerals = open Prelude, TypesDan, MorphoDan in { -lincat Numeral = {s : Str} ; -lincat Digit = {s : DForm => Str} ; -lincat Sub10 = {s : DForm => Str} ; -lincat Sub100 = {s : Str} ; -lincat Sub1000 = {s : Str} ; -lincat Sub1000000 = {s : Str} ; +lincat + Numeral = {s : Gender => Str ; n : Number} ; + Digit = {s : DForm => Str} ; + Sub10 = {s : DForm => Gender => Str ; n : Number} ; + Sub100 = {s : Gender => Str ; n : Number} ; + Sub1000 = {s : Gender => Str ; n : Number} ; + Sub1000000 = {s : Gender => Str ; n : Number} ; lin num x = x ; @@ -20,18 +21,20 @@ lin n7 = mkTal "syv" "sytten" "halvfjerds" ; lin n8 = mkTal "otte" "atten" "firs" ; lin n9 = mkTal "ni" "nitten" "halvfems" ; -lin pot01 = {s = table {f => "en"}} ; --- -lin pot0 d = {s = table {f => d.s ! f}} ; -lin pot110 = ss "ti" ; -lin pot111 = ss "elleve" ; -lin pot1to19 d = ss (d.s ! ton) ; -lin pot0as1 n = ss (n.s ! ental) ; -lin pot1 d = ss (d.s ! tiotal) ; -lin pot1plus d e = ss (e.s ! ental ++ "og" ++ d.s ! tiotal) ; -lin pot1as2 n = n ; -lin pot2 d = ss (d.s ! ental ++ "hundrede") ; -lin pot2plus d e = ss (d.s ! ental ++ "hundrede" ++ "og" ++ e.s) ; -lin pot2as3 n = n ; -lin pot3 n = ss (n.s ++ "tusind") ; -lin pot3plus n m = ss (n.s ++ "tusind" ++ "og" ++ m.s) ; --- + pot01 = {s = table {f => table {Neutr => "et" ; _ => "en"}} ; n = Sg} ; + pot0 d = {s = \\f,g => d.s ! f ; n = Pl} ; + pot110 = numPl "ti" ; + pot111 = numPl "elleve" ; + pot1to19 d = numPl (d.s ! ton) ; + pot0as1 n = {s = n.s ! ental ; n = n.n} ; + pot1 d = numPl (d.s ! tiotal) ; + pot1plus d e = {s = \\g => e.s ! ental ! g ++ "og" ++ d.s ! tiotal ; n = Pl} ; + pot1as2 n = n ; + pot2 d = numPl (d.s ! ental ! Neutr ++ "hundrede") ; + pot2plus d e = + {s = \\g => d.s ! ental ! Neutr ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ; + pot2as3 n = n ; + pot3 n = numPl (n.s ! Neutr ++ "tusind") ; + pot3plus n m = {s = \\g => n.s ! Neutr ++ "tusind" ++ "og" ++ m.s ! g ; n = Pl} ; + } \ No newline at end of file diff --git a/lib/resource/danish/StructuralDan.gf b/lib/resource/danish/StructuralDan.gf index 5e3f26950..c4c8e9ce2 100644 --- a/lib/resource/danish/StructuralDan.gf +++ b/lib/resource/danish/StructuralDan.gf @@ -11,7 +11,10 @@ concrete StructuralDan of Structural = lin - UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; --- + UseNumeral i = { + s = \\g => table {Nom => i.s ! g ; Gen => i.s ! g ++ "s"} ; --- + n = i.n + } ; above_Prep = ss "ovenfor" ; after_Prep = ss "efter" ; diff --git a/lib/resource/english/CategoriesEng.gf b/lib/resource/english/CategoriesEng.gf index 4005ed159..eda6cf4aa 100644 --- a/lib/resource/english/CategoriesEng.gf +++ b/lib/resource/english/CategoriesEng.gf @@ -38,7 +38,7 @@ lincat N2 = Function ; -- = CommNounPhrase ** {s2 : Preposition} ; N3 = Function ** {s3 : Preposition} ; - Num = {s : Case => Str} ; + Num = {s : Case => Str ; n : Number} ; Prep = {s : Str} ; A = Adjective ; diff --git a/lib/resource/english/NumeralsEng.gf b/lib/resource/english/NumeralsEng.gf index 30fbe6fe9..fa8198859 100644 --- a/lib/resource/english/NumeralsEng.gf +++ b/lib/resource/english/NumeralsEng.gf @@ -1,8 +1,11 @@ concrete NumeralsEng of Numerals = open Prelude, MorphoEng in { -lincat Numeral = { s : Str } ; +lincat Numeral = {s : Str ; n : Number} ; lincat Digit = {s : DForm => Str} ; -lincat Sub10 = {s : DForm => Str} ; +lincat Sub10 = {s : DForm => Str ; n : Number} ; + Sub100 = {s : Str ; n : Number} ; + Sub1000 = {s : Str ; n : Number} ; + Sub1000000 = {s : Str ; n : Number} ; lin num x = x ; lin n2 = mkNum "two" "twelve" "twenty" ; @@ -14,19 +17,19 @@ lin n7 = regNum "seven" ; lin n8 = mkNum "eight" "eighteen" "eighty" ; lin n9 = regNum "nine" ; -lin pot01 = {s = table {f => "one"}} ; -lin pot0 d = {s = table {f => d.s ! f}} ; -lin pot110 = ss "ten" ; -lin pot111 = ss "eleven" ; -lin pot1to19 d = {s = d.s ! teen} ; -lin pot0as1 n = {s = n.s ! unit} ; -lin pot1 d = {s = d.s ! ten} ; -lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ; +lin pot01 = {s = table {f => "one"} ; n = Sg} ; +lin pot0 d = {s = table {f => d.s ! f} ; n = Pl} ; +lin pot110 = ss "ten" ** {n = Pl} ; +lin pot111 = ss "eleven" ** {n = Pl} ; +lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; +lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; +lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; +lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ** {n = Pl} ; lin pot1as2 n = n ; -lin pot2 d = {s = d.s ! unit ++ "hundred"} ; -lin pot2plus d e = {s = d.s ! unit ++ "hundred" ++ "and" ++ e.s} ; +lin pot2 d = {s = d.s ! unit ++ "hundred"} ** {n = Pl} ; +lin pot2plus d e = {s = d.s ! unit ++ "hundred" ++ "and" ++ e.s} ** {n = Pl} ; lin pot2as3 n = n ; -lin pot3 n = {s = n.s ++ "thousand"} ; -lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ; +lin pot3 n = {s = n.s ++ "thousand"} ** {n = Pl} ; +lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ** {n = Pl} ; } diff --git a/lib/resource/english/RulesEng.gf b/lib/resource/english/RulesEng.gf index f346e1e63..a47f295eb 100644 --- a/lib/resource/english/RulesEng.gf +++ b/lib/resource/english/RulesEng.gf @@ -60,7 +60,7 @@ lin ModGenOne = npGenDet singular noNum ; ModGenNum = npGenDet plural ; - UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; --- + UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"} ; n = Pl} ; --- NoNum = noNum ; UseA = adj2adjPhrase ; diff --git a/lib/resource/english/StructuralEng.gf b/lib/resource/english/StructuralEng.gf index 7c446ae4c..2e6b0d62a 100644 --- a/lib/resource/english/StructuralEng.gf +++ b/lib/resource/english/StructuralEng.gf @@ -10,7 +10,7 @@ concrete StructuralEng of Structural = flags optimize=all ; lin - UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; --- + UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"} ; n = i.n} ; --- above_Prep = ss "above" ; diff --git a/lib/resource/english/SyntaxEng.gf b/lib/resource/english/SyntaxEng.gf index 14d7e5082..fd2f76831 100644 --- a/lib/resource/english/SyntaxEng.gf +++ b/lib/resource/english/SyntaxEng.gf @@ -75,13 +75,13 @@ oper -- The following construction has to be refined for genitive forms: -- "we two", "us two" are OK, but "our two" is not. - Numeral : Type = {s : Case => Str} ; + Numeral : Type = {s : Case => Str ; n : Number} ; pronWithNum : Pronoun -> Numeral -> Pronoun = \we,two -> {s = \\c => we.s ! c ++ two.s ! toCase c ; n = we.n ; p = we.p ; g = human} ; - noNum : Numeral = {s = \\_ => []} ; + noNum : Numeral = {s = \\_ => [] ; n = Pl} ; pronNounPhrase : Pronoun -> NounPhrase = \pro -> {s = pro.s ; a = toAgr pro.n pro.p pro.g} ; @@ -101,13 +101,13 @@ oper numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase = \all, six, men -> - {s = \\c => all.s ++ six.s ! Nom ++ men.s ! Pl ! toCase c ; - a = toAgr Pl P3 men.g + {s = \\c => all.s ++ six.s ! Nom ++ men.s ! six.n ! toCase c ; + a = toAgr six.n P3 men.g } ; justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase = \all, six -> {s = \\c => all.s ++ six.s ! toCase c ; - a = toAgr Pl P3 Neutr --- gender does not matter + a = toAgr six.n P3 Neutr --- gender does not matter } ; mkDeterminer : Number -> Str -> Determiner = \n,the -> @@ -142,9 +142,14 @@ oper \n,two,man -> {s = \\c => case n of { Sg => artIndef ++ two.s ! Nom ++ man.s ! n ! toCase c ; - Pl => two.s ! Nom ++ man.s ! n ! toCase c + Pl => two.s ! Nom ++ man.s ! two.n ! toCase c } ; - a = toAgr n P3 man.g + a = toAgr nb P3 man.g where { + nb = case of { + => Pl ; + _ => Sg + } + } } ; defNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n -> diff --git a/lib/resource/french/ParadigmsFre.gf b/lib/resource/french/ParadigmsFre.gf index 8ab7f0b61..86d74cc2e 100644 --- a/lib/resource/french/ParadigmsFre.gf +++ b/lib/resource/french/ParadigmsFre.gf @@ -296,7 +296,7 @@ oper {s = np.s ; g = np.g ; p = np.p ; c = np.c ; n = n ; lock_NP = <>} ; mkA a b c d = mkAdj a c b d ** {p = False ; lock_A = <>} ; - regA a = mkAdjReg a False ** {p = False ; lock_A = <>} ; + regA a = mkAdjReg a ** {p = False ; lock_A = <>} ; prefA a = {s = a.s ; p = True ; lock_A = <>} ; mkA2 a p = a ** {c = p.p1 ; s2 = p.p2 ; lock_A2 = <>} ; diff --git a/lib/resource/french/SyntaxFre.gf b/lib/resource/french/SyntaxFre.gf index 92878dc81..0fbdcaf4a 100644 --- a/lib/resource/french/SyntaxFre.gf +++ b/lib/resource/french/SyntaxFre.gf @@ -76,9 +76,6 @@ oper _ => (personPron Masc n p).s } ; - mkAdjReg : Str -> Bool -> Adjective = \adj,p -> - mkAdjective (adjGrand adj) p ; - comparConj = elisQue ; mkAdjDegrReg : Str -> Bool -> AdjDegr = \adj,p -> diff --git a/lib/resource/romance/SyntaxRomance.gf b/lib/resource/romance/SyntaxRomance.gf index f49d677e6..6317462e6 100644 --- a/lib/resource/romance/SyntaxRomance.gf +++ b/lib/resource/romance/SyntaxRomance.gf @@ -594,6 +594,14 @@ oper reflPron : Number => Person => NPFormA => Str ; + reflPronNounPhrase : Gender -> Number -> Person -> NounPhrase = \g,n,p -> + {s = reflPron ! n ! p ; + g = PGen g ; -- needed in participle agreement + n = n ; + p = p ; + c = Clit1 ---- depends on person? + } ; + ---- There is no adverbial form for the past participle. adjPastPart : Verb -> Adjective = \verb -> { diff --git a/src/GF/API/IOGrammar.hs b/src/GF/API/IOGrammar.hs index c2c2628ba..8a521cc67 100644 --- a/src/GF/API/IOGrammar.hs +++ b/src/GF/API/IOGrammar.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/03/08 18:08:58 $ +-- > CVS $Date: 2005/03/14 17:40:10 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.15 $ +-- > CVS $Revision: 1.16 $ -- -- for reading grammars and terms from strings and files ----------------------------------------------------------------------------- @@ -67,7 +67,8 @@ shellStateFromFiles opts st file = case fileSuffix file of else addOptions (options [emitCode]) opts' grts <- compileModule osb st file let top = identC $ justModuleName file - ioeErr $ updateShellState opts' (Just top) st grts + mtop = if oElem showOld opts' then Nothing else Just top + ioeErr $ updateShellState opts' mtop st grts --- liftM (changeModTimes rts) $ grammar2shellState opts gr getShellStateFromFiles :: Options -> FilePath -> IO ShellState