Skip to content

Commit ae7e895

Browse files
authored
Merge pull request #360 from bamutra/master
Request for Merge
2 parents 5c9885d + ad76508 commit ae7e895

File tree

13 files changed

+958
-703
lines changed

13 files changed

+958
-703
lines changed

languages.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Amh,Amharic,amharic,,,,,n,n,,n
44
Ara,Arabic,arabic,,,,,,y,,y
55
Bul,Bulgarian,bulgarian,,,y,,,,,y
66
Cat,Catalan,catalan,Romance,,y,,,,y,y
7+
Cgg,Rukiga,rukiga,,,y,y,n,n,y,y
78
Chi,Chinese (simplified),chinese,,,,,,,,y
89
Cze,Czech,czech,,,,,,n,,y
910
Dan,Danish,danish,Scand,,y,,,,,y

src/prelude/Coordination.gf

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,43 @@ resource Coordination = open Prelude in {
33
param
44
ListSize = TwoElem | ManyElem ;
55

6-
oper
6+
oper
7+
-- Type of [X] for any X whose lincat is {s : Str}.
8+
-- example : ListX = {s1 = "a , b" ; s2 = "c"}
79
ListX = {s1,s2 : Str} ;
810

9-
twoStr : (x,y : Str) -> ListX = \x,y ->
11+
-- Helper funs for twoSS and conjSS
12+
twoStr : (x,y : Str) -> ListX = \x,y ->
1013
{s1 = x ; s2 = y} ;
11-
consStr : Str -> ListX -> Str -> ListX = \comma,xs,x ->
14+
consStr : Str -> ListX -> Str -> ListX = \comma,xs,x ->
1215
{s1 = xs.s1 ++ comma ++ xs.s2 ; s2 = x } ;
1316

14-
twoSS : (_,_ : SS) -> ListX = \x,y ->
17+
-- Create a ListX from two Xs. Example:
18+
-- x = {s = "here"} ;
19+
-- y = {s = "there"} ;
20+
-- twoSS x y ==> {s1 = "here" ; s2 = "there"}
21+
twoSS : (_,_ : SS) -> ListX = \x,y ->
1522
twoStr x.s y.s ;
16-
consSS : Str -> ListX -> SS -> ListX = \comma,xs,x ->
23+
24+
-- Add new X to a ListX, along with a separator. Example:
25+
-- comma = ","
26+
-- xs = {s1 = "here" ; s2 = "there"}
27+
-- x = {s = "everywhere"}
28+
-- consSS comma xs x ==> {s1 = "here , there" ; s2 = "everywhere"}
29+
consSS : Str -> ListX -> SS -> ListX = \comma,xs,x ->
1730
consStr comma xs x.s ;
1831

1932
Conjunction : Type = SS ;
2033
ConjunctionDistr : Type = {s1 : Str ; s2 : Str} ;
2134

35+
-- Form an X from Conjunction and ListX. Example:
36+
-- or = {s = "and"}
37+
-- xs = {s1 = "here , there" ; s2 = "everywhere"}
38+
-- conjunctX or xs = {s = "here, there and everywhere"}
2239
conjunctX : Conjunction -> ListX -> Str = \or,xs ->
2340
xs.s1 ++ or.s ++ xs.s2 ;
24-
41+
42+
-- Like conjunctX, but conjunction has two parts: "both here and there"
2543
conjunctDistrX : ConjunctionDistr -> ListX -> Str = \or,xs ->
2644
or.s1 ++ xs.s1 ++ or.s2 ++ xs.s2 ;
2745

@@ -33,7 +51,10 @@ oper
3351

3452
-- all this lifted to tables
3553

36-
ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ;
54+
-- Type for a table with the given parameter P on the LHS.
55+
-- For example, if the lincat for X is {s : Number => Str},
56+
-- then the lincat for [X] should be ListTable Number, which expands to {s1, s2 : Number => Str}.
57+
ListTable : PType -> Type = \P -> {s1,s2 : P => Str} ;
3758

3859
twoTable : (P : PType) -> (_,_ : {s : P => Str}) -> ListTable P = \_,x,y ->
3960
{s1 = x.s ; s2 = y.s} ;

src/rukiga/CatCgg.gf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ concrete CatCgg of Cat = CommonX -[Adv,IAdv, AdA]**
66
lincat
77

88

9-
Imp = {s : Res. ImpPol=> Str} ;
9+
Imp = {s : Res.ImpPol=> Str} ;
1010
QS = {s : Str} ;
1111

1212
-- Note: SS is a shorthand for {s:Str}, defined in Prelude.gf
@@ -34,7 +34,7 @@ lincat
3434
V,VS, VQ, VA = Res.Verb ; --change to {verb : Str ; comp = []} -- one-place verb e.g. "sleep"
3535
V2,V2Q, V2S = Res.Verb2;
3636
V2A,V3 = Res.Verb3; -- three-place verb e.g. "show"
37-
37+
V2V = Res.Verb ** {comp,c3 : Str ; typ : Res.VVType} ;
3838
VP = Res.VerbPhrase ; -- verb phrase e.g. "is very warm"
3939

4040
N = Res.Noun ; -- common noun e.g. "house"
@@ -92,9 +92,9 @@ lincat
9292
Digits = {s : Res.CardOrd => Res.Agreement=>Str ; n : Res.Number ; tail : Px.DTail} ;
9393
Ord = {s :Res.Agreement=>Str; position:Res.Position} ;
9494
Card = {s :Res.Agreement=>Str; n : Res.Number} ;
95-
95+
A2 = Res.Adjective ** { c2 : Str ; isPre : Bool} ;
9696
DAP = Res.Determiner ;
97-
N2 = Res.Noun ** {c2 : Res.Agreement =>Str}; -- relational noun e.g. "son"
97+
N2 = Res.Noun ** {c2 : Res.Agreement =>Str}; -- relational noun e.g. "son"
9898
Prep = Res.Preposition; -- preposition, or just case e.g. "in"
9999
N3 = N2 ** {c3 : Res.Agreement =>Str};
100100
VV = Res.Verb ** {inf:Str; whenUsed: Res.VVMood}; --inf is the other verb
@@ -106,6 +106,10 @@ linref
106106
VP =\vp -> vp.adv ++ vp.s ++ BIND ++ vp.pres ++ vp.comp ++vp.comp2 ++ vp.ap;
107107
VPSlash =\vpslash -> vpslash.s ++ BIND ++ vpslash.pres;
108108

109+
lindef
110+
A2 = \s -> {s = s; position = Res.Post; isProper = False;
111+
isPrep = False; isNeg = False;c2 = ""; isPre = True};
112+
109113

110114
--1 Cat: the Category System
111115

src/rukiga/IdiomCgg.gf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
--# -path=.:../prelude:../abstract:../common
22

33
concrete IdiomCgg of Idiom = CatCgg **
4-
open Prelude, ResCgg in {
4+
open Prelude,Predef, ResCgg in {
55

6+
7+
lin
8+
ImpPl1 vp = {s="tu" ++ BIND ++ vp.s ++ BIND ++ vp.pres ++ BIND ++ "6e"}; -- let's go
69
{-
710
--1 Idiom: Idiomatic Expressions
811

0 commit comments

Comments
 (0)