1
0
forked from GitHub/gf-rgl

(Kor) Add variants using commas instead of repeated conjunctions

This commit is contained in:
Inari Listenmaa
2020-04-06 17:37:00 +02:00
parent 0053d8223c
commit edc79e4717
3 changed files with 21 additions and 6 deletions

View File

@@ -51,6 +51,22 @@ oper
s = co.s1 ++ ss.firstSS ! co.c ++ ss.s
} ;
-- Versions with commas, no repeated conjunctions
baseSScomma : SS -> SS -> ConjSS = \s1,s2 -> s2 ** {
firstSS = \\conj => s1.s ++ SOFT_BIND ++ "," ;
} ;
consSScomma : SS -> ConjSS -> ConjSS = \s,ss -> ss ** {
firstSS = \\conj =>
s.s ++ SOFT_BIND ++ "," ++ ss.firstSS ! conj ;
} ;
conjSScomma : Conj -> ConjSS -> SS = \co,ss -> {
s = co.s1
++ glue (ss.firstSS ! co.c) co.s2
++ ss.s
} ;
oper
mkFirstSS : SS -> ConjType => Str = \s ->
\\conj => glue s.s (conjTable ! NStar ! conj) ;

View File

@@ -254,7 +254,7 @@ oper
-- Conj
Conj : Type = {
s1 : Str ;
s1, s2 : Str ;
c : ConjType ; -- if it's And, Or, …
-- Need to add conjunction already in ConsX funs.
n : Number ;

View File

@@ -40,14 +40,13 @@ lin there_Adv = ss "" ;
lin and_Conj = {
s1 = [] ;
-- no need for strings here, actual values come from ParamKor.conjTable
-- s2 = \\phono => table {
-- VStar => "고" ;
-- NStar => "하고"} ;
-- no need for string, actual values come from ParamKor.conjTable
s2 = [] ; -- this is only used in the base/cons functions with comma.
-- another application can use commas and just one conjunction.
n = Pl ;
c = And
} ;
lin or_Conj = {s1 = [] ; n = Sg ; c = Or} ;
lin or_Conj = {s1,s2 = [] ; n = Sg ; c = Or} ;
-- lin if_then_Conj = mkConj
-- lin both7and_DConj = mkConj "" "" pl ;
-- lin either7or_DConj = {s2 = \\_ => "" ; s1 = "" ; n = Sg} ;