diff --git a/lib/resource/api/Combinators.gf b/lib/resource/api/Combinators.gf index 5f90335a0..23426df08 100644 --- a/lib/resource/api/Combinators.gf +++ b/lib/resource/api/Combinators.gf @@ -34,7 +34,11 @@ incomplete resource Combinators = open Grammar in { app : N2 -> NP -> NP ; app : N3 -> NP -> NP -> NP ; app : N2 -> NP -> NP -> NP ; - app : N2 -> N -> CN + app : N2 -> N -> CN ; + + app : N2 -> NP -> CN ; -- divisor of x + app : N3 -> NP -> NP -> CN ; -- path from x to y + app : N2 -> NP -> NP -> CN ; -- path between x and y } ; --2 Coordination @@ -126,7 +130,12 @@ incomplete resource Combinators = open Grammar in { app : N2 -> NP -> NP -> NP = \n,x,y -> (DetArtSg DefArt (ComplN2 n (ConjNP and_Conj (BaseNP x y)))) ; app : N2 -> N -> CN - = \f,n -> ComplN2 f (DetArtPl (IndefArt) (UseN n)) + = \f,n -> ComplN2 f (DetArtPl (IndefArt) (UseN n)) ; + + app : N2 -> NP -> CN = ComplN2 ; + app : N3 -> NP -> NP -> CN = \n,x,y -> ComplN2 (ComplN3 n x) y ; + app : N2 -> NP -> NP -> CN = \n,x,y -> + ComplN2 n (ConjNP and_Conj (BaseNP x y)) ; } ; coord = overload { diff --git a/lib/resource/api/CombinatorsSwe.gf b/lib/resource/api/CombinatorsSwe.gf new file mode 100644 index 000000000..c3b9a0350 --- /dev/null +++ b/lib/resource/api/CombinatorsSwe.gf @@ -0,0 +1,3 @@ +--# -path=.:alltenses:prelude + +resource CombinatorsSwe = Combinators with (Grammar = GrammarSwe) ; diff --git a/lib/resource/api/Constructors.gf b/lib/resource/api/Constructors.gf index 4e5d7e89f..f8dd06f79 100644 --- a/lib/resource/api/Constructors.gf +++ b/lib/resource/api/Constructors.gf @@ -444,10 +444,11 @@ incomplete resource Constructors = open Grammar in { mkNum : overload { mkNum : Numeral -> Num ; -- 1. twenty mkNum : Digits -> Num ; -- 2. 51 + mkNum : Card -> Num ; -- 3. twenty -- A numeral can be modified by an adnumeral. - mkNum : AdN -> Num -> Num -- 3. almost ten + mkNum : AdN -> Card -> Num -- 4. almost ten } ; -- Dummy numbers are sometimes to select the grammatical number of a determiner. @@ -1136,7 +1137,7 @@ incomplete resource Constructors = open Grammar in { = \d -> NumCard (NumDigits d) ; mkNum : Digit -> Num = \d -> NumCard (NumNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 d)))))) ; - + mkNum : Card -> Num = NumCard ; mkNum : AdN -> Card -> Num = \a,c -> NumCard (AdNum a c) } ; @@ -1639,6 +1640,10 @@ incomplete resource Constructors = open Grammar in { those_NP : NP = DetNP (DetQuant that_Quant plNum) ; these_NP : NP = DetNP (DetQuant this_Quant plNum) ; + ListAdv : Type = Grammar.ListAdv ; + ListAP : Type = Grammar.ListAP ; + ListNP : Type = Grammar.ListNP ; + ListS : Type = Grammar.ListS ; {- -- The definite and indefinite articles are commonly used determiners. diff --git a/lib/resource/mathematical/Symbolic.gf b/lib/resource/mathematical/Symbolic.gf index 6ce8478b9..9d945c7c3 100644 --- a/lib/resource/mathematical/Symbolic.gf +++ b/lib/resource/mathematical/Symbolic.gf @@ -1,11 +1,12 @@ --1 Symbolic: Noun Phrases with mathematical symbols -incomplete resource Symbolic = open Symbol, Grammar in { +incomplete resource Symbolic = open + Symbol, Grammar, PredefCnc in { oper symb : overload { symb : Str -> NP ; -- x - symb : Integer -> NP ; -- 23 + symb : Int -> NP ; -- 23 symb : Float -> NP ; -- 0.99 symb : N -> Digits -> NP ; -- level 4 symb : N -> Card -> NP ; -- level four @@ -13,21 +14,24 @@ incomplete resource Symbolic = open Symbol, Grammar in { symb : Det -> N -> Card -> NP ; -- the number four symb : Det -> CN -> Card -> NP ; -- the even number four symb : Det -> N -> Str -> Str -> NP ; -- the levels i and j - symb : Det -> CN -> [Symb] -> NP -- the basic levels i, j, and k + symb : Det -> CN -> [Symb] -> NP ; -- the basic levels i, j, and k + symb : Symb -> S ; -- A + symb : Symb -> Card ; -- n + symb : Symb -> Ord -- n'th } ; - mkSymb : Str -> Symb ; - mkInteger : Predef.Int -> Integer ; - mkFloating : Predef.Float -> Floating ; + mkSymb : Str -> Symb ; + mkInt : Str -> PredefCnc.Int ; + mkFloat : Str -> PredefCnc.Float ; --. symb = overload { symb : Str -> NP = \s -> UsePN (SymbPN (mkSymb s)) ; - symb : Integer -> NP + symb : Int -> NP = \i -> UsePN (IntPN i) ; - symb : Floating -> NP + symb : Float -> NP = \i -> UsePN (FloatPN i) ; symb : N -> Digits -> NP = \c,i -> CNNumNP (UseN c) (NumDigits i) ; @@ -42,15 +46,19 @@ incomplete resource Symbolic = open Symbol, Grammar in { symb : Det -> N -> Str -> Str -> NP = \c,n,x,y -> CNSymbNP c (UseN n) (BaseSymb (mkSymb x) (mkSymb y)) ; symb : Det -> CN -> [Symb] -> NP - = CNSymbNP + = CNSymbNP ; + symb : Symb -> S = SymbS ; + symb : Symb -> Card = SymbNum ; + symb : Symb -> Ord = SymbOrd + } ; mkSymb : Str -> Symb = \s -> {s = s ; lock_Symb = <>} ; - mkInteger i = {s = Predef.show Predef.Int i ; lock_Int = <>} ; - mkFloating f = {s = Predef.show Predef.Float f ; lock_Float = <>} ; + mkInt i = {s = i ; lock_Int = <>} ; + mkFloat f = {s = f ; lock_Float = <>} ; - Integer : Type = {s : Str ; lock_Int : {}} ; - Floating : Type = {s : Str ; lock_Float : {}} ; +-- Integer : Type = {s : Str ; lock_Int : {}} ; +-- Floating : Type = {s : Str ; lock_Float : {}} ; } diff --git a/src/server/gf-client.html b/src/server/gf-client.html index 24be634b4..f613d883f 100644 --- a/src/server/gf-client.html +++ b/src/server/gf-client.html @@ -72,7 +72,7 @@