(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 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 oper
mkFirstSS : SS -> ConjType => Str = \s -> mkFirstSS : SS -> ConjType => Str = \s ->
\\conj => glue s.s (conjTable ! NStar ! conj) ; \\conj => glue s.s (conjTable ! NStar ! conj) ;

View File

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

View File

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