Skip to content

Commit

Permalink
Add Chi, Hin, Tha (testable only with Words300)
Browse files Browse the repository at this point in the history
(Did not get Jpn to compile.)
  • Loading branch information
Kaljurand committed May 17, 2013
1 parent fd9cd2e commit 9622a2c
Show file tree
Hide file tree
Showing 16 changed files with 778 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Expand Up @@ -42,8 +42,15 @@ langs_Geography = Ace Ape Ger Spa
# Tracking the regression of these languages # Tracking the regression of these languages
langs_Geography_track = Ace Ape Ger Spa langs_Geography_track = Ace Ape Ger Spa
langs_Simple = Ace langs_Simple = Ace
# Intentionally lacks Ape and Eng
langs_Words300 = Ace Bul Cat Dan Dut Fin Fre Ger Gre Ita Lav Nor Pol Ron Rus Spa Swe Urd # The Words300 grammar uses a subset of the RGL lexicon.
# We try to include all the RGL languages here, i.e. also some
# that are not included in the above languages lists.
# This list intentionally lacks Ape and Eng.
# TODO: rename 'Ace' to 'Eng' because the RGL English lexicon is not technically an ACE lexicon,
# as it contains "words with spaces".
# TODO: include also Afrikaans, Japanese (currently did not compile), Nepalese, Punjabi, Sindhi.
langs_Words300 = Ace Bul Cat Chi Dan Dut Fin Fre Ger Gre Hin Ita Lav Nor Pol Ron Rus Spa Swe Tha Urd


# Compile application grammars in all languages # Compile application grammars in all languages
all_grammars: all_grammars:
Expand Down
15 changes: 15 additions & 0 deletions grammars/acewiki_aceowl/AttemptoChi.gf
@@ -0,0 +1,15 @@
concrete AttemptoChi of Attempto = SymbolsC, NumeralChi, NullVPS **
AttemptoI - [
VPS, VPSQ, BaseVPS, BaseVPSQ, ConsVPS, ConsVPSQ, ListVPS, ListVPSQ,
vp_as_posVPS, vp_as_posVPSQ, vpq_as_posVPSQ,
vp_as_negVPS, vp_as_negVPSQ, vpq_as_negVPSQ,
np_coord_VPS, np_coord_VPSQ, npq_coord_VPS] with
(Syntax = SyntaxChi),
(Symbolic = SymbolicChi),
(LexAttempto = LexAttemptoChi) ** {

oper S2QS : Syntax.S -> Syntax.QS = variants {};

lin ipNPQ ip = variants {};

} ;
16 changes: 16 additions & 0 deletions grammars/acewiki_aceowl/AttemptoHin.gf
@@ -0,0 +1,16 @@
concrete AttemptoHin of Attempto = SymbolsC, NumeralHin, NullVPS **
AttemptoI - [
nobody_IPron, nothing_IPron, noNP, noNPQ, if_thenS,
VPS, VPSQ, BaseVPS, BaseVPSQ, ConsVPS, ConsVPSQ, ListVPS, ListVPSQ,
vp_as_posVPS, vp_as_posVPSQ, vpq_as_posVPSQ,
vp_as_negVPS, vp_as_negVPSQ, vpq_as_negVPSQ,
np_coord_VPS, np_coord_VPSQ, npq_coord_VPS] with
(Syntax = SyntaxHin),
(Symbolic = SymbolicHin),
(LexAttempto = LexAttemptoHin) ** {

oper S2QS : Syntax.S -> Syntax.QS = variants {};

lin ipNPQ ip = variants {};

} ;
15 changes: 15 additions & 0 deletions grammars/acewiki_aceowl/AttemptoTha.gf
@@ -0,0 +1,15 @@
concrete AttemptoTha of Attempto = SymbolsC, NumeralTha, NullVPS **
AttemptoI - [
VPS, VPSQ, BaseVPS, BaseVPSQ, ConsVPS, ConsVPSQ, ListVPS, ListVPSQ,
vp_as_posVPS, vp_as_posVPSQ, vpq_as_posVPSQ,
vp_as_negVPS, vp_as_negVPSQ, vpq_as_negVPSQ,
np_coord_VPS, np_coord_VPSQ, npq_coord_VPS] with
(Syntax = SyntaxTha),
(Symbolic = SymbolicTha),
(LexAttempto = LexAttemptoTha) ** {

oper S2QS : Syntax.S -> Syntax.QS = variants {};

lin ipNPQ ip = variants {};

} ;
4 changes: 4 additions & 0 deletions grammars/acewiki_aceowl/ExtraTha.gf
@@ -0,0 +1,4 @@
concrete ExtraTha of ExtraThaAbs = CatTha **
open ResTha, Prelude in {

}
1 change: 1 addition & 0 deletions grammars/acewiki_aceowl/ExtraThaAbs.gf
@@ -0,0 +1 @@
abstract ExtraThaAbs = Cat ** { } ;
19 changes: 19 additions & 0 deletions grammars/acewiki_aceowl/LexAttemptoChi.gf
@@ -0,0 +1,19 @@
instance LexAttemptoChi of LexAttempto =
open
SyntaxChi,
ParadigmsChi,
ConstructX,
(E = ExtraChi),
(L = LangChi)
in {

flags coding=utf8 ;

oper
false_A = mkA "TODO" ;

adj_thatCl : A -> S -> Cl = \a,s -> mkCl (mkVP (mkAP (mkAP a) s)) ;

exactly_AdN = ConstructX.mkAdN "TODO" ;

} ;
19 changes: 19 additions & 0 deletions grammars/acewiki_aceowl/LexAttemptoHin.gf
@@ -0,0 +1,19 @@
instance LexAttemptoHin of LexAttempto =
open
SyntaxHin,
ParadigmsHin,
ConstructX,
(E = ExtraHin),
(L = LangHin)
in {

flags coding=utf8 ;

oper
false_A = mkA "TODO" ;

adj_thatCl : A -> S -> Cl = \a,s -> mkCl (mkVP (mkAP (mkAP a) s)) ;

exactly_AdN = variants {} ;

} ;
19 changes: 19 additions & 0 deletions grammars/acewiki_aceowl/LexAttemptoTha.gf
@@ -0,0 +1,19 @@
instance LexAttemptoTha of LexAttempto =
open
SyntaxTha,
ParadigmsTha,
ConstructX,
(E = ExtraTha),
(L = LangTha)
in {

flags coding=utf8 ;

oper
false_A = mkA "TODO" ;

adj_thatCl : A -> S -> Cl = \a,s -> mkCl (mkVP (mkAP (mkAP a) s)) ;

exactly_AdN = ConstructX.mkAdN "TODO" ;

} ;
152 changes: 152 additions & 0 deletions grammars/acewiki_aceowl/NumeralChi.gf
@@ -0,0 +1,152 @@
concrete NumeralChi of Numeral = CatChi [Numeral,Digits] ** open ResChi, Prelude in {

flags coding = utf8 ;


param Qform = bai | bai0 | shiwan | shiwan0 ;
param Bform = shi | shi0 | wan | wan0 ;
param Zero = zero | nozero ;
oper ling : Zero * Zero => Str =
table {<zero,z> => "零" ;
<z,zero> => "零" ;
<nozero,nozero> => []} ;
oper Wan : Zero => Str =
table {zero => "万" ;
nozero => []} ;

oper mkD : Str -> Str -> Str = \x,_ -> word x ; -- hiding the "formal" version

lincat Digit = {s,p : Str} ;
lincat Sub10 = {s,p : Str} ;
lincat Sub100 = {inh : Zero ; s,p : Bform => Str} ;
lincat Sub1000 = {inh : Zero ; s,p : Qform => Str} ;
lincat Sub1000000 = {s,p : Str} ;
lin num x0 = x0 ;

-- 一二三四五六七八九十一百千
--

lin n2 =
{s = mkD "二" "贰" ; p = "两"} ;
lin n3 =
{s,p = mkD "三" "叁"} ;
lin n4 =
{s,p = mkD "四" "肆"} ;
lin n5 =
{s,p = mkD "五" "伍"} ;
lin n6 =
{s,p = mkD "六" "陆"} ;
lin n7 =
{s,p = mkD "七" "柒"} ;
lin n8 =
{s,p = mkD "八" "捌"} ;
lin n9 =
{s,p = mkD "九" "玖"} ;
lin pot01 =
{s,p = mkD "一" "壹"} ;
lin pot0 d =
{s = d.s ; p = d.p} ;
lin pot110 =
{inh = nozero ;
s,p = table {
shi => mkD "一十" "壹拾" ;
shi0 => mkD "一十" "壹拾" ;
wan => mkD "一万" "壹万" ;
wan0 => mkD "一万" "壹万"}} ;
lin pot111 =
{inh = nozero ;
s,p = table {
shi => mkD "十一" "拾壹" ;
shi0 => mkD "一十一" "壹拾壹" ;
wan => mkD "一万一千" "壹万壹千" ; -- 11.16 by chenpeng wan => mkD "十一万" "拾壹万" ;
wan0 => mkD "一万一千" "壹万壹千"}} ; -- 11.16 by chenpeng wan0 => mkD "十一万" "拾壹万"}} ;
lin pot1to19 d =
{inh = nozero ;
s,p = table {
shi => mkD "一十" "壹拾" ++ d.s ;
shi0 => mkD "一十" "壹拾" ;
wan => mkD "一万" "壹万" ++ d.s ++ mkD "千" "仟" ;
wan0 => mkD "一万" "壹万" ++ d.s ++ mkD "千" "仟"}} ;
lin pot0as1 n =
{inh = zero ;
s = table {
shi => n.s ;
shi0 => n.s ;
wan => n.s ++ mkD "千" "仟" ;
wan0 => n.s ++ mkD "千" "仟"} ;
p = table {
shi => n.p ;
shi0 => n.s ;
wan => n.s ++ mkD "千" "仟" ;
wan0 => n.s ++ mkD "千" "仟"}
} ;
lin pot1 d =
{inh = nozero ; -- inh = zero
s,p = table {
shi => d.s ++ mkD "十" "拾" ;
shi0 => d.s ++ mkD "十" "拾" ;
wan0 => d.s ++ "万" ;
wan => d.s ++ "万"}} ;
lin pot1plus d e =
{inh = nozero ;
s,p = table {
shi => d.s ++ mkD "十" "拾" ++ e.s ;
shi0 => d.s ++ mkD "十" "拾" ++ e.s ;
wan => d.s ++ "万" ++ e.s ++ mkD "千" "仟" ;
wan0 => d.s ++ "万" ++ e.s ++ mkD "千" "仟"}} ;
lin pot1as2 n =
{inh = zero ;
s = table {
bai => n.s ! shi ;
bai0 => n.s ! shi ;
shiwan => n.s ! wan ;
shiwan0 => n.s ! wan0} ;
p = table {
bai => n.p ! shi ;
bai0 => n.s ! shi ;
shiwan => n.s ! wan ;
shiwan0 => n.s ! wan0}} ;
lin pot2 d =
{inh = zero ;
s,p = table {
bai => d.s ++ mkD "百" "佰" ;
bai0 => d.s ++ mkD "百" "佰" ;
shiwan0 => d.s ++ mkD "十万" "拾万" ;
shiwan => d.s ++ mkD "十万" "拾万"}} ;
lin pot2plus d e =
{inh = nozero ;
s,p = table {
bai => d.s ++ mkD "百" "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; --why omit "百"? i add it /chenpeng
bai0 => d.s ++ mkD "百" "佰" ++ (ling ! <e.inh,e.inh>) ++ e.s ! shi0 ; --why omit "百"? i add it /chenpeng
shiwan => d.s ++ mkD "十" "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan ; --why omit "十"? i add it /chenpeng
shiwan0 => d.s ++ mkD "十" "拾" ++ (Wan ! (e.inh)) ++ e.s ! wan0}} ;--why omit "十"? i add it /chenpeng
lin pot2as3 n =
{s = n.s ! bai ; p = n.p ! bai} ;
lin pot3 n =
{s,p = n.s ! shiwan} ;
lin pot3plus n m =
{s,p = (n.s ! shiwan0) ++ (ling ! <n.inh,m.inh>) ++ m.s ! bai0} ;


-- numerals as sequences of digits

lincat
Dig = SS ;

lin
IDig d = d ;

IIDig d i = ss (d.s ++ i.s) ;

D_0 = ss "0" ;
D_1 = ss "1" ;
D_2 = ss "2" ;
D_3 = ss "3" ;
D_4 = ss "4" ;
D_5 = ss "5" ;
D_6 = ss "6" ;
D_7 = ss "7" ;
D_8 = ss "8" ;
D_9 = ss "9" ;

}

0 comments on commit 9622a2c

Please sign in to comment.