Permalink
Browse files

Add Chi, Hin, Tha (testable only with Words300)

(Did not get Jpn to compile.)
  • Loading branch information...
Kaljurand committed May 17, 2013
1 parent fd9cd2e commit 9622a2cf37f8d0f3860f0bc6389ad6f6a3444df1
@@ -42,8 +42,15 @@ langs_Geography = Ace Ape Ger Spa
# Tracking the regression of these languages
langs_Geography_track = Ace Ape Ger Spa
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
all_grammars:
@@ -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 {};

} ;
@@ -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 {};

} ;
@@ -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 {};

} ;
@@ -0,0 +1,4 @@
concrete ExtraTha of ExtraThaAbs = CatTha **
open ResTha, Prelude in {

}
@@ -0,0 +1 @@
abstract ExtraThaAbs = Cat ** { } ;
@@ -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" ;

} ;
@@ -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 {} ;

} ;
@@ -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" ;

} ;
@@ -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" ;

}
Oops, something went wrong.

0 comments on commit 9622a2c

Please sign in to comment.