mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-rgl
This commit is contained in:
@@ -5,6 +5,7 @@ Ara,Arabic,arabic,,,,,,y,,y
|
|||||||
Bul,Bulgarian,bulgarian,,,y,,,,,y
|
Bul,Bulgarian,bulgarian,,,y,,,,,y
|
||||||
Cat,Catalan,catalan,Romance,,y,,,,y,y
|
Cat,Catalan,catalan,Romance,,y,,,,y,y
|
||||||
Chi,Chinese (simplified),chinese,,,,,,,,y
|
Chi,Chinese (simplified),chinese,,,,,,,,y
|
||||||
|
Cze,Czech,czech,,,n,n,n,n,n,n
|
||||||
Dan,Danish,danish,Scand,,y,,,,,y
|
Dan,Danish,danish,Scand,,y,,,,,y
|
||||||
Dut,Dutch,dutch,,,y,,,,,y
|
Dut,Dutch,dutch,,,y,,,,,y
|
||||||
Eng,English,english,,,y,,,,y,y
|
Eng,English,english,,,y,,,,y,y
|
||||||
@@ -22,7 +23,7 @@ Ice,Icelandic,icelandic,,,,,,n,,y
|
|||||||
Ina,Interlingua,interlingua,,,y,,n,n,,n
|
Ina,Interlingua,interlingua,,,y,,n,n,,n
|
||||||
Ita,Italian,italian,Romance,,y,,,,y,y
|
Ita,Italian,italian,Romance,,y,,,,y,y
|
||||||
Jpn,Japanese,japanese,,,,,,,,y
|
Jpn,Japanese,japanese,,,,,,,,y
|
||||||
Kor,Korean,korean,,,n,n,n,n,n,n
|
Kor,Korean,korean,,,n,y,y,y,n,n
|
||||||
Lat,Latin,latin,,,,,y,y,n,y
|
Lat,Latin,latin,,,,,y,y,n,y
|
||||||
Lav,Latvian,latvian,,,,,,,y,y
|
Lav,Latvian,latvian,,,,,,,y,y
|
||||||
Mlt,Maltese,maltese,,,,,,,,y
|
Mlt,Maltese,maltese,,,,,,,,y
|
||||||
|
|||||||
|
9
src/api/CombinatorsCze.gf
Normal file
9
src/api/CombinatorsCze.gf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource CombinatorsCze = Combinators with
|
||||||
|
(Cat = CatCze),
|
||||||
|
(Structural = StructuralCze),
|
||||||
|
(Constructors = ConstructorsCze)
|
||||||
|
** open MissingCze in {}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
--# -path=.:alltenses:prelude:src/korean
|
--# -path=.:alltenses:prelude:../korean
|
||||||
|
|
||||||
resource CombinatorsKor = Combinators with
|
resource CombinatorsKor = Combinators with
|
||||||
(Cat = CatKor),
|
(Cat = CatKor),
|
||||||
|
|||||||
5
src/api/ConstructorsCze.gf
Normal file
5
src/api/ConstructorsCze.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource ConstructorsCze = Constructors with (Grammar = GrammarCze)
|
||||||
|
** open MissingCze in {}
|
||||||
|
|
||||||
6
src/api/SymbolicCze.gf
Normal file
6
src/api/SymbolicCze.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../czech:../common:../abstract:../prelude
|
||||||
|
|
||||||
|
resource SymbolicCze = Symbolic with
|
||||||
|
(Symbol = SymbolCze),
|
||||||
|
(Grammar = GrammarCze)
|
||||||
|
** open MissingCze in {}
|
||||||
4
src/api/SyntaxCze.gf
Normal file
4
src/api/SyntaxCze.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:./alltenses:../prelude
|
||||||
|
|
||||||
|
instance SyntaxCze of Syntax =
|
||||||
|
ConstructorsCze, CatCze, StructuralCze, CombinatorsCze ;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
--# -path=.:alltenses:prelude
|
--# -path=.:alltenses:prelude:../korean
|
||||||
|
|
||||||
instance SyntaxKor of Syntax =
|
instance SyntaxKor of Syntax =
|
||||||
ConstructorsKor, CatKor, StructuralKor, CombinatorsKor ;
|
ConstructorsKor, CatKor, StructuralKor, CombinatorsKor **
|
||||||
|
open MissingKor in {} ;
|
||||||
|
|||||||
13
src/api/TryCze.gf
Normal file
13
src/api/TryCze.gf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
--# -path=.:../czech:../common:../abstract:../prelude
|
||||||
|
|
||||||
|
resource TryCze = SyntaxCze, LexiconCze, ParadigmsCze -[mkAdv, mkDet,mkQuant]**
|
||||||
|
open (P = ParadigmsCze) in {
|
||||||
|
|
||||||
|
-- oper
|
||||||
|
|
||||||
|
-- mkAdv = overload SyntaxCze {
|
||||||
|
-- mkAdv : Str -> Adv = P.mkAdv ;
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
23
src/czech/AdjectiveCze.gf
Normal file
23
src/czech/AdjectiveCze.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
concrete AdjectiveCze of Adjective = CatCze ** open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
|
||||||
|
PositA a = adjFormsAdjective a ** {isPost = False} ;
|
||||||
|
|
||||||
|
AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ;
|
||||||
|
|
||||||
|
ComplA2 a np =
|
||||||
|
let ap = adjFormsAdjective a
|
||||||
|
in
|
||||||
|
ap ** {
|
||||||
|
s = \\g,n,c => ap.s ! g ! n ! c ++ a.c.s ++ np.s ! a.c.c ;
|
||||||
|
isPost = True ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseA2 a = adjFormsAdjective a ** {isPost = False} ;
|
||||||
|
|
||||||
|
UseComparA a = adjFormsAdjective a ** {isPost = False} ; ---- TODO: this gives positive forms
|
||||||
|
|
||||||
|
AdvAP ap adv = ap ** {s = \\g,n,c => ap.s ! g ! n ! c ++ adv.s} ;
|
||||||
|
|
||||||
|
}
|
||||||
9
src/czech/AdverbCze.gf
Normal file
9
src/czech/AdverbCze.gf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
concrete AdverbCze of Adverb = CatCze **
|
||||||
|
open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PrepNP prep np = {
|
||||||
|
s = prep.s ++ np.prep ! prep.c
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
6
src/czech/AllCze.gf
Normal file
6
src/czech/AllCze.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../abstract:../common:../api
|
||||||
|
|
||||||
|
concrete AllCze of AllCzeAbs =
|
||||||
|
LangCze
|
||||||
|
;
|
||||||
|
|
||||||
6
src/czech/AllCzeAbs.gf
Normal file
6
src/czech/AllCzeAbs.gf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
abstract AllCzeAbs =
|
||||||
|
Lang
|
||||||
|
;
|
||||||
|
|
||||||
70
src/czech/CatCze.gf
Normal file
70
src/czech/CatCze.gf
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
concrete CatCze of Cat =
|
||||||
|
--- CommonX **
|
||||||
|
|
||||||
|
open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Text = {s : Str} ;
|
||||||
|
Phr = {s : Str} ;
|
||||||
|
Utt = {s : Str} ;
|
||||||
|
|
||||||
|
S = {s : Str} ;
|
||||||
|
Cl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ;
|
||||||
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
|
QS = {s : Str} ; ---- TODO: indirect questions
|
||||||
|
QCl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ; -- = Cl ---- check if enough
|
||||||
|
IAdv = {s : Str} ;
|
||||||
|
|
||||||
|
RS = {s : Agr => Str} ;
|
||||||
|
RCl = {subj,clit,compl : Agr => Str ; verb : VerbForms} ; ---- RAgr with composite RP
|
||||||
|
RP = AdjForms ;
|
||||||
|
|
||||||
|
VP = {verb : VerbForms ; clit,compl : Agr => Str} ; ---- more fields probably needed
|
||||||
|
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||||
|
V = ResCze.VerbForms ;
|
||||||
|
V2 = ResCze.VerbForms ** {c : ComplementCase} ;
|
||||||
|
|
||||||
|
A = ResCze.AdjForms ;
|
||||||
|
AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}
|
||||||
|
A2 = ResCze.AdjForms ** {c : ComplementCase} ;
|
||||||
|
|
||||||
|
AdA = {s : Str} ;
|
||||||
|
|
||||||
|
N = ResCze.NounForms ;
|
||||||
|
CN = ResCze.Noun ; -- {s : Number => Case => Str ; g : Gender}
|
||||||
|
NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; -- clit,prep differ for pronouns
|
||||||
|
PN = {s : Case => Str ; g : Gender} ;
|
||||||
|
Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize
|
||||||
|
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||||
|
Num = Determiner ;
|
||||||
|
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;
|
||||||
|
Pron = PronForms ;
|
||||||
|
|
||||||
|
Adv = {s : Str} ;
|
||||||
|
Prep = ResCze.ComplementCase ; -- {s : Str ; c : Case ; hasPrep : Bool} ;
|
||||||
|
Conj = {s1,s2 : Str} ; ---- may need a number
|
||||||
|
|
||||||
|
Pol = {s : Str ; p : Bool} ;
|
||||||
|
Temp = {s : Str ; t : CTense} ;
|
||||||
|
Tense = {s : Str ; t : CTense} ;
|
||||||
|
Ant = {s : Str ; t : CTense} ;
|
||||||
|
|
||||||
|
PConj = {s : Str} ;
|
||||||
|
Voc = {s : Str} ;
|
||||||
|
|
||||||
|
AdN = {s : Str} ;
|
||||||
|
AdV = {s : Str} ;
|
||||||
|
CAdv = {s : Str} ;
|
||||||
|
SC = {s : Str} ;
|
||||||
|
|
||||||
|
linref
|
||||||
|
N = \s -> s.snom ;
|
||||||
|
A = \s -> s.msnom ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat Numeral = Determiner ; ---- TODO: should contain Ord as well
|
||||||
|
lincat Digits = {s:Str ; size : NumSize} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
56
src/czech/ConjunctionCze.gf
Normal file
56
src/czech/ConjunctionCze.gf
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
concrete ConjunctionCze of Conjunction = CatCze **
|
||||||
|
open ResCze, Coordination, Prelude in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[Adv] = {s1,s2 : Str} ;
|
||||||
|
[AP] = {s1,s2 : Gender => Number => Case => Str ; isPost : Bool} ;
|
||||||
|
[NP] = {s1,s2,prep1,prep2 : Case => Str ; a : Agr} ;
|
||||||
|
[S] = {s1,s2 : Str} ;
|
||||||
|
[RS] = {s1,s2 : Agr => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseAdv = twoSS ;
|
||||||
|
ConsAdv = consrSS comma ;
|
||||||
|
|
||||||
|
BaseAP x y = twoTable3 Gender Number Case x y
|
||||||
|
** {isPost = orB x.isPost y.isPost} ; ---- should be so in Pol too
|
||||||
|
ConsAP x xs = consrTable3 Gender Number Case comma x xs
|
||||||
|
** {isPost = orB x.isPost xs.isPost} ;
|
||||||
|
|
||||||
|
BaseNP x y = {
|
||||||
|
s1 = x.s ;
|
||||||
|
s2 = y.s ;
|
||||||
|
prep1 = x.prep ;
|
||||||
|
prep2 = y.prep ;
|
||||||
|
a = y.a
|
||||||
|
} ; -- clitics disappear ---- Agr TODO
|
||||||
|
ConsNP x xs = {
|
||||||
|
s1 = \\c => x.s ! c ++ comma ++ xs.s1 ! c ;
|
||||||
|
s2 = xs.s2 ;
|
||||||
|
prep1 = \\c => x.prep ! c ++ comma ++ xs.prep1 ! c ;
|
||||||
|
prep2 = xs.prep2 ;
|
||||||
|
a = xs.a ----
|
||||||
|
} ;
|
||||||
|
|
||||||
|
BaseS = twoSS ;
|
||||||
|
ConsS = consrSS comma ;
|
||||||
|
|
||||||
|
BaseRS = twoTable Agr ;
|
||||||
|
ConsRS = consrTable Agr comma ;
|
||||||
|
|
||||||
|
ConjAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
|
ConjAP conj xs = conjunctDistrTable3 Gender Number Case conj xs
|
||||||
|
** {isPost = xs.isPost} ;
|
||||||
|
|
||||||
|
ConjNP conj xs = {
|
||||||
|
s,clit = \\c => conj.s1 ++ xs.s1 ! c ++ conj.s2 ++ xs.s2 ! c ;
|
||||||
|
prep = \\c => conj.s1 ++ xs.prep1 ! c ++ conj.s2 ++ xs.prep2 ! c ;
|
||||||
|
a = xs.a ; ---- dep. on conj as well
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ConjS = conjunctDistrSS ;
|
||||||
|
ConjRS = conjunctDistrTable Agr ;
|
||||||
|
|
||||||
|
}
|
||||||
19
src/czech/GrammarCze.gf
Normal file
19
src/czech/GrammarCze.gf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete GrammarCze of Grammar =
|
||||||
|
NounCze,
|
||||||
|
VerbCze,
|
||||||
|
AdjectiveCze,
|
||||||
|
AdverbCze,
|
||||||
|
NumeralCze,
|
||||||
|
SentenceCze,
|
||||||
|
QuestionCze,
|
||||||
|
RelativeCze,
|
||||||
|
ConjunctionCze,
|
||||||
|
PhraseCze,
|
||||||
|
TextCze,
|
||||||
|
StructuralCze,
|
||||||
|
IdiomCze,
|
||||||
|
TenseCze
|
||||||
|
** {
|
||||||
|
}
|
||||||
5
src/czech/IdiomCze.gf
Normal file
5
src/czech/IdiomCze.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
concrete IdiomCze of Idiom = CatCze ** open Prelude, ResCze in {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
10
src/czech/LangCze.gf
Normal file
10
src/czech/LangCze.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common:../api
|
||||||
|
|
||||||
|
concrete LangCze of Lang =
|
||||||
|
GrammarCze,
|
||||||
|
LexiconCze
|
||||||
|
-- ,ConstructionCze
|
||||||
|
-- ,DocumentationCze --# notpresent
|
||||||
|
** {
|
||||||
|
|
||||||
|
}
|
||||||
59
src/czech/LexiconCze.gf
Normal file
59
src/czech/LexiconCze.gf
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
concrete LexiconCze of Lexicon =
|
||||||
|
CatCze
|
||||||
|
**
|
||||||
|
open
|
||||||
|
ResCze, ParadigmsCze
|
||||||
|
in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
boy_N = declPAN "kluk" ;
|
||||||
|
man_N = declMUZ "muž" ;
|
||||||
|
teacher_N = declMUZ "učitel" ;
|
||||||
|
horse_N = declMUZ "kůň" ;
|
||||||
|
father_N = declMUZ "otec" ;
|
||||||
|
husband_N = declPAN "manžel" ;
|
||||||
|
|
||||||
|
castle_N = declHRAD "hrad" ;
|
||||||
|
forest_N = declHRAD "les" ;
|
||||||
|
machine_N = declSTROJ "stroj" ;
|
||||||
|
|
||||||
|
woman_N = declZENA "žena" ;
|
||||||
|
school_N = declZENA "škola" ; ----
|
||||||
|
skirt_N = declRUZE "sukně";
|
||||||
|
street_N = declRUZE "ulice" ;
|
||||||
|
rose_N = declRUZE "růže" ;
|
||||||
|
song_N = declPISEN "píseň" ;
|
||||||
|
bed_N = declPISEN "postel" ;
|
||||||
|
door_N = declRUZE "dveře" ;
|
||||||
|
bone_N = declKOST "kost" ;
|
||||||
|
village_N = declKOST "ves" ; ----
|
||||||
|
|
||||||
|
city_N = declMESTO "město" ;
|
||||||
|
apple_N = declMESTO "jablko" ; ----
|
||||||
|
sea_N = declMORE "moře" ;
|
||||||
|
airport_N = declMORE "letiště" ;
|
||||||
|
chicken_N = declKURE "kuře" ;
|
||||||
|
house_N = declSTAVENI "stavení" ; --- building, house
|
||||||
|
station_N = declSTAVENI "nádraží" ;
|
||||||
|
|
||||||
|
young_A = mkA "mladý" ;
|
||||||
|
old_A = mkA "starý" ;
|
||||||
|
good_A = mkA "dobrý" ;
|
||||||
|
bad_A = mkA "špatný" ;
|
||||||
|
beautiful_A = mkA "krásný" ;
|
||||||
|
clean_A = mkA "čistý" ;
|
||||||
|
dirty_A = mkA "špinavý" ;
|
||||||
|
|
||||||
|
white_A = mkA "bílý" ;
|
||||||
|
black_A = mkA "černý" ;
|
||||||
|
red_A = mkA "červený" ;
|
||||||
|
brown_A = mkA "hnědý" ;
|
||||||
|
blue_A = mkA "modrý" ;
|
||||||
|
green_A = mkA "zelený" ;
|
||||||
|
yellow_A = mkA "žlutý" ;
|
||||||
|
|
||||||
|
buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ;
|
||||||
|
love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
102
src/czech/MissingCze.gf
Normal file
102
src/czech/MissingCze.gf
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
resource MissingCze = open GrammarCze, Prelude in {
|
||||||
|
|
||||||
|
-- temporary definitions to enable the compilation of RGL API
|
||||||
|
oper AAnter : Ant = notYet "AAnter" ;
|
||||||
|
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
|
||||||
|
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
|
||||||
|
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
||||||
|
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
|
||||||
|
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
||||||
|
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
||||||
|
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
||||||
|
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
|
||||||
|
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
||||||
|
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
||||||
|
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||||
|
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||||
|
oper CompCN : CN -> Comp = notYet "CompCN" ;
|
||||||
|
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
||||||
|
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
||||||
|
oper ComparA : A -> NP -> AP = notYet "ComparA" ;
|
||||||
|
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
||||||
|
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
|
||||||
|
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
|
||||||
|
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
|
||||||
|
oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ;
|
||||||
|
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
|
||||||
|
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
||||||
|
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
||||||
|
oper DetNP : Det -> NP = notYet "DetNP" ;
|
||||||
|
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
||||||
|
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
||||||
|
oper EmbedS : S -> SC = notYet "EmbedS" ;
|
||||||
|
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
|
||||||
|
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
||||||
|
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
||||||
|
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
||||||
|
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
||||||
|
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
||||||
|
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
|
||||||
|
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
||||||
|
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
||||||
|
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
||||||
|
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
||||||
|
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
||||||
|
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
||||||
|
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
|
||||||
|
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
||||||
|
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
||||||
|
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
||||||
|
oper PossPron : Pron -> Quant = notYet "PossPron" ;
|
||||||
|
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
|
||||||
|
oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ;
|
||||||
|
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
||||||
|
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
||||||
|
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
|
||||||
|
oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ;
|
||||||
|
oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
|
||||||
|
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
|
||||||
|
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
|
||||||
|
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
|
||||||
|
oper RelCl : Cl -> RCl = notYet "RelCl" ;
|
||||||
|
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
|
||||||
|
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
|
||||||
|
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
|
||||||
|
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
|
||||||
|
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
|
||||||
|
oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ;
|
||||||
|
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
|
||||||
|
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
|
||||||
|
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
|
||||||
|
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
|
||||||
|
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
|
||||||
|
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
|
||||||
|
oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ;
|
||||||
|
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
|
||||||
|
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
||||||
|
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
||||||
|
oper TCond : Tense = notYet "TCond" ;
|
||||||
|
oper TFut : Tense = notYet "TFut" ;
|
||||||
|
oper TPast : Tense = notYet "TPast" ;
|
||||||
|
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||||
|
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
||||||
|
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
||||||
|
oper UttCard : Card -> Utt = notYet "UttCard" ;
|
||||||
|
oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ;
|
||||||
|
oper UttIP : IP -> Utt = notYet "UttIP" ;
|
||||||
|
oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ;
|
||||||
|
oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
|
||||||
|
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
||||||
|
oper UttQS : QS -> Utt = notYet "UttQS" ;
|
||||||
|
oper UttVP : VP -> Utt = notYet "UttVP" ;
|
||||||
|
oper by8agent_Prep : Prep = notYet "by8agent_Prep" ;
|
||||||
|
oper it_Pron : Pron = notYet "it_Pron" ;
|
||||||
|
oper they_Pron : Pron = notYet "they_Pron" ;
|
||||||
|
oper we_Pron : Pron = notYet "we_Pron" ;
|
||||||
|
oper whatSg_IP : IP = notYet "whatSg_IP" ;
|
||||||
|
oper which_IQuant : IQuant = notYet "which_IQuant" ;
|
||||||
|
oper whoSg_IP : IP = notYet "whoSg_IP" ;
|
||||||
|
oper youPl_Pron : Pron = notYet "youPl_Pron" ;
|
||||||
|
oper youPol_Pron : Pron = notYet "youPol_Pron" ;
|
||||||
|
|
||||||
|
}
|
||||||
100
src/czech/NounCze.gf
Normal file
100
src/czech/NounCze.gf
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
concrete NounCze of Noun =
|
||||||
|
CatCze
|
||||||
|
**
|
||||||
|
|
||||||
|
open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
DetCN det cn = {
|
||||||
|
s,prep,clit = \\c => det.s ! cn.g ! c ++ numSizeForm cn.s det.size c ;
|
||||||
|
a = numSizeAgr cn.g det.size P3 ;
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MassNP cn = {
|
||||||
|
s,prep,clit = \\c => cn.s ! Sg ! c ;
|
||||||
|
a = Ag cn.g Sg P3 ;
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetQuant quant num = {
|
||||||
|
s = \\g,c => num.s ! g ! c ++ quant.s ! g ! numSizeNumber num.size ! c ;
|
||||||
|
size = num.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DefArt = {s = \\_,_,_ => []} ;
|
||||||
|
IndefArt = {s = \\_,_,_ => []} ;
|
||||||
|
NumPl = {s = \\_,_ => [] ; size = Num2_4} ; ---- size
|
||||||
|
NumSg = {s = \\_,_ => [] ; size = Num1} ;
|
||||||
|
|
||||||
|
UsePron pron = {
|
||||||
|
s = table {
|
||||||
|
Nom | Voc => pron.nom ;
|
||||||
|
Gen => pron.gen ;
|
||||||
|
Dat => pron.dat ;
|
||||||
|
Acc => pron.acc ;
|
||||||
|
Loc => pron.loc ;
|
||||||
|
Ins => pron.ins
|
||||||
|
} ;
|
||||||
|
clit = table {
|
||||||
|
Nom => pron.cnom ;
|
||||||
|
Voc => pron.nom ;
|
||||||
|
Gen => pron.cgen ;
|
||||||
|
Dat => pron.cdat ;
|
||||||
|
Acc => pron.cacc ;
|
||||||
|
Loc => pron.loc ;
|
||||||
|
Ins => pron.ins
|
||||||
|
} ;
|
||||||
|
prep = table {
|
||||||
|
Nom | Voc => pron.nom ;
|
||||||
|
Gen => pron.pgen ;
|
||||||
|
Dat => pron.pdat ;
|
||||||
|
Acc => pron.pacc ;
|
||||||
|
Loc => pron.loc ;
|
||||||
|
Ins => pron.pins
|
||||||
|
} ;
|
||||||
|
a = pron.a ;
|
||||||
|
hasClit = True ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UsePN pn = {
|
||||||
|
s,clit,prep = \\c => pn.s ! c ;
|
||||||
|
a = Ag pn.g Sg P3 ;
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdjCN ap cn = {
|
||||||
|
s = \\n,c => ap.s ! cn.g ! n ! c ++ cn.s ! n ! c ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
RelCN cn rs = {
|
||||||
|
s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvCN cn adv = {
|
||||||
|
s = \\n,c => cn.s ! n ! c ++ adv.s ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvNP np adv = {
|
||||||
|
s,clit = \\c => np.s ! c ++ adv.s ;
|
||||||
|
prep = \\c => np.prep ! c ++ adv.s ;
|
||||||
|
a = np.a ;
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseN n = nounFormsNoun n ;
|
||||||
|
|
||||||
|
ApposCN cn np = {
|
||||||
|
s = \\n,c => cn.s ! n ! c ++ np.s ! c ; ---- TODO check apposition order
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
NumCard c = c ;
|
||||||
|
NumDigits ds = ds ** {s = \\_,_ => ds.s} ;
|
||||||
|
NumNumeral nu = nu ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
120
src/czech/NumeralCze.gf
Normal file
120
src/czech/NumeralCze.gf
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
concrete NumeralCze of Numeral =
|
||||||
|
|
||||||
|
CatCze **
|
||||||
|
|
||||||
|
open
|
||||||
|
ResCze,
|
||||||
|
Prelude
|
||||||
|
in {
|
||||||
|
|
||||||
|
-- from gf-contrib/numerals/czech.gf, added inflections
|
||||||
|
-- AR 2020-03-20
|
||||||
|
---- TODO ordinal forms
|
||||||
|
|
||||||
|
|
||||||
|
oper LinNumeral = Determiner ; -- {s : NumeralForms ; size : NumSize} ;
|
||||||
|
oper LinDigit = {unit : Gender => Case => Str ; teen, ten, hundred : Str ; size : NumSize} ;
|
||||||
|
|
||||||
|
lincat Digit = LinDigit ;
|
||||||
|
lincat Sub10 = LinDigit ;
|
||||||
|
|
||||||
|
lincat Sub100 = LinNumeral ;
|
||||||
|
lincat Sub1000 = LinNumeral ;
|
||||||
|
lincat Sub1000000 = LinNumeral ;
|
||||||
|
|
||||||
|
oper mkNum : Determiner -> Str -> Str -> Str -> LinDigit =
|
||||||
|
\dva, dvanast, dvadsat, dveste -> {
|
||||||
|
unit = dva.s ;
|
||||||
|
teen = dvanast + "náct" ;
|
||||||
|
ten = dvadsat ;
|
||||||
|
hundred = dveste ;
|
||||||
|
size = dva.size ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper mk2Num : Determiner -> Str -> Str -> Str -> LinDigit =
|
||||||
|
\unit, teenbase, tenbase, hundred ->
|
||||||
|
mkNum unit teenbase (tenbase + "cet") hundred ;
|
||||||
|
|
||||||
|
oper mk5Num : Str -> Str -> Str -> Str -> LinDigit =
|
||||||
|
\unit,uniti, teenbase, tenbase ->
|
||||||
|
mkNum (regNumeral unit uniti) teenbase (tenbase + "desát") (unit ++ "set") ;
|
||||||
|
|
||||||
|
oper bigNumeral : Str -> LinNumeral = \s -> invarNumeral s ;
|
||||||
|
|
||||||
|
lin num x = x ;
|
||||||
|
|
||||||
|
lin n2 = mk2Num twoNumeral "dva" "dva" ("dvě" ++ "stě") ;
|
||||||
|
lin n3 = mk2Num threeNumeral "tři" "tři" ("tři" ++ "sta") ;
|
||||||
|
lin n4 = mk2Num fourNumeral "čtr" "čtyři" ("čtyři" ++ "sta") ;
|
||||||
|
lin n5 = mk5Num "pět" "pěti" "pat" "pa" ;
|
||||||
|
lin n6 = mk5Num "šest" "šesti" "šest" "še" ;
|
||||||
|
lin n7 = mk5Num "sedm" "sedmi" "sedm" "sedm";
|
||||||
|
lin n8 = mk5Num "osm" "osmi" "osm" "osm";
|
||||||
|
lin n9 = mk5Num "devět" "devíti" "devate" "deva" ;
|
||||||
|
|
||||||
|
lin pot01 = {
|
||||||
|
unit = oneNumeral.s ; hundred = "sto" ; ten = "deset" ; teen = "jedenáct" ;
|
||||||
|
size = Num1
|
||||||
|
} ;
|
||||||
|
lin pot0 d = d ;
|
||||||
|
|
||||||
|
lin pot110 = bigNumeral "deset" ;
|
||||||
|
lin pot111 = bigNumeral "jedenáct" ;
|
||||||
|
lin pot1to19 d = bigNumeral d.teen ;
|
||||||
|
|
||||||
|
lin pot0as1 n = {s = n.unit ; size = n.size} ;
|
||||||
|
lin pot1 d = bigNumeral d.ten ;
|
||||||
|
lin pot1plus d e = {
|
||||||
|
s = (invarNumeral (d.ten ++ determinerStr (e ** {s = e.unit}))).s ; ---- TODO inflection?
|
||||||
|
size = tfSize e.size
|
||||||
|
} ;
|
||||||
|
---- variants { d.s ! ten ++ e.s ! unit ; glue (glue (e.s ! unit) "a") (d.s ! ten)} ; size = tfSize e.size} ;
|
||||||
|
|
||||||
|
lin pot1as2 n = n ;
|
||||||
|
lin pot2 d = bigNumeral d.hundred ;
|
||||||
|
lin pot2plus d e = {
|
||||||
|
s = (invarNumeral (d.hundred ++ determinerStr e)).s ; ---- TODO inflection?
|
||||||
|
size = tfSize e.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin pot2as3 n = n ;
|
||||||
|
lin pot3 n = bigNumeral (mkTh (determinerStr n) n.size) ;
|
||||||
|
|
||||||
|
lin pot3plus n m = {
|
||||||
|
s = (invarNumeral (mkTh (determinerStr n) n.size ++ determinerStr m)).s ; ---- TODO inflection?
|
||||||
|
size = tfSize m.size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper tfSize : NumSize -> NumSize = \sz ->
|
||||||
|
table {Num1 => Num5 ; other => other} ! sz ;
|
||||||
|
|
||||||
|
oper mkTh : Str -> NumSize -> Str = \attr,size ->
|
||||||
|
case size of {
|
||||||
|
Num1 => "tisíc" ;
|
||||||
|
Num2_4 => attr ++ "tisíce" ;
|
||||||
|
Num5 => attr ++ "tisíc"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper determinerStr : Determiner -> Str = \d -> d.s ! Masc Anim ! Nom ;
|
||||||
|
|
||||||
|
|
||||||
|
-- -- Numerals as sequences of digits have a separate, simpler grammar
|
||||||
|
lincat Dig = {s:Str ; size : NumSize} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
IDig d = d ;
|
||||||
|
|
||||||
|
IIDig d dd = {s = d.s ++ Predef.BIND ++ dd.s ; size = Num5} ; ---- leading zeros ??
|
||||||
|
|
||||||
|
D_0 = { s = "0" ; size = Num1} ; ---- ??
|
||||||
|
D_1 = { s = "1" ; size = Num1} ;
|
||||||
|
D_2 = { s = "2" ; size = Num2_4} ;
|
||||||
|
D_3 = { s = "3" ; size = Num2_4} ;
|
||||||
|
D_4 = { s = "4" ; size = Num2_4} ;
|
||||||
|
D_5 = { s = "5" ; size = Num5} ;
|
||||||
|
D_6 = { s = "6" ; size = Num5} ;
|
||||||
|
D_7 = { s = "7" ; size = Num5} ;
|
||||||
|
D_8 = { s = "8" ; size = Num5} ;
|
||||||
|
D_9 = { s = "9" ; size = Num5} ;
|
||||||
|
|
||||||
|
}
|
||||||
141
src/czech/ParadigmsCze.gf
Normal file
141
src/czech/ParadigmsCze.gf
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
resource ParadigmsCze = open CatCze, ResCze, Prelude in {
|
||||||
|
|
||||||
|
----------------
|
||||||
|
-- Parameters
|
||||||
|
|
||||||
|
oper
|
||||||
|
singular : Number
|
||||||
|
= Sg ;
|
||||||
|
plural : Number
|
||||||
|
= Pl ;
|
||||||
|
|
||||||
|
mascAnimate : Gender
|
||||||
|
= Masc Anim ;
|
||||||
|
mascInanimate : Gender
|
||||||
|
= Masc Inanim ;
|
||||||
|
feminine : Gender
|
||||||
|
= Fem ;
|
||||||
|
neuter : Gender
|
||||||
|
= Neutr ;
|
||||||
|
|
||||||
|
nominative : Case
|
||||||
|
= Nom ;
|
||||||
|
genitive : Case
|
||||||
|
= Gen ;
|
||||||
|
dative : Case
|
||||||
|
= Dat ;
|
||||||
|
accusative : Case
|
||||||
|
= Acc ;
|
||||||
|
vocative : Case
|
||||||
|
= ResCze.Voc ;
|
||||||
|
locative : Case
|
||||||
|
= Loc ;
|
||||||
|
instrumental : Case
|
||||||
|
= Ins ;
|
||||||
|
|
||||||
|
------------------------------
|
||||||
|
-- Nouns
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkN = overload {
|
||||||
|
mkN : (nom : Str) -> N
|
||||||
|
= \nom -> lin N (guessNounForms nom) ;
|
||||||
|
mkN : (nom,gen : Str) -> Gender -> N
|
||||||
|
= \nom,gen,g -> lin N (declensionNounForms nom gen g) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- The following standard declensions can be used with good accuracy.
|
||||||
|
-- However, they have some defaults that may have to be overwritten.
|
||||||
|
-- This can be done easily by overriding those formes with record extension (**).
|
||||||
|
-- The default extensions are shown in comments; if the default is correct, no extension is needed.
|
||||||
|
|
||||||
|
panN : Str -> N -- default ** {pnom = +i}
|
||||||
|
= \s -> lin N (declPAN s) ;
|
||||||
|
predsedaN : Str -> N -- default ** {sgen = +i}
|
||||||
|
= \s -> lin N (declPREDSEDA s) ;
|
||||||
|
hradN : Str -> N -- default ** {sgen,sloc = +u}
|
||||||
|
= \s -> lin N (declHRAD s) ;
|
||||||
|
zenaN : Str -> N -- default ** {pgen = zen}
|
||||||
|
= \s -> lin N (declZENA s) ;
|
||||||
|
mestoN : Str -> N -- default ** {sloc = +u ; pgen = mest ; ploc = +ech}
|
||||||
|
= \s -> lin N (declMESTO s) ;
|
||||||
|
muzN : Str -> N
|
||||||
|
= \s -> lin N (declMUZ s) ;
|
||||||
|
soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i}
|
||||||
|
= \s -> lin N (declSOUDCE s) ;
|
||||||
|
strojN : Str -> N
|
||||||
|
= \s -> lin N (declSTROJ s) ;
|
||||||
|
ruzeN : Str -> N
|
||||||
|
= \s -> lin N (declRUZE s) ;
|
||||||
|
pisenN : Str -> N
|
||||||
|
= \s -> lin N (declPISEN s) ;
|
||||||
|
kostN : Str -> N
|
||||||
|
= \s -> lin N (declKOST s) ;
|
||||||
|
kureN : Str -> N
|
||||||
|
= \s -> lin N (declKURE s) ;
|
||||||
|
moreN : Str -> N -- default ** {pgen = +í}
|
||||||
|
= \s -> lin N (declMORE s) ;
|
||||||
|
staveniN : Str -> N
|
||||||
|
= \s -> lin N (declSTAVENI s) ;
|
||||||
|
|
||||||
|
-- The full definition of the noun record is
|
||||||
|
-- {
|
||||||
|
-- snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ;
|
||||||
|
-- g : Gender
|
||||||
|
-- }
|
||||||
|
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
-- Adjectives
|
||||||
|
|
||||||
|
-- Only positive forms so far ----
|
||||||
|
|
||||||
|
mkA = overload {
|
||||||
|
mkA : Str -> A
|
||||||
|
= \s -> lin A (case s of {
|
||||||
|
_ + "ý" => mladyAdjForms s ;
|
||||||
|
_ + "í" => jarniAdjForms s ;
|
||||||
|
_ + "ův" => otcuvAdjForms s ;
|
||||||
|
_ + "in" => matcinAdjForms s ;
|
||||||
|
_ => Predef.error ("no mkA for" ++ s)
|
||||||
|
}) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mladyA : Str -> A
|
||||||
|
= \s -> lin A (mladyAdjForms s) ;
|
||||||
|
jarniA : Str -> A
|
||||||
|
= \s -> lin A (jarniAdjForms s) ;
|
||||||
|
otcuvA : Str -> A
|
||||||
|
= \s -> lin A (otcuvAdjForms s) ;
|
||||||
|
matcinA : Str -> A
|
||||||
|
= \s -> lin A (matcinAdjForms s) ;
|
||||||
|
|
||||||
|
mkA2 : A -> Prep -> A2
|
||||||
|
= \a,p -> lin A2 (a ** {c = p}) ;
|
||||||
|
|
||||||
|
-------------------------
|
||||||
|
-- Verbs
|
||||||
|
|
||||||
|
mkV2 = overload {
|
||||||
|
mkV2 : VerbForms -> VerbForms ** {c : ComplementCase}
|
||||||
|
= \vf -> vf ** {c = {s = [] ; c = Acc ; hasPrep = False}} ;
|
||||||
|
mkV2 : VerbForms -> Case -> VerbForms ** {c : ComplementCase}
|
||||||
|
= \vf,c -> vf ** {c = {s = [] ; c = c ; hasPrep = False}} ;
|
||||||
|
mkV2 : VerbForms -> ComplementCase -> VerbForms ** {c : ComplementCase}
|
||||||
|
= \vf,c -> vf ** {c = c} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
------------------------
|
||||||
|
-- Adverbs, prepositions, conjunctions, ...
|
||||||
|
|
||||||
|
mkAdv : Str -> Adv
|
||||||
|
= \s -> lin Adv {s = s} ;
|
||||||
|
|
||||||
|
mkPrep : Str -> Case -> Prep
|
||||||
|
= \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; ---- True if s /= ""
|
||||||
|
|
||||||
|
mkConj : Str -> Conj
|
||||||
|
= \s -> lin Conj {s1 = [] ; s2 = s} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
19
src/czech/PhraseCze.gf
Normal file
19
src/czech/PhraseCze.gf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
concrete PhraseCze of Phrase = CatCze ** open Prelude, ResCze in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
UttS s = s ;
|
||||||
|
UttAdv adv = adv ;
|
||||||
|
UttCN cn = {s = cn.s ! Sg ! Nom} ;
|
||||||
|
UttAP ap = {s = ap.s ! Masc Anim ! Sg ! Nom} ;
|
||||||
|
UttNP np = {s = np.s ! Nom} ;
|
||||||
|
|
||||||
|
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||||
|
|
||||||
|
|
||||||
|
NoPConj = {s = []} ;
|
||||||
|
PConjConj conj = {s = conj.s2} ;
|
||||||
|
|
||||||
|
NoVoc = {s = []} ;
|
||||||
|
VocNP np = {s = np.s ! Voc} ;
|
||||||
|
|
||||||
|
}
|
||||||
7
src/czech/QuestionCze.gf
Normal file
7
src/czech/QuestionCze.gf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
concrete QuestionCze of Question = CatCze **
|
||||||
|
open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
QuestCl cl = cl ; ----
|
||||||
|
|
||||||
|
}
|
||||||
18
src/czech/RelativeCze.gf
Normal file
18
src/czech/RelativeCze.gf
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
concrete RelativeCze of Relative = CatCze ** open
|
||||||
|
ParadigmsCze,
|
||||||
|
ResCze,
|
||||||
|
Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
RelVP rp vp = vp ** {
|
||||||
|
subj =
|
||||||
|
let rel = (adjFormsAdjective rp).s
|
||||||
|
in \\a => case a of {
|
||||||
|
Ag g n _ => rel ! g ! n ! Nom
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IdRP = mkA "který" ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
884
src/czech/ResCze.gf
Normal file
884
src/czech/ResCze.gf
Normal file
@@ -0,0 +1,884 @@
|
|||||||
|
resource ResCze = open Prelude in {
|
||||||
|
|
||||||
|
-- AR March 2020
|
||||||
|
-- sources:
|
||||||
|
-- Wiki = https://en.wikipedia.org/wiki/Czech_declension, https://en.wikipedia.org/wiki/Czech_conjugation
|
||||||
|
-- CEG = J. Naughton, Czech: an Essential Grammar, Routledge 2005.
|
||||||
|
|
||||||
|
-- parameters
|
||||||
|
|
||||||
|
param
|
||||||
|
Number = Sg | Pl ;
|
||||||
|
|
||||||
|
Animacy = Anim | Inanim ;
|
||||||
|
Gender = Masc Animacy | Fem | Neutr ;
|
||||||
|
|
||||||
|
Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order
|
||||||
|
|
||||||
|
Person = P1 | P2 | P3 ;
|
||||||
|
|
||||||
|
Agr = Ag Gender Number Person ;
|
||||||
|
|
||||||
|
CTense = CTPres | CTPast ; ----- TODO complete the tense system to match Czech verb morphology
|
||||||
|
|
||||||
|
-- phonology
|
||||||
|
|
||||||
|
oper
|
||||||
|
hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ;
|
||||||
|
softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ;
|
||||||
|
neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ;
|
||||||
|
|
||||||
|
consonant : pattern Str =
|
||||||
|
#(
|
||||||
|
"d" | "t" | "g" | "h" | "k" | "n" | "r" |
|
||||||
|
"ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" |
|
||||||
|
"b" | "f" | "l" | "m" | "p" | "s" | "v"
|
||||||
|
) ;
|
||||||
|
|
||||||
|
dropFleetingE : Str -> Str = \s -> case s of {
|
||||||
|
x + "e" + c@("k"|"c") => x + c ;
|
||||||
|
x + "e" + "ň" => x + "n" ;
|
||||||
|
_ => s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
shortenVowel : Str -> Str = \s -> case s of {
|
||||||
|
x + "á" + y => x + "a" + y ;
|
||||||
|
x + "é" + y => x + "e" + y ;
|
||||||
|
x + "í" + y => x + "i" + y ;
|
||||||
|
x + "ý" + y => x + "y" + y ;
|
||||||
|
x + "ó" + y => x + "o" + y ;
|
||||||
|
x + "ú" + y => x + "u" + y ;
|
||||||
|
x + "ů" + y => x + "o" + y ;
|
||||||
|
_ => s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
addI : Str -> Str = \s -> case s of {
|
||||||
|
klu + "k" => klu + "ci" ;
|
||||||
|
vra + "h" => vra + "zi" ;
|
||||||
|
ce + "ch" => ce + "ši" ;
|
||||||
|
dokto + "r" => dokto + "ři" ;
|
||||||
|
pan => pan + "i"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
addAdjI : Str -> Str = \s -> case s of {
|
||||||
|
angli + "ck" => angli + "čtí" ;
|
||||||
|
ce + "sk" => ce + "ští" ;
|
||||||
|
_ => init (addI s) + "í"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- 3.4.10, in particular when also final 'a' is dropped
|
||||||
|
addE : Str -> Str = \s -> case s of {
|
||||||
|
re + "k" => re + "ce" ;
|
||||||
|
pra + ("g"|"h") => pra + "ze" ;
|
||||||
|
stre + "ch" => stre + "še" ;
|
||||||
|
sest + "r" => sest + "ře" ;
|
||||||
|
pan => pan + "ě"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
addEch : Str -> Str = \s -> case s of {
|
||||||
|
klu + "k" => klu + "cich" ;
|
||||||
|
vra + ("h"|"g") => vra + "zich" ;
|
||||||
|
ce + "ch" => ce + "šich" ;
|
||||||
|
pan => pan + "ech"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
shortFemPlGen : Str -> Str = \s -> case s of {
|
||||||
|
ul + "ice" => ul + "ic" ;
|
||||||
|
koleg + "yně" => koleg + "yň" ;
|
||||||
|
ruz + "e" => ruz + "i" ;
|
||||||
|
_ => Predef.error ("shortFemPlGen does not apply to" ++ s)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---------------
|
||||||
|
-- Nouns
|
||||||
|
---------------
|
||||||
|
|
||||||
|
-- novel idea (for RGL): lexical items stored as records rather than tables
|
||||||
|
-- advantages:
|
||||||
|
-- - easier to make exceptions to paradigms (by ** {})
|
||||||
|
-- - easier to keep the number of forms minimal
|
||||||
|
-- - easier to see what is happening than with lots of anonymous arguments to mkN, mkA, mkV
|
||||||
|
|
||||||
|
-- so this is the lincat of N
|
||||||
|
|
||||||
|
NounForms : Type = {snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ;
|
||||||
|
|
||||||
|
-- But traditional tables make agreement easier to handle in syntax
|
||||||
|
-- so this is the lincat of CN
|
||||||
|
|
||||||
|
Noun : Type = {s : Number => Case => Str ; g : Gender} ;
|
||||||
|
|
||||||
|
-- this is used in UseN
|
||||||
|
|
||||||
|
nounFormsNoun : NounForms -> Noun
|
||||||
|
= \forms -> {
|
||||||
|
s = table {
|
||||||
|
Sg => table {
|
||||||
|
Nom => forms.snom ;
|
||||||
|
Gen => forms.sgen ;
|
||||||
|
Dat => forms.sdat ;
|
||||||
|
Acc => forms.sacc ;
|
||||||
|
Voc => forms.svoc ;
|
||||||
|
Loc => forms.sloc ;
|
||||||
|
Ins => forms.sins
|
||||||
|
} ;
|
||||||
|
Pl => table {
|
||||||
|
Nom | Voc => forms.pnom ;
|
||||||
|
Gen => forms.pgen ;
|
||||||
|
Dat => forms.pdat ;
|
||||||
|
Acc => forms.pacc ;
|
||||||
|
Loc => forms.ploc ;
|
||||||
|
Ins => forms.pins
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
g = forms.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- terminology of CEG
|
||||||
|
DeclensionType : Type = Str -> NounForms ;
|
||||||
|
|
||||||
|
declensionNounForms : (nom,gen : Str) -> Gender -> NounForms
|
||||||
|
= \nom,gen,g ->
|
||||||
|
let decl : DeclensionType = case <g, nom, gen> of {
|
||||||
|
<Masc Anim, _ + #hardConsonant, _ + "a"> => declPAN ;
|
||||||
|
<Masc Anim, _ + "a" , _ + "a"> => declPREDSEDA ;
|
||||||
|
<Masc Inanim, _ + #hardConsonant, _ + "u"> => declHRAD ;
|
||||||
|
<Fem, _ + "a" , _ + "y"> => declZENA ;
|
||||||
|
<Neutr, _ + "o" , _ + "a"> => declMESTO ;
|
||||||
|
<Masc Anim, _ + #softConsonant, _ + "e"> => declMUZ ;
|
||||||
|
<Masc Anim, _ + "tel" , _ + "e"> => declMUZ ;
|
||||||
|
<Masc Anim, _ + "ce" , _ + "e"> => declSOUDCE ;
|
||||||
|
<Masc Inanim, _ + #softConsonant, _ + "e"> => declSTROJ ;
|
||||||
|
<Fem, _ + ("e"|"ě") , _ + ("e"|"ě")> => declRUZE ;
|
||||||
|
<Fem, _ + #softConsonant, _ + "e"> => declPISEN ;
|
||||||
|
<Fem, _ + "ost" , _ + "i"> => declKOST ; --- also many other "st" 3.6.3
|
||||||
|
<Neutr, _ + "e" , _+"ete"> => declKURE ;
|
||||||
|
<Neutr, _ + "e" , _ + "e"> => declMORE ;
|
||||||
|
<Neutr, _ + "í" , _ + "í"> => declSTAVENI ;
|
||||||
|
_ => Predef.error ("cannot infer declension type for" ++ nom ++ gen)
|
||||||
|
}
|
||||||
|
in decl nom ;
|
||||||
|
|
||||||
|
-- the "smartest" one-argument mkN
|
||||||
|
|
||||||
|
guessNounForms : Str -> NounForms
|
||||||
|
= \s -> case s of {
|
||||||
|
_ + "ost" => declKOST s ;
|
||||||
|
_ + "tel" => declMUZ s ;
|
||||||
|
_ + #hardConsonant => declHRAD s ;
|
||||||
|
_ + #softConsonant => declSTROJ s ;
|
||||||
|
_ + "a" => declZENA s ;
|
||||||
|
_ + "o" => declMESTO s ;
|
||||||
|
_ + "ce" => declSOUDCE s ;
|
||||||
|
_ + "e" => declMORE s ;
|
||||||
|
_ + "í" => declSTAVENI s ;
|
||||||
|
_ => Predef.error ("cannot guess declension type for" ++ s)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- the traditional declensions, in both CEG and Wiki
|
||||||
|
-- they are also exported in ParadigmsCze with names panN etc
|
||||||
|
|
||||||
|
declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1
|
||||||
|
{
|
||||||
|
snom = pan ;
|
||||||
|
sgen,sacc = pan + "a" ;
|
||||||
|
sdat,sloc = pan + "ovi" ; --- pánu
|
||||||
|
svoc = shortenVowel pan + "e" ; --- "irregular shortening" 3.5.1
|
||||||
|
sins = pan + "em" ;
|
||||||
|
|
||||||
|
pnom = addI pan ; -- pani, kluk-kluci --- panové, host-hosté
|
||||||
|
pgen = pan + "ů" ;
|
||||||
|
pdat = pan + "ům" ;
|
||||||
|
pacc,pins = pan + "y" ;
|
||||||
|
ploc = addEch pan ;
|
||||||
|
g = Masc Anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i
|
||||||
|
let predsed = init predseda
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom = predseda ;
|
||||||
|
sgen = predsed + "y" ; -- pacc,pins --- i
|
||||||
|
sdat,sloc = predsed + "ovi" ;
|
||||||
|
sacc = predsed + "u" ;
|
||||||
|
svoc = predsed + "o" ;
|
||||||
|
sins = predsed + "ou" ;
|
||||||
|
|
||||||
|
pnom = case predseda of {
|
||||||
|
tur + "ista" => tur + "isté" ;
|
||||||
|
_ => predsed + "ové"
|
||||||
|
} ;
|
||||||
|
pgen = predsed + "ů" ;
|
||||||
|
pdat = predsed + "ům" ;
|
||||||
|
pacc,pins = predsed + "y" ;
|
||||||
|
ploc = addEch predsed ;
|
||||||
|
g = Masc Anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declHRAD : DeclensionType = \hrad -> --- 3.5.2: sloc u/ě/e extra arg, sport-u, hrad-ě ; sgen u/a
|
||||||
|
let hrd = dropFleetingE hrad
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sacc = hrad ;
|
||||||
|
sgen,sdat = hrd + "u" ; --- Berlín-a
|
||||||
|
sloc = hrd + "u" ; --- addE hrad ; -- stůl-stole
|
||||||
|
svoc = hrd + "e" ;
|
||||||
|
sins = hrd + "em" ;
|
||||||
|
|
||||||
|
pnom,pacc,pins = hrd + "y" ;
|
||||||
|
pgen = hrd + "ů" ;
|
||||||
|
pdat = hrd + "ům" ;
|
||||||
|
ploc = addEch hrd ;
|
||||||
|
g = Masc Inanim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declZENA : DeclensionType = \zena -> --- 3.6.1 sge y/i ; pgen sometimes shortening
|
||||||
|
let zen = init zena
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom = zena ;
|
||||||
|
sgen = zen + "y" ; --- i after soft cons sometimes
|
||||||
|
sdat,sloc = zen + "ě" ; --- i after soft cons sometimes ; skol+e
|
||||||
|
sacc = zen + "u" ;
|
||||||
|
svoc = shortenVowel zen + "o" ; ---- shorten ?
|
||||||
|
sins = zen + "ou" ;
|
||||||
|
|
||||||
|
pnom,pacc = zen + "y" ; --- also sgen
|
||||||
|
pgen = zen ; --- sometimes with vowel shortening
|
||||||
|
pdat = zen + "ám" ;
|
||||||
|
ploc = zen + "ách" ;
|
||||||
|
pins = zen + "ami" ;
|
||||||
|
g = Fem
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declMESTO : DeclensionType = \mesto -> --- 3.7.1 sloc u/e ; pgen vowel shortening sometimes ; ploc variations
|
||||||
|
let mest = init mesto
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sacc,svoc = mesto ;
|
||||||
|
sgen = mest + "a" ;
|
||||||
|
sdat = mest + "u" ;
|
||||||
|
sloc = mest + "u" ; --- "ě"
|
||||||
|
sins = mest + "em" ;
|
||||||
|
|
||||||
|
pnom,pacc = mest + "a" ;
|
||||||
|
pgen = mest ; --- léta - let
|
||||||
|
pdat = mest + "ům" ;
|
||||||
|
ploc = mest + "ech" ; --- with variations
|
||||||
|
pins = mest + "y" ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declMUZ : DeclensionType = \muz_ -> --- 3.5.3 : sdat,sloc ; pnom
|
||||||
|
let muz = dropFleetingE muz_
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom = muz_ ;
|
||||||
|
sgen,sacc = muz + "e" ; --- pacc
|
||||||
|
sdat,sloc = muz + "i" ; --- muzovi
|
||||||
|
svoc = case muz_ of {
|
||||||
|
chlap + "ec" => chlap + "če" ;
|
||||||
|
_ => muz + "i"
|
||||||
|
} ;
|
||||||
|
sins = muz + "em" ;
|
||||||
|
|
||||||
|
pnom = case muz_ of {
|
||||||
|
uci + "tel" => uci + "tele" ;
|
||||||
|
_ => muz + "i" --- muzové
|
||||||
|
} ;
|
||||||
|
pgen = muz + "ů" ;
|
||||||
|
pacc = muz + "e" ;
|
||||||
|
pdat = muz + "ům" ;
|
||||||
|
ploc = muz + "ích" ;
|
||||||
|
pins = muz + "i" ;
|
||||||
|
g = Masc Anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declSOUDCE : DeclensionType = \soudce -> --- 3.5.3: sdat/sloc i,ovi ; pnom i/ové
|
||||||
|
let soudc = init soudce
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sgen,sacc,svoc = soudce ; ---- pacc
|
||||||
|
sdat,sloc = soudc + "i" ; --- soudcovi
|
||||||
|
sins = soudc + "em" ;
|
||||||
|
|
||||||
|
pnom = soudc + "i" ; --- soudcové
|
||||||
|
pgen = soudc + "ů" ;
|
||||||
|
pdat = soudc + "ům" ;
|
||||||
|
pacc = soudce ;
|
||||||
|
ploc = soudc + "ích" ;
|
||||||
|
pins = soudc + "i" ;
|
||||||
|
g = Masc Anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declSTROJ : DeclensionType = \stroj ->
|
||||||
|
{
|
||||||
|
snom,sacc = stroj ;
|
||||||
|
sgen = stroj + "e" ; --- pnom,pacc
|
||||||
|
sdat,svoc,sloc = stroj + "i" ; --- pins ---- svoc shorten?
|
||||||
|
sins = stroj + "em" ;
|
||||||
|
|
||||||
|
pnom,pacc = stroj + "e" ;
|
||||||
|
pgen = stroj + "ů" ;
|
||||||
|
pdat = stroj + "ům" ;
|
||||||
|
ploc = stroj + "ích" ;
|
||||||
|
pins = stroj + "i" ;
|
||||||
|
g = Masc Inanim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declRUZE : DeclensionType = \ruze -> --- 3.6.2: pgen ulice-ulic, chvile-cvil
|
||||||
|
let ruz = init ruze
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sgen,svoc = ruze ; --- pnom,pacc
|
||||||
|
sdat,sacc,sloc,sins = ruz + "i" ;
|
||||||
|
|
||||||
|
pnom,pacc = ruze ;
|
||||||
|
pgen = shortFemPlGen ruze ;
|
||||||
|
pdat = ruz + "ím" ;
|
||||||
|
ploc = ruz + "ích" ;
|
||||||
|
pins = ruz + "emi" ;
|
||||||
|
g = Fem
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declPISEN : DeclensionType = \pisen ->
|
||||||
|
let pisn = dropFleetingE pisen
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sacc = pisen ;
|
||||||
|
sgen = pisn + "ě" ;
|
||||||
|
sdat,svoc,sloc = pisn + "i" ; -- not shortened
|
||||||
|
sins = pisn + "í" ;
|
||||||
|
|
||||||
|
pnom,pacc = pisn + "ě" ;
|
||||||
|
pgen = pisn + "í" ;
|
||||||
|
pdat = pisn + "ím" ;
|
||||||
|
ploc = pisn + "ích" ;
|
||||||
|
pins = pisn + "ěmi" ;
|
||||||
|
g = Fem
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declKOST : DeclensionType = \kost ->
|
||||||
|
{
|
||||||
|
snom,sacc = kost ;
|
||||||
|
sgen,sdat,svoc,sloc = kost + "i" ; --- pnom,pacc
|
||||||
|
sins = kost + "í" ; --- pgen
|
||||||
|
|
||||||
|
pnom,pacc = kost + "i" ;
|
||||||
|
pgen = kost + "í" ;
|
||||||
|
pdat = kost + "em" ;
|
||||||
|
ploc = kost + "ech" ;
|
||||||
|
pins = kost + "mi" ;
|
||||||
|
g = Fem
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declKURE : DeclensionType = \kure ->
|
||||||
|
let kur = init kure
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sacc,svoc = kure ;
|
||||||
|
sgen = kur + "ete" ;
|
||||||
|
sdat,sloc = kur + "eti" ;
|
||||||
|
sins = kur + "etem" ;
|
||||||
|
|
||||||
|
pnom,pacc = kur + "ata" ;
|
||||||
|
pgen = kur + "at" ;
|
||||||
|
pdat = kur + "atům" ;
|
||||||
|
ploc = kur + "atech" ;
|
||||||
|
pins = kur + "aty" ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes
|
||||||
|
let mor = init more
|
||||||
|
in
|
||||||
|
{
|
||||||
|
snom,sgen,sacc,svoc = more ; --- pnom
|
||||||
|
sdat,sloc = mor + "i" ; --- pins
|
||||||
|
sins = mor + "em" ;
|
||||||
|
|
||||||
|
pnom,pacc = more ;
|
||||||
|
pgen = mor + "í" ; ---
|
||||||
|
pdat = mor + "ím" ;
|
||||||
|
ploc = mor + "ích" ;
|
||||||
|
pins = mor + "i" ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
declSTAVENI : DeclensionType = \staveni ->
|
||||||
|
{
|
||||||
|
snom,sgen,sdat,sacc,svoc,sloc = staveni ;
|
||||||
|
sins = staveni + "m" ;
|
||||||
|
|
||||||
|
pnom,pgen,pacc = staveni ;
|
||||||
|
pdat = staveni + "m" ;
|
||||||
|
ploc = staveni + "ch" ;
|
||||||
|
pins = staveni + "mi" ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
-- Adjectives
|
||||||
|
|
||||||
|
-- to be used for AP: 56 forms for each degree
|
||||||
|
Adjective : Type = {s : Gender => Number => Case => Str} ;
|
||||||
|
|
||||||
|
-- to be used for A, in three degrees: 15 forms in each
|
||||||
|
---- TODO other degrees than positive
|
||||||
|
|
||||||
|
AdjForms : Type = {
|
||||||
|
msnom, fsnom, nsnom : Str ; -- svoc = snom
|
||||||
|
msgen, fsgen : Str ; -- nsgen = msgen, pacc = fsgen
|
||||||
|
msdat, fsdat : Str ; -- nsdat = msdat
|
||||||
|
fsacc : Str ; -- amsacc = msgen, imsacc = msnom, nsacc = nsnom
|
||||||
|
msloc : Str ; -- fsloc = fsdat, nsloc = msloc
|
||||||
|
msins, fsins : Str ; -- nsins = msins, pdat = msins
|
||||||
|
|
||||||
|
mpnom,fpnom : Str ; -- pvoc = pnom, impnom = fpnom, npnom = fsnom
|
||||||
|
pgen : Str ; -- ploc = pgen
|
||||||
|
pins : Str ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- used in PositA but will also work in Compar and Superl by calling their record fields
|
||||||
|
|
||||||
|
adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||||
|
s = \\g,n,c => case <n,c,g> of {
|
||||||
|
|
||||||
|
<Sg, Nom|Voc, Masc _>
|
||||||
|
| <Sg, Acc, Masc Inanim> => afs.msnom ;
|
||||||
|
<Sg, Nom|Voc, Fem>
|
||||||
|
| <Pl, Nom|Acc|Voc, Neutr> => afs.fsnom ;
|
||||||
|
<Sg, Nom|Acc|Voc, Neutr> => afs.nsnom ;
|
||||||
|
|
||||||
|
<Sg, Gen, Masc _ | Neutr>
|
||||||
|
| <Sg,Acc,Masc Anim> => afs.msgen ;
|
||||||
|
<Sg, Gen, Fem>
|
||||||
|
| <Pl,Acc,Masc _|Fem> => afs.fsgen ;
|
||||||
|
|
||||||
|
<Sg, Dat, Masc _|Neutr> => afs.msdat ;
|
||||||
|
<Sg, Dat|Loc, Fem> => afs.fsdat ;
|
||||||
|
|
||||||
|
<Sg, Acc, Fem> => afs.fsacc ;
|
||||||
|
|
||||||
|
<Sg, Loc, Masc _|Neutr> => afs.msloc ;
|
||||||
|
|
||||||
|
<Sg, Ins, Masc _|Neutr>
|
||||||
|
| <Pl,Dat,_> => afs.msins ;
|
||||||
|
<Sg, Ins, Fem> => afs.fsins ;
|
||||||
|
|
||||||
|
<Pl, Nom|Voc, Masc Anim> => afs.mpnom ;
|
||||||
|
<Pl, Nom|Voc, Masc Inanim|Fem> => afs.fpnom ;
|
||||||
|
|
||||||
|
<Pl, Gen|Loc,_> => afs.pgen ;
|
||||||
|
<Pl, Ins,_> => afs.pins
|
||||||
|
}
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- hard declension
|
||||||
|
|
||||||
|
mladyAdjForms : Str -> AdjForms = \mlady ->
|
||||||
|
let mlad = init mlady
|
||||||
|
in {
|
||||||
|
msnom = mlad + "ý" ;
|
||||||
|
fsnom = mlad + "á" ;
|
||||||
|
nsnom,fsgen,fsdat,fpnom = mlad + "é" ;
|
||||||
|
msgen = mlad + "ého" ;
|
||||||
|
msdat = mlad + "ému" ;
|
||||||
|
fsacc,fsins = mlad + "ou" ;
|
||||||
|
msloc = mlad + "ém" ;
|
||||||
|
msins,pdat = mlad + "ým" ;
|
||||||
|
mpnom = addAdjI mlad ;
|
||||||
|
pgen = mlad + "ých" ;
|
||||||
|
pins = mlad + "ými" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- soft declension
|
||||||
|
|
||||||
|
jarniAdjForms : Str -> AdjForms = \jarni ->
|
||||||
|
{
|
||||||
|
msnom,fsnom,nsnom,
|
||||||
|
fsgen,fsdat,fsacc,fsins,
|
||||||
|
mpnom,fpnom = jarni ;
|
||||||
|
msgen = jarni + "ho" ;
|
||||||
|
msdat = jarni + "mu" ;
|
||||||
|
msloc,msins = jarni + "m" ;
|
||||||
|
pgen = jarni + "ch" ;
|
||||||
|
pins = jarni + "mi" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- masculine possession: the same endings as in feminine
|
||||||
|
|
||||||
|
otcuvAdjForms : Str -> AdjForms = \otcuv ->
|
||||||
|
let otcov = Predef.tk 2 otcuv + "ov"
|
||||||
|
in
|
||||||
|
matcinAdjForms otcov ** {msnom = otcuv} ;
|
||||||
|
|
||||||
|
-- feminine possession
|
||||||
|
|
||||||
|
matcinAdjForms : Str -> AdjForms = \matcin ->
|
||||||
|
{
|
||||||
|
msnom = matcin ;
|
||||||
|
fsnom,msgen = matcin + "a" ;
|
||||||
|
nsnom = matcin + "o" ;
|
||||||
|
fsgen,fpnom = matcin + "y" ;
|
||||||
|
msdat,fsacc = matcin + "u" ;
|
||||||
|
fsdat,msloc = matcin + "ě" ;
|
||||||
|
msins = matcin + "ým" ;
|
||||||
|
fsins = matcin + "ou" ;
|
||||||
|
mpnom = matcin + "i" ;
|
||||||
|
pgen = matcin + "ých" ;
|
||||||
|
pins = matcin + "ými" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---------------------
|
||||||
|
-- Verbs
|
||||||
|
|
||||||
|
VerbForms : Type = { ---- TODO more forms to add
|
||||||
|
inf,
|
||||||
|
pressg1, pressg2, pressg3,
|
||||||
|
prespl1, prespl2, prespl3,
|
||||||
|
pastpartsg, pastpartpl,
|
||||||
|
---- passpart,
|
||||||
|
negpressg3 : Str -- matters only for copula
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ;
|
||||||
|
|
||||||
|
verbAgr : VerbForms -> Agr -> Bool -> Str ---- TODO tenses
|
||||||
|
= \vf,a,b -> case a of {
|
||||||
|
Ag _ Sg P1 => vf.pressg1 ;
|
||||||
|
Ag _ Sg P2 => vf.pressg2 ;
|
||||||
|
Ag _ Sg P3 => case b of {
|
||||||
|
True => vf.pressg3 ;
|
||||||
|
False => vf.negpressg3 -- matters only for copula
|
||||||
|
} ;
|
||||||
|
Ag _ Pl P1 => vf.prespl1 ;
|
||||||
|
Ag _ Pl P2 => vf.prespl2 ;
|
||||||
|
Ag _ Pl P3 => vf.prespl3
|
||||||
|
} ;
|
||||||
|
|
||||||
|
copulaVerbForms : VerbForms = {
|
||||||
|
inf = "být" ;
|
||||||
|
pressg1 = "jsem" ;
|
||||||
|
pressg2 = "jsi" ;
|
||||||
|
pressg3 = "je" ;
|
||||||
|
prespl1 = "jsme" ;
|
||||||
|
prespl2 = "jste" ;
|
||||||
|
prespl3 = "jsou" ;
|
||||||
|
pastpartsg = "byl" ;
|
||||||
|
pastpartpl = "byli" ;
|
||||||
|
negpressg3 = "ní" ; -- ne is added to this
|
||||||
|
} ;
|
||||||
|
|
||||||
|
haveVerbForms : VerbForms = {
|
||||||
|
inf = "mít" ;
|
||||||
|
pressg1 = "mám" ;
|
||||||
|
pressg2 = "máš" ;
|
||||||
|
pressg3, negpressg3 = "má" ;
|
||||||
|
prespl1 = "máme" ;
|
||||||
|
prespl2 = "máte" ;
|
||||||
|
prespl3 = "mají" ;
|
||||||
|
pastpartsg = "měl" ;
|
||||||
|
pastpartpl = "měli" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- just an example of a traditional paradigm
|
||||||
|
---- TODO other traditional paradigms
|
||||||
|
|
||||||
|
iii_kupovatVerbForms : Str -> VerbForms = \kupovat ->
|
||||||
|
let
|
||||||
|
kupo = Predef.tk 3 kupovat ;
|
||||||
|
kupu = Predef.tk 1 kupo + "u"
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inf = kupovat ;
|
||||||
|
pressg1 = kupu + "ji" ; --- kupuju
|
||||||
|
pressg2 = kupu + "ješ" ;
|
||||||
|
pressg3, negpressg3 = kupu + "je" ;
|
||||||
|
prespl1 = kupu + "jeme" ;
|
||||||
|
prespl2 = kupu + "jete" ;
|
||||||
|
prespl3 = kupu + "jí" ; --- kupujou
|
||||||
|
pastpartsg = kupo + "val" ;
|
||||||
|
pastpartpl = kupo + "vali" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
-- Pronouns
|
||||||
|
|
||||||
|
PronForms : Type = {
|
||||||
|
nom, cnom, -- cnom is the pro-drop subject
|
||||||
|
gen, cgen,pgen, -- bare, clitic, prepositional
|
||||||
|
acc, cacc,pacc,
|
||||||
|
dat, cdat,pdat,
|
||||||
|
loc,
|
||||||
|
ins,pins : Str ;
|
||||||
|
a : Agr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---- TODO: possessives
|
||||||
|
|
||||||
|
personalPron : Agr -> PronForms = \a ->
|
||||||
|
{a = a ; cnom = []} **
|
||||||
|
case a of {
|
||||||
|
Ag _ Sg P1 => {
|
||||||
|
nom = "já" ;
|
||||||
|
gen,acc,pgen,pacc = "mne" ;
|
||||||
|
cgen,cacc = "mě" ;
|
||||||
|
dat,pdat,loc = "mně" ;
|
||||||
|
cdat = "mi" ;
|
||||||
|
ins,pins = "mnou"
|
||||||
|
} ;
|
||||||
|
Ag _ Sg P2 => {
|
||||||
|
nom = "ty" ;
|
||||||
|
gen,acc,pgen,pacc = "tebe" ;
|
||||||
|
cgen,cacc = "tě" ;
|
||||||
|
dat,pdat,loc = "tobě" ;
|
||||||
|
cdat = "ti" ;
|
||||||
|
ins,pins = "tebou"
|
||||||
|
} ;
|
||||||
|
Ag (Masc _) Sg P3 => {
|
||||||
|
nom = "on" ;
|
||||||
|
gen,acc = "jeho" ;
|
||||||
|
cgen,cacc = "ho" ;
|
||||||
|
pgen,pacc = "něho" ;
|
||||||
|
dat = "jemu" ;
|
||||||
|
cdat = "mu" ;
|
||||||
|
pdat = "němu" ;
|
||||||
|
loc = "něm" ;
|
||||||
|
ins = "jím" ;
|
||||||
|
pins = "ním" ;
|
||||||
|
} ;
|
||||||
|
Ag Fem Sg P3 => {
|
||||||
|
nom = "ona" ;
|
||||||
|
gen = "její" ;
|
||||||
|
dat,acc,cgen,cacc,cdat,ins = "ji" ;
|
||||||
|
pgen,pdat,pacc,loc,pins = "ní" ;
|
||||||
|
} ;
|
||||||
|
Ag Neutr Sg P3 => {
|
||||||
|
nom = "ono" ;
|
||||||
|
gen = "jeho" ;
|
||||||
|
cgen,cacc = "ho" ;
|
||||||
|
pgen = "něho" ;
|
||||||
|
dat = "jemu" ;
|
||||||
|
acc = "je" ;
|
||||||
|
pacc = "ně" ;
|
||||||
|
cdat = "mu" ;
|
||||||
|
pdat = "němu" ;
|
||||||
|
loc = "něm" ;
|
||||||
|
ins = "jím" ;
|
||||||
|
pins = "ním" ;
|
||||||
|
} ;
|
||||||
|
Ag _ Pl P1 => {
|
||||||
|
nom = "my" ;
|
||||||
|
gen,acc,
|
||||||
|
cgen,cacc,
|
||||||
|
pgen,pacc,
|
||||||
|
loc = "nás" ;
|
||||||
|
dat,cdat,pdat = "nám" ;
|
||||||
|
ins,pins = "námi" ;
|
||||||
|
} ;
|
||||||
|
Ag _ Pl P2 => {
|
||||||
|
nom = "vy" ;
|
||||||
|
gen,acc,
|
||||||
|
cgen,cacc,
|
||||||
|
pgen,pacc,
|
||||||
|
loc = "vás" ;
|
||||||
|
dat,cdat,pdat = "vám" ;
|
||||||
|
ins,pins = "vámi" ;
|
||||||
|
} ;
|
||||||
|
Ag g Pl P3 => {
|
||||||
|
nom = case g of {
|
||||||
|
Masc _ => "oni" ;
|
||||||
|
Fem => "ony" ;
|
||||||
|
Neutr => "ona"
|
||||||
|
} ;
|
||||||
|
gen,cgen = "jich" ;
|
||||||
|
pgen = "nich" ;
|
||||||
|
dat,cdat = "jim" ;
|
||||||
|
pdat = "nim" ;
|
||||||
|
acc,cacc = "je" ;
|
||||||
|
pacc = "ně" ;
|
||||||
|
loc = "nich" ;
|
||||||
|
ins = "jimi" ;
|
||||||
|
pins = "nimi" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- demonstrative pronouns, used for Quant and Det
|
||||||
|
|
||||||
|
oper
|
||||||
|
DemPronForms : Type = {
|
||||||
|
msnom, fsnom, nsnom,
|
||||||
|
msgen, fsgen,
|
||||||
|
msdat, -- fsdat = fsgen unlike AdjForms
|
||||||
|
fsacc,
|
||||||
|
msloc,
|
||||||
|
msins, fsins,
|
||||||
|
mpnom, fpnom, -- mpacc = fpacc = fpnom
|
||||||
|
pgen,
|
||||||
|
pdat, -- NOT msins like AdjForms
|
||||||
|
pins : Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
demPronFormsAdjective : DemPronForms -> Str -> Adjective =
|
||||||
|
\dem,s ->
|
||||||
|
let
|
||||||
|
demAdj = dem ** {fsdat = dem.fsgen} ;
|
||||||
|
adjAdj = adjFormsAdjective demAdj
|
||||||
|
in {
|
||||||
|
s = \\g,n,c => case <g,n,c> of {
|
||||||
|
<_,Pl,Dat> => dem.pdat ;
|
||||||
|
<Masc _ | Fem, Pl, Acc> => dem.fpnom ;
|
||||||
|
_ => adjAdj.s ! g ! n ! c
|
||||||
|
} + s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Determiner : Type = {
|
||||||
|
s : Gender => Case => Str ;
|
||||||
|
size : NumSize
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkDemPronForms : Str -> DemPronForms = \t -> {
|
||||||
|
msnom = t + "en" ;
|
||||||
|
fsnom = t + "a" ;
|
||||||
|
nsnom = t + "o" ;
|
||||||
|
msgen = t + "oho" ;
|
||||||
|
fsgen = t + "é" ;
|
||||||
|
msdat = t + "omu" ;
|
||||||
|
fsacc = t + "u" ;
|
||||||
|
msloc = t + "om" ;
|
||||||
|
msins = t + "ím" ;
|
||||||
|
fsins = t + "ou" ;
|
||||||
|
mpnom = t + "i" ;
|
||||||
|
fpnom = t + "y" ;
|
||||||
|
pgen = t + "ěch" ;
|
||||||
|
pdat = t + "ěm" ;
|
||||||
|
pins = t + "ěmi" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
invarDemPronForms : Str -> DemPronForms = \s -> {
|
||||||
|
msnom, fsnom, nsnom, msgen, fsgen,
|
||||||
|
msdat, fsacc, msloc, msins, fsins,
|
||||||
|
mpnom, fpnom, pgen, pdat, pins = s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- interrogatives
|
||||||
|
|
||||||
|
kdoForms : Case => Str = table {
|
||||||
|
Nom => "kdo" ;
|
||||||
|
Gen | Acc | Voc => "koho" ;
|
||||||
|
Dat => "komu" ;
|
||||||
|
Loc => "kom" ;
|
||||||
|
Ins => "kým"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
coForms : Case => Str = table {
|
||||||
|
Nom|Acc|Voc => "co" ;
|
||||||
|
Gen => "čeho" ;
|
||||||
|
Dat => "čemu" ;
|
||||||
|
Loc => "čem" ;
|
||||||
|
Ins => "čím"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- Numerals
|
||||||
|
|
||||||
|
-- singular forms of demonstratives
|
||||||
|
NumeralForms : Type = {
|
||||||
|
msnom, fsnom, nsnom,
|
||||||
|
msgen, fsgen,
|
||||||
|
msdat,
|
||||||
|
fsacc,
|
||||||
|
msloc,
|
||||||
|
msins, fsins : Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
numeralFormsDeterminer : NumeralForms -> NumSize -> Determiner =
|
||||||
|
\nume,size ->
|
||||||
|
let
|
||||||
|
dem = nume **
|
||||||
|
{mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used
|
||||||
|
demAdj = dem ** {fsdat = dem.fsgen} ;
|
||||||
|
adjAdj = adjFormsAdjective demAdj
|
||||||
|
in {
|
||||||
|
s = \\g,c => adjAdj.s ! g ! Sg ! c ;
|
||||||
|
size = size
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- example: number 1
|
||||||
|
oneNumeral : Determiner = numeralFormsDeterminer (mkDemPronForms "jed") Num1 ;
|
||||||
|
|
||||||
|
-- numbers 2,3,4 ---- to check if everything comes out right with the determiner type
|
||||||
|
twoNumeral : Determiner =
|
||||||
|
let forms = {
|
||||||
|
msnom = "dva" ; fsnom, nsnom, fsacc = "dvě" ;
|
||||||
|
msgen, fsgen, msloc = "dvou" ;
|
||||||
|
msdat, msins, fsins = "dvěma"
|
||||||
|
}
|
||||||
|
in numeralFormsDeterminer forms Num2_4 ;
|
||||||
|
|
||||||
|
threeNumeral : Determiner =
|
||||||
|
let forms = {
|
||||||
|
msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ;
|
||||||
|
msdat = "třem" ;
|
||||||
|
msloc = "třech" ;
|
||||||
|
msins,fsins = "třemi" ;
|
||||||
|
}
|
||||||
|
in numeralFormsDeterminer forms Num2_4 ;
|
||||||
|
|
||||||
|
fourNumeral : Determiner =
|
||||||
|
let forms = {
|
||||||
|
msnom, fsnom, nsnom, fsacc = "čtyři" ;
|
||||||
|
msgen, fsgen = "čtyř" ;
|
||||||
|
msdat = "čtyřem" ;
|
||||||
|
msloc = "čtyřech" ;
|
||||||
|
msins,fsins = "čtyřmi" ;
|
||||||
|
}
|
||||||
|
in numeralFormsDeterminer forms Num2_4 ;
|
||||||
|
|
||||||
|
-- for the numbers 5 upwards
|
||||||
|
regNumeral : Str -> Str -> Determiner = \pet,peti ->
|
||||||
|
let forms = {
|
||||||
|
msnom,fsnom,nsnom = pet ;
|
||||||
|
msgen, fsgen, msdat, fsacc, msloc, msins, fsins = peti
|
||||||
|
}
|
||||||
|
in numeralFormsDeterminer forms Num5 ;
|
||||||
|
|
||||||
|
invarDeterminer : Str -> NumSize -> Determiner = \sto,size ->
|
||||||
|
regNumeral sto sto ;
|
||||||
|
|
||||||
|
invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ;
|
||||||
|
|
||||||
|
--------------------------------
|
||||||
|
-- combining nouns with numerals
|
||||||
|
|
||||||
|
param
|
||||||
|
NumSize = Num1 | Num2_4 | Num5 ; -- CEG 6.1
|
||||||
|
|
||||||
|
oper
|
||||||
|
numSizeForm : (Number => Case => Str) -> NumSize -> Case -> Str
|
||||||
|
= \cns,n,c -> case n of {
|
||||||
|
Num1 => cns ! Sg ! c ;
|
||||||
|
Num2_4 => cns ! Pl ! c ;
|
||||||
|
Num5 => case c of {
|
||||||
|
Nom | Acc => cns ! Pl ! Gen ;
|
||||||
|
_ => cns ! Pl ! c
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
numSizeAgr : Gender -> NumSize -> Person -> Agr
|
||||||
|
= \g,ns,p -> case ns of {
|
||||||
|
Num5 => Ag Neutr Sg p ; -- essential grammar 6.1.4
|
||||||
|
Num2_4 => Ag g Pl p ;
|
||||||
|
Num1 => Ag g Sg p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
numSizeNumber : NumSize -> Number = \ns -> case ns of {
|
||||||
|
Num1 => Sg ;
|
||||||
|
_ => Pl ---- TO CHECK
|
||||||
|
} ;
|
||||||
|
}
|
||||||
32
src/czech/SentenceCze.gf
Normal file
32
src/czech/SentenceCze.gf
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
concrete SentenceCze of Sentence = CatCze **
|
||||||
|
open Prelude, ResCze in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
PredVP np vp = {
|
||||||
|
subj = case np.hasClit of {
|
||||||
|
True => np.clit ! Nom ; -- pro-drop
|
||||||
|
False => np.s ! Nom
|
||||||
|
} ;
|
||||||
|
verb = vp.verb ;
|
||||||
|
clit = vp.clit ! np.a ;
|
||||||
|
compl = vp.compl ! np.a ;
|
||||||
|
a = np.a ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseCl temp pol cl = {
|
||||||
|
s = temp.s ++ cl.subj ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.compl ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--- TODO is inversion the standard? ; add indirect questions
|
||||||
|
UseQCl temp pol cl = {
|
||||||
|
s = temp.s ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.subj ++ cl.compl ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseRCl temp pol rcl = {
|
||||||
|
s = \\a => temp.s ++
|
||||||
|
rcl.subj ! a ++ rcl.clit ! a ++
|
||||||
|
pol.s ++ verbAgr rcl.verb a pol.p ++
|
||||||
|
rcl.compl ! a ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
27
src/czech/StructuralCze.gf
Normal file
27
src/czech/StructuralCze.gf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
concrete StructuralCze of Structural = CatCze **
|
||||||
|
open ParadigmsCze, ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
and_Conj = mkConj "i" ;
|
||||||
|
by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation
|
||||||
|
few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála
|
||||||
|
for_Prep = mkPrep "pro" accusative ;
|
||||||
|
from_Prep = mkPrep (pre {"s"|"z" => "ze" ; _ => "z"}) Gen ; ---- consonant clusters
|
||||||
|
have_V2 = mkV2 haveVerbForms ;
|
||||||
|
in_Prep = mkPrep (pre {"v"|"m" => "ve" ; _ => "v"}) Loc ; ----
|
||||||
|
many_Det = regNumeral "mnoho" "mnoha" ; -- CEG 6.8 ----
|
||||||
|
or_Conj = mkConj "nebo" ;
|
||||||
|
somePl_Det = regNumeral "několik" "několika" ; -- CEG 6.8 ----
|
||||||
|
something_NP = {s,clit,prep = \\c => "ně" + coForms ! c ; a = Ag Neutr Sg P3 ; hasClit = False} ; -- CEG 5.6.3
|
||||||
|
possess_Prep = mkPrep "" Gen ;
|
||||||
|
that_Quant = demPronFormsAdjective (mkDemPronForms "tamt") "" ;
|
||||||
|
this_Quant = demPronFormsAdjective (mkDemPronForms "t") "to" ;
|
||||||
|
to_Prep = mkPrep "do" Gen ;
|
||||||
|
with_Prep = mkPrep (pre {"s"|"z" => "se" ; _ => "s"}) Ins ; ----
|
||||||
|
|
||||||
|
i_Pron = personalPron (Ag (Masc Anim) Sg P1) ;
|
||||||
|
youSg_Pron = personalPron (Ag (Masc Anim) Sg P2) ;
|
||||||
|
he_Pron = personalPron (Ag (Masc Anim) Sg P3) ;
|
||||||
|
she_Pron = personalPron (Ag Fem Sg P3) ;
|
||||||
|
|
||||||
|
}
|
||||||
11
src/czech/SymbolCze.gf
Normal file
11
src/czech/SymbolCze.gf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
|
concrete SymbolCze of Symbol = CatCze ** open Prelude, ResCze in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Symb = {s : Str} ;
|
||||||
|
lin
|
||||||
|
MkSymb s = s ;
|
||||||
|
SymbPN s = lin PN {s = \\_ => s.s ; g = Neutr} ;
|
||||||
|
|
||||||
|
}
|
||||||
20
src/czech/TenseCze.gf
Normal file
20
src/czech/TenseCze.gf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
concrete TenseCze of Tense =
|
||||||
|
CatCze **
|
||||||
|
open
|
||||||
|
ResCze,
|
||||||
|
Prelude
|
||||||
|
in {
|
||||||
|
lin
|
||||||
|
PNeg = {
|
||||||
|
s = "ne" ++ Predef.BIND ;
|
||||||
|
p = False
|
||||||
|
} ;
|
||||||
|
PPos = {
|
||||||
|
s = [] ;
|
||||||
|
p = True
|
||||||
|
} ;
|
||||||
|
ASimul = {s = [] ; t = CTPres} ;
|
||||||
|
TPres = {s = [] ; t = CTPres} ;
|
||||||
|
TTAnt t a = {s = t.s ++ a.s ; t = t.t} ; ----
|
||||||
|
|
||||||
|
}
|
||||||
8
src/czech/TextCze.gf
Normal file
8
src/czech/TextCze.gf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
concrete TextCze of Text = CatCze ** open ResCze in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
TEmpty = {s = []} ;
|
||||||
|
TFullStop x xs = {s = x.s ++ "." ++ xs.s} ;
|
||||||
|
TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ;
|
||||||
|
TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ;
|
||||||
|
}
|
||||||
48
src/czech/VerbCze.gf
Normal file
48
src/czech/VerbCze.gf
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
concrete VerbCze of Verb = CatCze ** open ResCze, Prelude in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseV v = {
|
||||||
|
verb = v ;
|
||||||
|
clit,compl = \\_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ComplSlash vps np = case <np.hasClit, vps.c.hasPrep> of {
|
||||||
|
<True,False> => vps ** {
|
||||||
|
clit = \\a => vps.clit ! a ++ np.clit ! vps.c.c
|
||||||
|
} ;
|
||||||
|
_ => vps ** {
|
||||||
|
compl = \\a => vps.compl ! a ++ vps.c.s ++ np.s ! vps.c.c
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
SlashV2a v = {
|
||||||
|
verb = v ;
|
||||||
|
clit,compl = \\_ => [] ;
|
||||||
|
c = v.c
|
||||||
|
} ;
|
||||||
|
|
||||||
|
UseComp comp = {
|
||||||
|
verb = copulaVerbForms ;
|
||||||
|
clit = \\_ => [] ;
|
||||||
|
compl = comp.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompAP ap = {
|
||||||
|
s = \\a => case a of {
|
||||||
|
Ag g n p_ => ap.s ! g ! n ! Nom
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompNP np = {
|
||||||
|
s = \\a_ => np.s ! Nom ; ---- InstrC in Pol
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompAdv adv = {
|
||||||
|
s = \\a_ => adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvVP vp adv = vp ** {
|
||||||
|
compl = \\a => vp.compl ! a ++ adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -162,7 +162,7 @@ oper
|
|||||||
let
|
let
|
||||||
kekkonshite = Predef.tk 2 kekkonshiteiru
|
kekkonshite = Predef.tk 2 kekkonshiteiru
|
||||||
in {
|
in {
|
||||||
pred = \\st,t,p => kekkonshite ++ mkExistV.verb ! SomeoneElse ! Anim ! st ! t ! p ;
|
pred = \\st,t,p => kekkonshite + mkExistV.verb ! SomeoneElse ! Anim ! st ! t ! p ;
|
||||||
attr = kikonno ;
|
attr = kikonno ;
|
||||||
te = \\p => kekkonshite ++ mkExistV.te ! SomeoneElse ! Anim ! Resp ! p ;
|
te = \\p => kekkonshite ++ mkExistV.te ! SomeoneElse ! Anim ! Resp ! p ;
|
||||||
ba = \\p => kekkonshite ++ mkExistV.ba ! SomeoneElse ! Anim ! Resp ! p ;
|
ba = \\p => kekkonshite ++ mkExistV.ba ! SomeoneElse ! Anim ! Resp ! p ;
|
||||||
@@ -720,4 +720,3 @@ oper
|
|||||||
needSubject = False
|
needSubject = False
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
concrete AdjectiveKor of Adjective = CatKor ** open ResKor, Prelude in {
|
concrete AdjectiveKor of Adjective = CatKor **
|
||||||
|
open ResKor, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -11,11 +12,14 @@ concrete AdjectiveKor of Adjective = CatKor ** open ResKor, Prelude in {
|
|||||||
|
|
||||||
-- : A -> NP -> AP ;
|
-- : A -> NP -> AP ;
|
||||||
ComparA a np = a ** {
|
ComparA a np = a ** {
|
||||||
compar = np.s ! Bare
|
s = \\vf => "더" ++ a.s ! vf ;
|
||||||
|
compar = glue (np.s ! Bare) "보다" ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : A2 -> NP -> AP ; -- married to her
|
-- : A2 -> NP -> AP ; -- married to her
|
||||||
-- ComplA2 a2 np = a2 ** { } ;
|
ComplA2 a2 np = a2 ** {
|
||||||
|
compar = (prepNP a2.c2 a2.p2 np).s ;
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : A2 -> AP ; -- married to itself
|
-- : A2 -> AP ; -- married to itself
|
||||||
-- ReflA2 a2 = a2 ** { } ;
|
-- ReflA2 a2 = a2 ** { } ;
|
||||||
@@ -24,10 +28,10 @@ concrete AdjectiveKor of Adjective = CatKor ** open ResKor, Prelude in {
|
|||||||
UseA2 = PositA ;
|
UseA2 = PositA ;
|
||||||
|
|
||||||
-- : A -> AP ; -- warmer
|
-- : A -> AP ; -- warmer
|
||||||
-- UseComparA a = a ** {
|
UseComparA a = a ** {
|
||||||
-- s = \\af => "???" ++ a.s ! af ;
|
s = \\af => "더" ++ a.s ! af ;
|
||||||
-- compar = []
|
compar = [] ;
|
||||||
-- } ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
|
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||||
@@ -37,7 +41,6 @@ concrete AdjectiveKor of Adjective = CatKor ** open ResKor, Prelude in {
|
|||||||
|
|
||||||
-- : Ord -> AP ; -- warmest
|
-- : Ord -> AP ; -- warmest
|
||||||
AdjOrd ord = ord ** {
|
AdjOrd ord = ord ** {
|
||||||
s = \\_ => ord.s ;
|
|
||||||
compar = []
|
compar = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ lin
|
|||||||
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||||
|
|
||||||
-- : Prep -> NP -> Adv ;
|
-- : Prep -> NP -> Adv ;
|
||||||
PrepNP prep np = {
|
PrepNP = prepNP Bare ;
|
||||||
s = case prep.attaches of {
|
|
||||||
True => glue (np.s ! Bare) prep.s ;
|
|
||||||
False => np.s ! Bare ++ prep.s }
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in {
|
|||||||
-- Constructed in SentenceKor, and also in IdiomKor
|
-- Constructed in SentenceKor, and also in IdiomKor
|
||||||
|
|
||||||
S = ResKor.Sentence ;
|
S = ResKor.Sentence ;
|
||||||
QS = SS ;
|
QS = SS ; -- Questions not implemented yet
|
||||||
RS = SS ;
|
RS = ResKor.Sentence ;
|
||||||
-- relative sentence. Tense and polarity fixed,
|
-- relative sentence. Tense and polarity fixed,
|
||||||
-- but agreement may depend on the CN/NP it modifies.
|
-- but agreement may depend on the CN/NP it modifies.
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in {
|
|||||||
Quant = ResKor.Quant ;
|
Quant = ResKor.Quant ;
|
||||||
Num = ResKor.Num ;
|
Num = ResKor.Num ;
|
||||||
Ord = {
|
Ord = {
|
||||||
s : Str ; -- AForm => Str ; -- Ord can come from AP and become AP again
|
s : VForm => Str ; -- Ord can come from AP and become AP again
|
||||||
n : Number -- Ord can come from Num, which has inherent number
|
n : Number -- Ord can come from Num, which has inherent number
|
||||||
} ;
|
} ;
|
||||||
DAP = ResKor.Determiner ;
|
DAP = ResKor.Determiner ;
|
||||||
@@ -116,7 +116,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in {
|
|||||||
N = ResKor.Noun ;
|
N = ResKor.Noun ;
|
||||||
N2 = ResKor.Noun2 ;
|
N2 = ResKor.Noun2 ;
|
||||||
N3 = ResKor.Noun3 ;
|
N3 = ResKor.Noun3 ;
|
||||||
PN = ResKor.PNoun ;
|
PN = ResKor.NounPhrase ;
|
||||||
|
|
||||||
linref
|
linref
|
||||||
V, V2, V3, VP = linVerb ;
|
V, V2, V3, VP = linVerb ;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete ConjunctionKor of Conjunction =
|
concrete ConjunctionKor of Conjunction =
|
||||||
CatKor ** open ResKor, Coordination, Prelude in {
|
CatKor ** open ResKor, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -25,54 +25,78 @@ concrete ConjunctionKor of Conjunction =
|
|||||||
ConsAdv = consrSS comma ;
|
ConsAdv = consrSS comma ;
|
||||||
ConjAdv = conjunctSS ;
|
ConjAdv = conjunctSS ;
|
||||||
|
|
||||||
--}
|
-}
|
||||||
|
|
||||||
|
|
||||||
-- Adverb and other simple {s : Str} types.
|
|
||||||
lincat
|
|
||||||
[Adv],[AdV],[IAdv] = {s1,s2 : Str} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
|
|
||||||
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
|
|
||||||
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
|
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
-- RS depends on X, Y and Z, otherwise exactly like previous.
|
|
||||||
-- RS can modify CNs, which are open for …, and have inherent …
|
|
||||||
lincat
|
|
||||||
[RS] = {s1,s2 : … => Str} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseRS = twoTable3 … ;
|
|
||||||
ConsRS = consrTable3 … comma ;
|
|
||||||
ConjRS = conjunctRSTable ;
|
|
||||||
-}
|
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[S] = ResKor.Sentence ** {firstS : ConjType => Str} ;
|
[Adv],[AdV],[IAdv] = ConjSS ;
|
||||||
|
lin
|
||||||
|
BaseAdv, BaseAdV, BaseIAdv = baseSS ;
|
||||||
|
ConsAdv, ConsAdV, ConsIAdv = consSS ;
|
||||||
|
ConjAdv, ConjAdV, ConjIAdv = conjSS ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
ConjSS : Type = SS ** {firstSS : ConjType => Str} ;
|
||||||
|
|
||||||
|
baseSS : SS -> SS -> ConjSS = \s1,s2 -> s2 ** {
|
||||||
|
firstSS = mkFirstSS s1 ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
consSS : SS -> ConjSS -> ConjSS = \s,ss -> ss ** {
|
||||||
|
firstSS = \\conj =>
|
||||||
|
mkFirstSS s ! conj ++ ss.firstSS ! conj ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjSS : Conj -> ConjSS -> SS = \co,ss -> {
|
||||||
|
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
|
||||||
|
++ ss.firstSS ! co.c
|
||||||
|
++ co.s2
|
||||||
|
++ ss.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkFirstSS : SS -> ConjType => Str = \s ->
|
||||||
|
\\conj => glue s.s (conjTable ! VStar ! conj) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[S], [RS] = ResKor.Sentence ** {firstS : ConjType => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseS s1 s2 = s2 ** {
|
BaseS,BaseRS = \s1,s2 -> s2 ** {
|
||||||
firstS = mkFirstS s1
|
firstS = mkFirstS s1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConsS s ss = ss ** {
|
ConsS,ConsRS = \s,ss -> ss ** {
|
||||||
firstS = \\conj =>
|
firstS = \\conj =>
|
||||||
mkFirstS s ! conj ++ ss.firstS ! conj ;
|
mkFirstS s ! conj ++ ss.firstS ! conj ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjS co ss = ss ** {
|
ConjS,ConjRS = \co,ss -> ss ** {
|
||||||
s = \\st => co.s1 ++ ss.firstS ! co.c ++ ss.s ! st
|
s = \\st => co.s1 ++ ss.firstS ! co.c ++ ss.s ! st
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkFirstS : ResKor.Sentence -> ConjType => Str = \s ->
|
mkFirstS : ResKor.Sentence -> ConjType => Str = \s ->
|
||||||
\\conj => glue (s.s ! Subord) (conjTable ! NStar ! conj) ;
|
\\conj => glue (s.s ! WithConj) (conjTable ! VStar ! conj) ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[AP] = ResKor.AdjPhrase ** {firstAP : AForm => ConjType => Str} ;
|
[AP] = ResKor.AdjPhrase ** {firstAP : VForm => ConjType => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseAP a1 a2 = a2 ** {
|
BaseAP a1 a2 = a2 ** {
|
||||||
@@ -90,10 +114,8 @@ lin
|
|||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkFirstAP : ResKor.AdjPhrase -> AForm => ConjType => Str = \ap ->
|
mkFirstAP : ResKor.AdjPhrase -> VForm => ConjType => Str = \ap ->
|
||||||
\\af,conj => case af of {
|
\\af,conj => ap.compar ++ glue (ap.s ! VStem) (conjTable ! VStar ! conj) ;
|
||||||
AAttr => glue (ap.s ! AAttr) (conjTable ! NStar ! conj) ;
|
|
||||||
APred _ => glue (ap.s ! APred VStem) (conjTable ! VStar ! conj) } ;
|
|
||||||
|
|
||||||
{-
|
{-
|
||||||
lincat
|
lincat
|
||||||
@@ -130,5 +152,22 @@ lin
|
|||||||
oper
|
oper
|
||||||
mkFirstNP : ResKor.NounPhrase -> ConjType => Str = \np ->
|
mkFirstNP : ResKor.NounPhrase -> ConjType => Str = \np ->
|
||||||
\\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj) ;
|
\\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj) ;
|
||||||
|
-- Versions with commas, no repeated conjunctions
|
||||||
|
|
||||||
|
baseNPcomma : NP -> NP -> ListNP = \x,y -> y ** {
|
||||||
|
firstNP = \\conj => x.s ! Bare ++ BIND ++ "," ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
consNPcomma : NP -> ListNP -> ListNP = \x,xs -> xs ** {
|
||||||
|
firstNP = \\conj =>
|
||||||
|
x.s ! Bare ++ BIND ++ "," ++ xs.firstNP ! conj ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
conjNPcomma : Conj -> ListNP -> NP = \co,xs -> xs ** {
|
||||||
|
s = \\nf => co.s1
|
||||||
|
++ xs.firstNP ! co.c
|
||||||
|
++ co.s2
|
||||||
|
++ xs.s ! nf
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
--# -path=.:../common:../abstract
|
--# -path=.:../common:../abstract
|
||||||
|
|
||||||
concrete ExtendKor of Extend = CatKor
|
concrete ExtendKor of Extend = CatKor
|
||||||
-- ** ExtendFunctor - []
|
-- ** ExtendFunctor - [ApposNP]
|
||||||
-- with (Grammar=GrammarKor)
|
-- with (Grammar=GrammarKor)
|
||||||
** open Prelude, ResKor, NounKor in {
|
** open Prelude, ResKor, NounKor, Coordination in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
-- : NP -> NP -> NP
|
||||||
|
ApposNP np1 np2 = np1 ** {s = \\nf => np1.s ! nf ++ np2.s ! nf} ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ oper
|
|||||||
"기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히" ) ;
|
"기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히" ) ;
|
||||||
|
|
||||||
a : pattern Str = #("가" | "까" | "나" | "다" | "따" | "라" | "마" | "바" | "빠" | "사" | "싸" | "아" | "자" | "짜" | "차" | "카" | "타" | "파" | "하") ;
|
a : pattern Str = #("가" | "까" | "나" | "다" | "따" | "라" | "마" | "바" | "빠" | "사" | "싸" | "아" | "자" | "짜" | "차" | "카" | "타" | "파" | "하") ;
|
||||||
|
e : pattern Str = #("게" | "께" | "네" | "데" | "떼" | "레" | "메" | "베" | "뻬" | "세" | "쎄" | "에" | "제" | "쩨" | "체" | "케" | "테" | "페" | "헤") ;
|
||||||
eo : pattern Str = #("거" | "꺼" | "너" | "더" | "떠" | "러" | "머" | "버" | "뻐" | "서" | "써" | "어" | "저" | "쩌" | "처" | "커" | "터" | "퍼" | "허") ;
|
eo : pattern Str = #("거" | "꺼" | "너" | "더" | "떠" | "러" | "머" | "버" | "뻐" | "서" | "써" | "어" | "저" | "쩌" | "처" | "커" | "터" | "퍼" | "허") ;
|
||||||
eu : pattern Str = #("그" | "끄" | "느" | "드" | "뜨" | "르" | "므" | "브" | "쁘" | "스" | "쓰" | "으" | "즈" | "쯔" | "츠" | "크" | "트" | "프" | "흐") ;
|
eu : pattern Str = #("그" | "끄" | "느" | "드" | "뜨" | "르" | "므" | "브" | "쁘" | "스" | "쓰" | "으" | "즈" | "쯔" | "츠" | "크" | "트" | "프" | "흐") ;
|
||||||
i : pattern Str = #("기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히") ;
|
i : pattern Str = #("기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히") ;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
concrete LexiconKor of Lexicon = CatKor **
|
concrete LexiconKor of Lexicon = CatKor **
|
||||||
open ParadigmsKor, ResKor in {
|
open ParadigmsKor, ResKor, StructuralKor in {
|
||||||
|
|
||||||
----
|
----
|
||||||
-- A
|
-- A
|
||||||
@@ -33,10 +33,10 @@ lin big_A = mkA "크다" ;
|
|||||||
-- lin bike_N = mkN "" ;
|
-- lin bike_N = mkN "" ;
|
||||||
-- lin bird_N = mkN "" ;
|
-- lin bird_N = mkN "" ;
|
||||||
-- lin bite_V2 = mkV2 "" ;
|
-- lin bite_V2 = mkV2 "" ;
|
||||||
-- lin black_A = mkA "" ;
|
lin black_A = mkA "검다" ;
|
||||||
-- lin blood_N = mkN "" ;
|
-- lin blood_N = mkN "" ;
|
||||||
-- lin blow_V = mkV "" ;
|
-- lin blow_V = mkV "" ;
|
||||||
lin blue_A = mkA "푸르다" ;
|
lin blue_A = mkA "파랗다" "파래요" "파랗습니다" "파란" ;
|
||||||
-- lin boat_N = mkN "" ;
|
-- lin boat_N = mkN "" ;
|
||||||
-- lin bone_N = mkN "" ;
|
-- lin bone_N = mkN "" ;
|
||||||
-- lin boot_N = mkN "" ;
|
-- lin boot_N = mkN "" ;
|
||||||
@@ -59,7 +59,7 @@ lin bread_N = mkN "빵" ;
|
|||||||
|
|
||||||
-- lin camera_N = mkN "" ;
|
-- lin camera_N = mkN "" ;
|
||||||
-- lin cap_N = mkN "" ;
|
-- lin cap_N = mkN "" ;
|
||||||
-- lin car_N = mkN "" ;
|
lin car_N = mkN "자동차" "대" ;
|
||||||
-- lin carpet_N = mkN "" ;
|
-- lin carpet_N = mkN "" ;
|
||||||
lin cat_N = mkN "고양이" ;
|
lin cat_N = mkN "고양이" ;
|
||||||
-- lin ceiling_N = mkN "" ;
|
-- lin ceiling_N = mkN "" ;
|
||||||
@@ -72,7 +72,7 @@ lin cat_N = mkN "고양이" ;
|
|||||||
-- lin clever_A = mkA "" ;
|
-- lin clever_A = mkA "" ;
|
||||||
-- lin close_V2 = mkV2 "" ;
|
-- lin close_V2 = mkV2 "" ;
|
||||||
-- lin cloud_N = mkN "" ;
|
-- lin cloud_N = mkN "" ;
|
||||||
-- lin coat_N = mkN "" ;
|
lin coat_N = mkN "코트" ;
|
||||||
-- lin cold_A = mkA "" ;
|
-- lin cold_A = mkA "" ;
|
||||||
lin come_V = mkV "오다" ;
|
lin come_V = mkV "오다" ;
|
||||||
-- lin computer_N = mkN "" ;
|
-- lin computer_N = mkN "" ;
|
||||||
@@ -95,7 +95,7 @@ lin do_V2 = mkV2 do_V ;
|
|||||||
-- lin doctor_N = mkN "" ;
|
-- lin doctor_N = mkN "" ;
|
||||||
-- lin dog_N = mkN "" ;
|
-- lin dog_N = mkN "" ;
|
||||||
-- lin door_N = mkN "" ;
|
-- lin door_N = mkN "" ;
|
||||||
-- lin drink_V2 = mkV2 "" ;
|
lin drink_V2 = mkV2 "마시다" ;
|
||||||
-- lin dry_A = mkA "" ;
|
-- lin dry_A = mkA "" ;
|
||||||
-- lin dull_A = mkA "" ;
|
-- lin dull_A = mkA "" ;
|
||||||
-- lin dust_N = mkN "" ;
|
-- lin dust_N = mkN "" ;
|
||||||
@@ -209,7 +209,7 @@ lin laugh_V = mkV "웃다" ;
|
|||||||
-- lin leave_V2 = mkV2 "" ;
|
-- lin leave_V2 = mkV2 "" ;
|
||||||
-- lin leg_N = mkN "" ;
|
-- lin leg_N = mkN "" ;
|
||||||
-- lin lie_V = mkV "" ;
|
-- lin lie_V = mkV "" ;
|
||||||
-- lin like_V2 = mkV2 "" ;
|
lin like_V2 = mkV2 (mkV "좋아" do_V) topic object ;
|
||||||
-- lin listen_V2 = mkV2 "" ;
|
-- lin listen_V2 = mkV2 "" ;
|
||||||
-- lin live_V = mkV "";
|
-- lin live_V = mkV "";
|
||||||
-- lin liver_N = mkN "" ;
|
-- lin liver_N = mkN "" ;
|
||||||
@@ -223,7 +223,7 @@ lin laugh_V = mkV "웃다" ;
|
|||||||
-- M
|
-- M
|
||||||
|
|
||||||
lin man_N = mkN "남자" ;
|
lin man_N = mkN "남자" ;
|
||||||
-- lin married_A2 = mkA "" ;
|
lin married_A2 = mkA2 (mkA "결혼했다" "결혼했어요" "결혼했습니다" "결혼한") with_Prep ; -- TODO check: forced past tense
|
||||||
-- lin meat_N = mkN "" ;
|
-- lin meat_N = mkN "" ;
|
||||||
lin milk_N = mkN "우유" ;
|
lin milk_N = mkN "우유" ;
|
||||||
-- lin moon_N = mkN "" ;
|
-- lin moon_N = mkN "" ;
|
||||||
@@ -258,7 +258,7 @@ lin now_Adv = mkAdv "지금" ;
|
|||||||
-- lin paris_PN = mkPN "Paris" ;
|
-- lin paris_PN = mkPN "Paris" ;
|
||||||
-- lin peace_N = mkN "" ;
|
-- lin peace_N = mkN "" ;
|
||||||
-- lin pen_N = mkN "" ;
|
-- lin pen_N = mkN "" ;
|
||||||
lin person_N = mkN "사람" ;
|
lin person_N = mkN "사람" "명" ;
|
||||||
-- lin planet_N = mkN "" ;
|
-- lin planet_N = mkN "" ;
|
||||||
-- lin plastic_N = mkN "" ;
|
-- lin plastic_N = mkN "" ;
|
||||||
-- lin play_V = mkV "" ;
|
-- lin play_V = mkV "" ;
|
||||||
@@ -279,7 +279,7 @@ lin person_N = mkN "사람" ;
|
|||||||
-- lin read_V2 = mkV2 "" ;
|
-- lin read_V2 = mkV2 "" ;
|
||||||
-- lin ready_A = mkA "" ;
|
-- lin ready_A = mkA "" ;
|
||||||
-- lin reason_N = mkN "" ;
|
-- lin reason_N = mkN "" ;
|
||||||
-- lin red_A = mkA "" ;
|
lin red_A = mkA "빨갛다" "빨개요" "빨갛습니다" "빨간" ;
|
||||||
-- lin religion_N = mkN "" ;
|
-- lin religion_N = mkN "" ;
|
||||||
-- lin restaurant_N = mkN "" ;
|
-- lin restaurant_N = mkN "" ;
|
||||||
-- lin river_N = mkN "" ;
|
-- lin river_N = mkN "" ;
|
||||||
@@ -314,7 +314,7 @@ lin see_V2 = mkV2 "보다" ;
|
|||||||
-- lin sharp_A = mkA "" ;
|
-- lin sharp_A = mkA "" ;
|
||||||
-- lin sheep_N = mkN "" fem ;
|
-- lin sheep_N = mkN "" fem ;
|
||||||
-- lin ship_N = mkN "" ;
|
-- lin ship_N = mkN "" ;
|
||||||
-- lin shirt_N = mkN "" ;
|
lin shirt_N = mkN "셔츠" "벌" ;
|
||||||
-- lin shoe_N = mkN "" ;
|
-- lin shoe_N = mkN "" ;
|
||||||
-- lin shop_N = mkN "" ;
|
-- lin shop_N = mkN "" ;
|
||||||
lin short_A = mkA "키가" small_A ; -- "height is small"
|
lin short_A = mkA "키가" small_A ; -- "height is small"
|
||||||
|
|||||||
@@ -9,18 +9,13 @@ oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
|
|||||||
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
|
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
|
||||||
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
||||||
oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ;
|
oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ;
|
||||||
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
|
|
||||||
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
||||||
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
||||||
oper AdvNP : NP -> Adv -> NP = notYet "AdvNP" ;
|
|
||||||
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
|
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
|
||||||
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
|
||||||
oper ApposCN : CN -> NP -> CN = notYet "ApposCN" ;
|
|
||||||
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
|
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
|
||||||
oper BaseAdv : Adv -> Adv -> ListAdv = notYet "BaseAdv" ;
|
|
||||||
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
|
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
|
||||||
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
|
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
|
||||||
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
|
|
||||||
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
|
||||||
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
|
||||||
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
|
||||||
@@ -28,7 +23,6 @@ oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
|
|||||||
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
oper CompIP : IP -> IComp = notYet "CompIP" ;
|
||||||
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
|
||||||
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
|
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
|
||||||
oper ComplA2 : A2 -> NP -> AP = notYet "ComplA2" ;
|
|
||||||
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
|
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
|
||||||
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
|
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
|
||||||
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
|
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
|
||||||
@@ -37,23 +31,16 @@ oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
|
|||||||
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
||||||
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
||||||
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
|
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
|
||||||
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
|
|
||||||
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
|
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
|
||||||
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
|
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
|
||||||
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
|
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
|
||||||
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
|
|
||||||
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
|
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
|
||||||
oper ConsAdv : Adv -> ListAdv -> ListAdv = notYet "ConsAdv" ;
|
|
||||||
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
|
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
|
||||||
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
|
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
|
||||||
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
|
|
||||||
oper CountNP : Det -> NP -> NP = notYet "CountNP" ;
|
oper CountNP : Det -> NP -> NP = notYet "CountNP" ;
|
||||||
oper D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig = notYet "D_9" ;
|
|
||||||
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
|
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
|
||||||
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
||||||
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
||||||
oper EmbedS : S -> SC = notYet "EmbedS" ;
|
|
||||||
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
|
|
||||||
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
||||||
oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ;
|
oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ;
|
||||||
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
||||||
@@ -61,9 +48,6 @@ oper ExistNPAdv : NP -> Adv -> Cl = notYet "ExistNPAdv" ;
|
|||||||
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
|
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
|
||||||
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
||||||
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
||||||
oper IDig : Dig -> Digits = notYet "IDig" ;
|
|
||||||
oper IIDig : Dig -> Digits -> Digits = notYet "IIDig" ;
|
|
||||||
oper IdRP : RP = notYet "IdRP" ;
|
|
||||||
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
||||||
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
|
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
|
||||||
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
|
||||||
@@ -71,12 +55,9 @@ oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ;
|
|||||||
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
|
||||||
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
||||||
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
||||||
oper MassNP : CN -> NP = notYet "MassNP" ;
|
|
||||||
oper NumDigits : Digits -> Card = notYet "NumDigits" ;
|
|
||||||
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
||||||
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
||||||
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
|
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
|
||||||
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
|
|
||||||
oper PConjConj : Conj -> PConj = notYet "PConjConj" ;
|
oper PConjConj : Conj -> PConj = notYet "PConjConj" ;
|
||||||
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
||||||
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
|
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
|
||||||
@@ -84,8 +65,6 @@ oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
|||||||
oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ;
|
oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ;
|
||||||
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
||||||
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
|
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
|
||||||
oper PossPron : Pron -> Quant = notYet "PossPron" ;
|
|
||||||
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
|
|
||||||
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
|
||||||
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
|
||||||
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
|
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
|
||||||
@@ -96,18 +75,14 @@ oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
|
|||||||
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
|
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
|
||||||
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
|
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
|
||||||
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
|
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
|
||||||
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
|
|
||||||
oper RelCl : Cl -> RCl = notYet "RelCl" ;
|
|
||||||
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
|
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
|
||||||
oper RelS : S -> RS -> S = notYet "RelS" ;
|
oper RelS : S -> RS -> S = notYet "RelS" ;
|
||||||
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
|
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
|
||||||
oper RelVP : RP -> VP -> RCl = notYet "RelVP" ;
|
|
||||||
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
|
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
|
||||||
oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ;
|
oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ;
|
||||||
oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ;
|
oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ;
|
||||||
oper SelfNP : NP -> NP = notYet "SelfNP" ;
|
oper SelfNP : NP -> NP = notYet "SelfNP" ;
|
||||||
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
|
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
|
||||||
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
|
|
||||||
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
|
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
|
||||||
oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ;
|
oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ;
|
||||||
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
|
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
|
||||||
@@ -122,22 +97,15 @@ oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
|||||||
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
||||||
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||||
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
|
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
|
||||||
oper UseComparA : A -> AP = notYet "UseComparA" ;
|
oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ;
|
||||||
oper UsePN : PN -> NP = notYet "UsePN" ;
|
|
||||||
oper UsePron : Pron -> NP = notYet "UsePron" ;
|
|
||||||
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
|
|
||||||
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
||||||
oper UttAP : AP -> Utt = notYet "UttAP" ;
|
oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ;
|
||||||
oper UttAdv : Adv -> Utt = notYet "UttAdv" ;
|
|
||||||
oper UttCN : CN -> Utt = notYet "UttCN" ;
|
|
||||||
oper UttCard : Card -> Utt = notYet "UttCard" ;
|
|
||||||
oper UttIP : IP -> Utt = notYet "UttIP" ;
|
oper UttIP : IP -> Utt = notYet "UttIP" ;
|
||||||
oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ;
|
oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ;
|
||||||
oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
|
oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
|
||||||
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
|
||||||
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
|
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
|
||||||
oper UttNP : NP -> Utt = notYet "UttNP" ;
|
oper UttQS : QS -> Utt = notYet "UttQS" ;
|
||||||
oper UttVP : VP -> Utt = notYet "UttVP" ;
|
|
||||||
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
|
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
|
||||||
oper VocNP : NP -> Voc = notYet "VocNP" ;
|
oper VocNP : NP -> Voc = notYet "VocNP" ;
|
||||||
oper above_Prep : Prep = notYet "above_Prep" ;
|
oper above_Prep : Prep = notYet "above_Prep" ;
|
||||||
@@ -176,7 +144,6 @@ oper between_Prep : Prep = notYet "between_Prep" ;
|
|||||||
oper bike_N : N = notYet "bike_N" ;
|
oper bike_N : N = notYet "bike_N" ;
|
||||||
oper bird_N : N = notYet "bird_N" ;
|
oper bird_N : N = notYet "bird_N" ;
|
||||||
oper bite_V2 : V2 = notYet "bite_V2" ;
|
oper bite_V2 : V2 = notYet "bite_V2" ;
|
||||||
oper black_A : A = notYet "black_A" ;
|
|
||||||
oper blood_N : N = notYet "blood_N" ;
|
oper blood_N : N = notYet "blood_N" ;
|
||||||
oper blow_V : V = notYet "blow_V" ;
|
oper blow_V : V = notYet "blow_V" ;
|
||||||
oper boat_N : N = notYet "boat_N" ;
|
oper boat_N : N = notYet "boat_N" ;
|
||||||
@@ -195,8 +162,6 @@ oper burn_V : V = notYet "burn_V" ;
|
|||||||
oper but_PConj : PConj = notYet "but_PConj" ;
|
oper but_PConj : PConj = notYet "but_PConj" ;
|
||||||
oper butter_N : N = notYet "butter_N" ;
|
oper butter_N : N = notYet "butter_N" ;
|
||||||
oper buy_V2 : V2 = notYet "buy_V2" ;
|
oper buy_V2 : V2 = notYet "buy_V2" ;
|
||||||
oper by8agent_Prep : Prep = notYet "by8agent_Prep" ;
|
|
||||||
oper by8means_Prep : Prep = notYet "by8means_Prep" ;
|
|
||||||
oper camera_N : N = notYet "camera_N" ;
|
oper camera_N : N = notYet "camera_N" ;
|
||||||
oper can8know_VV : VV = notYet "can8know_VV" ;
|
oper can8know_VV : VV = notYet "can8know_VV" ;
|
||||||
oper can_VV : VV = notYet "can_VV" ;
|
oper can_VV : VV = notYet "can_VV" ;
|
||||||
@@ -213,7 +178,6 @@ oper clean_A : A = notYet "clean_A" ;
|
|||||||
oper clever_A : A = notYet "clever_A" ;
|
oper clever_A : A = notYet "clever_A" ;
|
||||||
oper close_V2 : V2 = notYet "close_V2" ;
|
oper close_V2 : V2 = notYet "close_V2" ;
|
||||||
oper cloud_N : N = notYet "cloud_N" ;
|
oper cloud_N : N = notYet "cloud_N" ;
|
||||||
oper coat_N : N = notYet "coat_N" ;
|
|
||||||
oper cold_A : A = notYet "cold_A" ;
|
oper cold_A : A = notYet "cold_A" ;
|
||||||
oper computer_N : N = notYet "computer_N" ;
|
oper computer_N : N = notYet "computer_N" ;
|
||||||
oper correct_A : A = notYet "correct_A" ;
|
oper correct_A : A = notYet "correct_A" ;
|
||||||
@@ -241,7 +205,6 @@ oper dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet
|
|||||||
oper doctor_N : N = notYet "doctor_N" ;
|
oper doctor_N : N = notYet "doctor_N" ;
|
||||||
oper dog_N : N = notYet "dog_N" ;
|
oper dog_N : N = notYet "dog_N" ;
|
||||||
oper door_N : N = notYet "door_N" ;
|
oper door_N : N = notYet "door_N" ;
|
||||||
oper drink_V2 : V2 = notYet "drink_V2" ;
|
|
||||||
oper dry_A : A = notYet "dry_A" ;
|
oper dry_A : A = notYet "dry_A" ;
|
||||||
oper dull_A : A = notYet "dull_A" ;
|
oper dull_A : A = notYet "dull_A" ;
|
||||||
oper during_Prep : Prep = notYet "during_Prep" ;
|
oper during_Prep : Prep = notYet "during_Prep" ;
|
||||||
@@ -267,7 +230,6 @@ oper father_N2 : N2 = notYet "father_N2" ;
|
|||||||
oper fear_V2 : V2 = notYet "fear_V2" ;
|
oper fear_V2 : V2 = notYet "fear_V2" ;
|
||||||
oper fear_VS : VS = notYet "fear_VS" ;
|
oper fear_VS : VS = notYet "fear_VS" ;
|
||||||
oper feather_N : N = notYet "feather_N" ;
|
oper feather_N : N = notYet "feather_N" ;
|
||||||
oper few_Det : Det = notYet "few_Det" ;
|
|
||||||
oper few_X_short_of_Y : NP -> CN -> CN -> S = notYet "few_X_short_of_Y" ;
|
oper few_X_short_of_Y : NP -> CN -> CN -> S = notYet "few_X_short_of_Y" ;
|
||||||
oper fight_V2 : V2 = notYet "fight_V2" ;
|
oper fight_V2 : V2 = notYet "fight_V2" ;
|
||||||
oper find_V2 : V2 = notYet "find_V2" ;
|
oper find_V2 : V2 = notYet "find_V2" ;
|
||||||
@@ -305,7 +267,6 @@ oper has_age_VP : Card -> VP = notYet "has_age_VP" ;
|
|||||||
oper hat_N : N = notYet "hat_N" ;
|
oper hat_N : N = notYet "hat_N" ;
|
||||||
oper hate_V2 : V2 = notYet "hate_V2" ;
|
oper hate_V2 : V2 = notYet "hate_V2" ;
|
||||||
oper have_name_Cl : NP -> NP -> Cl = notYet "have_name_Cl" ;
|
oper have_name_Cl : NP -> NP -> Cl = notYet "have_name_Cl" ;
|
||||||
oper he_Pron : Pron = notYet "he_Pron" ;
|
|
||||||
oper head_N : N = notYet "head_N" ;
|
oper head_N : N = notYet "head_N" ;
|
||||||
oper hear_V2 : V2 = notYet "hear_V2" ;
|
oper hear_V2 : V2 = notYet "hear_V2" ;
|
||||||
oper heart_N : N = notYet "heart_N" ;
|
oper heart_N : N = notYet "heart_N" ;
|
||||||
@@ -328,7 +289,6 @@ oper how_old_QCl : NP -> QCl = notYet "how_old_QCl" ;
|
|||||||
oper hungry_VP : VP = notYet "hungry_VP" ;
|
oper hungry_VP : VP = notYet "hungry_VP" ;
|
||||||
oper hunt_V2 : V2 = notYet "hunt_V2" ;
|
oper hunt_V2 : V2 = notYet "hunt_V2" ;
|
||||||
oper husband_N : N = notYet "husband_N" ;
|
oper husband_N : N = notYet "husband_N" ;
|
||||||
oper i_Pron : Pron = notYet "i_Pron" ;
|
|
||||||
oper ice_N : N = notYet "ice_N" ;
|
oper ice_N : N = notYet "ice_N" ;
|
||||||
oper if_Subj : Subj = notYet "if_Subj" ;
|
oper if_Subj : Subj = notYet "if_Subj" ;
|
||||||
oper if_then_Conj : Conj = notYet "if_then_Conj" ;
|
oper if_then_Conj : Conj = notYet "if_then_Conj" ;
|
||||||
@@ -359,7 +319,6 @@ oper left_Ord : Ord = notYet "left_Ord" ;
|
|||||||
oper leg_N : N = notYet "leg_N" ;
|
oper leg_N : N = notYet "leg_N" ;
|
||||||
oper less_CAdv : CAdv = notYet "less_CAdv" ;
|
oper less_CAdv : CAdv = notYet "less_CAdv" ;
|
||||||
oper lie_V : V = notYet "lie_V" ;
|
oper lie_V : V = notYet "lie_V" ;
|
||||||
oper like_V2 : V2 = notYet "like_V2" ;
|
|
||||||
oper listen_V2 : V2 = notYet "listen_V2" ;
|
oper listen_V2 : V2 = notYet "listen_V2" ;
|
||||||
oper live_V : V = notYet "live_V" ;
|
oper live_V : V = notYet "live_V" ;
|
||||||
oper liver_N : N = notYet "liver_N" ;
|
oper liver_N : N = notYet "liver_N" ;
|
||||||
@@ -368,7 +327,6 @@ oper lose_V2 : V2 = notYet "lose_V2" ;
|
|||||||
oper louse_N : N = notYet "louse_N" ;
|
oper louse_N : N = notYet "louse_N" ;
|
||||||
oper love_N : N = notYet "love_N" ;
|
oper love_N : N = notYet "love_N" ;
|
||||||
oper love_V2 : V2 = notYet "love_V2" ;
|
oper love_V2 : V2 = notYet "love_V2" ;
|
||||||
oper many_Det : Det = notYet "many_Det" ;
|
|
||||||
oper married_A2 : A2 = notYet "married_A2" ;
|
oper married_A2 : A2 = notYet "married_A2" ;
|
||||||
oper married_Cl : NP -> NP -> Cl = notYet "married_Cl" ;
|
oper married_Cl : NP -> NP -> Cl = notYet "married_Cl" ;
|
||||||
oper meat_N : N = notYet "meat_N" ;
|
oper meat_N : N = notYet "meat_N" ;
|
||||||
@@ -406,12 +364,10 @@ oper oil_N : N = notYet "oil_N" ;
|
|||||||
oper old_A : A = notYet "old_A" ;
|
oper old_A : A = notYet "old_A" ;
|
||||||
oper on_Prep : Prep = notYet "on_Prep" ;
|
oper on_Prep : Prep = notYet "on_Prep" ;
|
||||||
oper open_V2 : V2 = notYet "open_V2" ;
|
oper open_V2 : V2 = notYet "open_V2" ;
|
||||||
oper or_Conj : Conj = notYet "or_Conj" ;
|
|
||||||
oper otherwise_PConj : PConj = notYet "otherwise_PConj" ;
|
oper otherwise_PConj : PConj = notYet "otherwise_PConj" ;
|
||||||
oper paint_V2A : V2A = notYet "paint_V2A" ;
|
oper paint_V2A : V2A = notYet "paint_V2A" ;
|
||||||
oper paper_N : N = notYet "paper_N" ;
|
oper paper_N : N = notYet "paper_N" ;
|
||||||
oper paris_PN : PN = notYet "paris_PN" ;
|
oper paris_PN : PN = notYet "paris_PN" ;
|
||||||
oper part_Prep : Prep = notYet "part_Prep" ;
|
|
||||||
oper peace_N : N = notYet "peace_N" ;
|
oper peace_N : N = notYet "peace_N" ;
|
||||||
oper pen_N : N = notYet "pen_N" ;
|
oper pen_N : N = notYet "pen_N" ;
|
||||||
oper planet_N : N = notYet "planet_N" ;
|
oper planet_N : N = notYet "planet_N" ;
|
||||||
@@ -435,7 +391,6 @@ oper read_V2 : V2 = notYet "read_V2" ;
|
|||||||
oper ready_A : A = notYet "ready_A" ;
|
oper ready_A : A = notYet "ready_A" ;
|
||||||
oper ready_VP : VP = notYet "ready_VP" ;
|
oper ready_VP : VP = notYet "ready_VP" ;
|
||||||
oper reason_N : N = notYet "reason_N" ;
|
oper reason_N : N = notYet "reason_N" ;
|
||||||
oper red_A : A = notYet "red_A" ;
|
|
||||||
oper religion_N : N = notYet "religion_N" ;
|
oper religion_N : N = notYet "religion_N" ;
|
||||||
oper restaurant_N : N = notYet "restaurant_N" ;
|
oper restaurant_N : N = notYet "restaurant_N" ;
|
||||||
oper right_Ord : Ord = notYet "right_Ord" ;
|
oper right_Ord : Ord = notYet "right_Ord" ;
|
||||||
@@ -465,10 +420,8 @@ oper sell_V3 : V3 = notYet "sell_V3" ;
|
|||||||
oper send_V3 : V3 = notYet "send_V3" ;
|
oper send_V3 : V3 = notYet "send_V3" ;
|
||||||
oper sew_V : V = notYet "sew_V" ;
|
oper sew_V : V = notYet "sew_V" ;
|
||||||
oper sharp_A : A = notYet "sharp_A" ;
|
oper sharp_A : A = notYet "sharp_A" ;
|
||||||
oper she_Pron : Pron = notYet "she_Pron" ;
|
|
||||||
oper sheep_N : N = notYet "sheep_N" ;
|
oper sheep_N : N = notYet "sheep_N" ;
|
||||||
oper ship_N : N = notYet "ship_N" ;
|
oper ship_N : N = notYet "ship_N" ;
|
||||||
oper shirt_N : N = notYet "shirt_N" ;
|
|
||||||
oper shoe_N : N = notYet "shoe_N" ;
|
oper shoe_N : N = notYet "shoe_N" ;
|
||||||
oper shop_N : N = notYet "shop_N" ;
|
oper shop_N : N = notYet "shop_N" ;
|
||||||
oper silver_N : N = notYet "silver_N" ;
|
oper silver_N : N = notYet "silver_N" ;
|
||||||
@@ -484,10 +437,7 @@ oper snake_N : N = notYet "snake_N" ;
|
|||||||
oper snow_N : N = notYet "snow_N" ;
|
oper snow_N : N = notYet "snow_N" ;
|
||||||
oper so_AdA : AdA = notYet "so_AdA" ;
|
oper so_AdA : AdA = notYet "so_AdA" ;
|
||||||
oper sock_N : N = notYet "sock_N" ;
|
oper sock_N : N = notYet "sock_N" ;
|
||||||
oper somePl_Det : Det = notYet "somePl_Det" ;
|
|
||||||
oper someSg_Det : Det = notYet "someSg_Det" ;
|
|
||||||
oper somebody_NP : NP = notYet "somebody_NP" ;
|
oper somebody_NP : NP = notYet "somebody_NP" ;
|
||||||
oper something_NP : NP = notYet "something_NP" ;
|
|
||||||
oper somewhere_Adv : Adv = notYet "somewhere_Adv" ;
|
oper somewhere_Adv : Adv = notYet "somewhere_Adv" ;
|
||||||
oper song_N : N = notYet "song_N" ;
|
oper song_N : N = notYet "song_N" ;
|
||||||
oper speak_V2 : V2 = notYet "speak_V2" ;
|
oper speak_V2 : V2 = notYet "speak_V2" ;
|
||||||
@@ -583,8 +533,5 @@ oper worm_N : N = notYet "worm_N" ;
|
|||||||
oper write_V2 : V2 = notYet "write_V2" ;
|
oper write_V2 : V2 = notYet "write_V2" ;
|
||||||
oper year_N : N = notYet "year_N" ;
|
oper year_N : N = notYet "year_N" ;
|
||||||
oper yellow_A : A = notYet "yellow_A" ;
|
oper yellow_A : A = notYet "yellow_A" ;
|
||||||
oper youPl_Pron : Pron = notYet "youPl_Pron" ;
|
|
||||||
oper youPol_Pron : Pron = notYet "youPol_Pron" ;
|
|
||||||
oper youSg_Pron : Pron = notYet "youSg_Pron" ;
|
|
||||||
oper young_A : A = notYet "young_A" ;
|
oper young_A : A = notYet "young_A" ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,24 +10,23 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
DetCN det cn = cn ** {s =
|
DetCN det cn = cn ** {s =
|
||||||
\\c =>
|
\\c =>
|
||||||
let cns : Str = case det.n of {
|
let cns : Str = case det.n of {
|
||||||
-- Pl => cn.s ! Bare ++ BIND ++ plural ! c ;
|
Pl => cn.s ! Bare ++ BIND ++ plural ! c ;
|
||||||
_Sg => cn.s ! c } ;
|
Sg => cn.s ! c } ;
|
||||||
dets : Str = det.s ! cn.c.origin ;
|
dets : Str = det.s ! cn.c.origin ;
|
||||||
detnum : Str = case det.numtype of {
|
detnum : Str = case det.numtype of {
|
||||||
IsNum => dets ++ cn.c.s ;
|
IsNum => dets ++ cn.c.s ;
|
||||||
IsDig => glue dets cn.c.s ;
|
IsDig => glue dets cn.c.s ;
|
||||||
NoNum => dets } ;
|
NoNum => dets } ;
|
||||||
in case isNum det of {
|
in case isNum det of {
|
||||||
True => cns ++ detnum ;
|
True => cn.rs ++ cns ++ detnum ;
|
||||||
False => detnum ++ cns }
|
False => cn.rs ++ detnum ++ cns }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : PN -> NP ;
|
-- : PN -> NP ;
|
||||||
-- UsePN pn = pn ** {
|
UsePN pn = pn ;
|
||||||
-- } ;
|
|
||||||
|
|
||||||
-- : Pron -> NP ;
|
-- : Pron -> NP ;
|
||||||
-- UsePron pron = pron ;
|
UsePron pron = pron ** {empty = []};
|
||||||
|
|
||||||
-- : Predet -> NP -> NP ; -- only the man
|
-- : Predet -> NP -> NP ; -- only the man
|
||||||
PredetNP predet np = np ** {s =
|
PredetNP predet np = np ** {s =
|
||||||
@@ -48,8 +47,13 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
-- PPartNP np v2 = np ** {
|
-- PPartNP np v2 = np ** {
|
||||||
-- s = \\c => v2.s ! ??? ++ np.s ! c } ; ----
|
-- s = \\c => v2.s ! ??? ++ np.s ! c } ; ----
|
||||||
|
|
||||||
-- : NP -> Adv -> NP ; -- Paris today ; boys, such as ..
|
-- : NP -> Adv -> NP ; -- Paris today
|
||||||
--AdvNP,ExtAdvNP = \np,adv -> np ** {} ;
|
AdvNP np adv = np ** {
|
||||||
|
s = \\nf => adv.s ++ np.s ! nf
|
||||||
|
} ; -- TODO test
|
||||||
|
|
||||||
|
-- : NP -> Adv -> NP ; -- boys, such as ..
|
||||||
|
-- ExtAdvNP np adv = np ** {} ;
|
||||||
|
|
||||||
-- : NP -> RS -> NP ; -- Paris, which is here
|
-- : NP -> RS -> NP ; -- Paris, which is here
|
||||||
-- RelNP np rs = np ** {
|
-- RelNP np rs = np ** {
|
||||||
@@ -64,9 +68,9 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- MassNP : CN -> NP ;
|
-- MassNP : CN -> NP ;
|
||||||
-- MassNP cn = useN cn ** {
|
MassNP cn = cn ** {
|
||||||
-- } ;
|
s = \\nf => cn.rs ++ cn.s ! nf
|
||||||
|
} ;
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
|
|
||||||
@@ -97,7 +101,11 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
NumCard card = card ;
|
NumCard card = card ;
|
||||||
|
|
||||||
-- : Digits -> Card ;
|
-- : Digits -> Card ;
|
||||||
-- NumDigits dig =
|
NumDigits dig = baseNum ** {
|
||||||
|
s = \\_,_ => dig.s ! NCard ;
|
||||||
|
n = dig.n ;
|
||||||
|
numtype = IsDig
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : Numeral -> Card ;
|
-- : Numeral -> Card ;
|
||||||
NumNumeral num = num ;
|
NumNumeral num = num ;
|
||||||
@@ -115,10 +123,10 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
-- } ;
|
-- } ;
|
||||||
|
|
||||||
-- : A -> Ord ;
|
-- : A -> Ord ;
|
||||||
-- OrdSuperl a = {
|
OrdSuperl a = {
|
||||||
-- s = \\af => "제일" ++ a.s ! af ;
|
s = \\vf => "가장" ++ a.s ! vf ;
|
||||||
-- n = Sg -- ?? is this meaningful?
|
n = Sg -- ?? is this meaningful?
|
||||||
-- } ;
|
} ;
|
||||||
|
|
||||||
-- One can combine a numeral and a superlative.
|
-- One can combine a numeral and a superlative.
|
||||||
|
|
||||||
@@ -130,10 +138,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
IndefArt = mkQuant [] [] ;
|
IndefArt = mkQuant [] [] ;
|
||||||
|
|
||||||
-- : Pron -> Quant
|
-- : Pron -> Quant
|
||||||
-- PossPron pron =
|
PossPron pron = pron.poss ;
|
||||||
-- let p = pron.poss ;
|
|
||||||
-- in DefArt ** {
|
|
||||||
-- } ;
|
|
||||||
|
|
||||||
--2 Common nouns
|
--2 Common nouns
|
||||||
|
|
||||||
@@ -155,23 +160,28 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
-- Use3N3 n3 = lin N2 n3 ;
|
-- Use3N3 n3 = lin N2 n3 ;
|
||||||
-- : AP -> CN -> CN
|
-- : AP -> CN -> CN
|
||||||
AdjCN ap cn = cn ** {
|
AdjCN ap cn = cn ** {
|
||||||
s = \\nf => ap.s ! AAttr ++ cn.s ! nf
|
s = \\nf => ap.compar ++ ap.s ! VAttr Pos ++ cn.s ! nf
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : CN -> RS -> CN ;
|
||||||
-- RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
-- } ;
|
rs = cn.rs ++ rs.s ! Subord
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
-- : CN -> Adv -> CN ;
|
-- : CN -> Adv -> CN ;
|
||||||
AdvCN cn adv = cn ** { } ;
|
AdvCN cn adv = cn ** {
|
||||||
|
rs = cn.rs ++ adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
-- Nouns can also be modified by embedded sentences and questions.
|
-- Nouns can also be modified by embedded sentences and questions.
|
||||||
-- For some nouns this makes little sense, but we leave this for applications
|
-- For some nouns this makes little sense, but we leave this for applications
|
||||||
-- to decide. Sentential complements are defined in VerbKor.
|
-- to decide. Sentential complements are defined in VerbKor.
|
||||||
|
|
||||||
-- : CN -> SC -> CN ; -- question where she sleeps
|
-- : CN -> SC -> CN ; -- question where she sleeps
|
||||||
SentCN cn sc = cn ** { } ;
|
SentCN cn sc = cn ** {
|
||||||
|
rs = cn.rs ++ sc.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Apposition
|
--2 Apposition
|
||||||
@@ -179,8 +189,9 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in {
|
|||||||
-- This is certainly overgenerating.
|
-- This is certainly overgenerating.
|
||||||
|
|
||||||
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
||||||
ApposCN cn np = cn ** { s = } ;
|
ApposCN cn np = cn ** {
|
||||||
-}
|
s = \\nf => np.s ! Bare ++ cn.s ! nf -- TODO which form of NP?
|
||||||
|
} ;
|
||||||
|
|
||||||
--2 Possessive and partitive constructs
|
--2 Possessive and partitive constructs
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ lin
|
|||||||
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||||
pot3plus m n = TODO ;
|
pot3plus m n = TODO ;
|
||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
LinDigit : Type = ResKor.Numeral ** {isTwo : Bool ; ten : Str} ;
|
LinDigit : Type = ResKor.Numeral ** {isTwo : Bool ; ten : Str} ;
|
||||||
|
|
||||||
@@ -123,4 +122,45 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
TODO : ResKor.Numeral = mkNum2 "TODO" "TODO" ;
|
TODO : ResKor.Numeral = mkNum2 "TODO" "TODO" ;
|
||||||
|
|
||||||
|
|
||||||
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
-- : Dig -> Digits ; -- 8
|
||||||
|
IDig d = d ;
|
||||||
|
|
||||||
|
-- : Dig -> Digits -> Digits ; -- 876
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o => d.s ! NCard ++ BIND ++ i.s ! o ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mk3Dig "1" "1번째" ResKor.Sg ;
|
||||||
|
D_2 = mkDig "2" ;
|
||||||
|
D_3 = mkDig "3" ;
|
||||||
|
D_4 = mkDig "4" ;
|
||||||
|
D_5 = mkDig "5" ;
|
||||||
|
D_6 = mkDig "6" ;
|
||||||
|
D_7 = mkDig "7" ;
|
||||||
|
D_8 = mkDig "8" ;
|
||||||
|
D_9 = mkDig "9" ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o ResKor.Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "번째") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> ResKor.Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard => c ; NOrd => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : ResKor.Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,27 @@ oper
|
|||||||
|
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
-- To abstract over number, valency and (some) case names,
|
-- To abstract over number, valency and (some) CaseParticle names,
|
||||||
-- we define the following identifiers. The application programmer
|
-- we define the following identifiers. The application programmer
|
||||||
-- should always use these constants instead of the constructors
|
-- should always use these constants instead of the constructors
|
||||||
-- defined in $ResKor$.
|
-- defined in $ResKor$.
|
||||||
|
|
||||||
|
CaseParticle : Type ; -- Arguments to give to V2, V3
|
||||||
|
topic : CaseParticle ; -- 은 or 는
|
||||||
|
subject : CaseParticle ; -- 이 or 가
|
||||||
|
object : CaseParticle ; -- 을 or 를
|
||||||
|
noCase : CaseParticle ; -- No case particle
|
||||||
|
|
||||||
|
NumOrigin : Type ; -- Arguments to give to N
|
||||||
|
nativeKorean : NumOrigin ; -- Native Korean variant of numerals: 하나, 둘, 셋 , …
|
||||||
|
sinoKorean : NumOrigin ; -- Sino-Korean variant of numerals: 일, 이, 삼
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
mkN : overload {
|
mkN : overload {
|
||||||
mkN : (noun : Str) -> N ; -- Predictable nouns
|
mkN : (noun : Str) -> N ; -- Predictable nouns with classifier 개. When quantified by a numeral, the numeral is of native Korean origin: 하나/둘/셋 , not 일/이/삼.
|
||||||
|
mkN : (noun,counter : Str) -> N ; -- Noun and classifier given as arguments. Takes numerals of native Korean origin.
|
||||||
|
mkN : (noun,counter : Str) -> NumOrigin -> N ; -- Noun, classifier and origin of numerals. E.g. `mkN "사람" "명" nativeKorean`
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
@@ -21,23 +32,33 @@ oper
|
|||||||
mkA : overload {
|
mkA : overload {
|
||||||
mkA : (adj : Str) -> A ; -- Regular adjective, given in -다 form
|
mkA : (adj : Str) -> A ; -- Regular adjective, given in -다 form
|
||||||
mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A.
|
mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A.
|
||||||
|
mkA : (jaemi : Str) -> (itda : V) -> A ; -- Compound adjective from 있다/없다 (or any other preconstructed verb), e.g. 재미있다 'amusing; entertaining', literally from parts 'fun' (Str) and 'have' (V).
|
||||||
|
mkA : (plain,polite,formal,attr : Str) -> A ; -- Worst case constructor: e.g. mkA "파랗다" "파래요" "파랗습니다" "파란"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- mkA2 : Str -> Prep -> A2 ;
|
mkA2 : overload {
|
||||||
|
mkA2 : Str -> A2 ; -- Regular adjective, given in -다 form, no postposition for complement.
|
||||||
|
mkA2 : Str -> Str -> A2 ; -- Adjective given in -다 form, postposition given as a string. If you want to use a postposition that has different forms for after vowel/after consonant, use the next constructor that takes a preconstructed Prep.
|
||||||
|
mkA2 : A -> Prep -> A2 ; -- Preconstructed adjective and postposition for complement.
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkPN : Str -> PN
|
||||||
|
= \s -> lin PN (mkNoun s) ;
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
|
|
||||||
-- Verbs
|
-- Verbs
|
||||||
mkV : overload {
|
mkV : overload {
|
||||||
mkV : (plain : Str) -> V ; -- Predictable verb. Takes plain, uninflected -다 form, e.g. 가다
|
mkV : (plain : Str) -> V ; -- Predictable verb. Takes plain, uninflected -다 form, e.g. 가다
|
||||||
mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다
|
mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다
|
||||||
|
mkV : (plain,polite,formal,attr : Str) -> V ; -- Worst case constructor: e.g. mkV "다르다" "달라요" "다릅니다" "다른"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
copula : V ; -- The copula verb ''
|
copula : V ; -- The copula verb ''
|
||||||
|
|
||||||
mkV2 : overload {
|
mkV2 : overload {
|
||||||
mkV2 : (plain : Str) -> V2 ; -- Regular verb. Takes plain, uninflected -다 form, object particle is 를.
|
mkV2 : (plain : Str) -> V2 ; -- Regular verb. Takes plain, uninflected -다 form, subject particle is 가/이 and object particle is 를/을.
|
||||||
mkV2 : V -> V2 ; -- Takes preconstructed V, object particle is 를.
|
mkV2 : V -> V2 ; -- Takes preconstructed V, subject particle is 가/이 and object particle is 를/을.
|
||||||
|
mkV2 : V -> (subj,obj : CaseParticle) -> V2 ; -- Takes preconstructed V, and subject and object particles. E.g. `mkV2 좋다_V topic subject` for "as for <SUBJ>는, <OBJ>가 is good".
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- mkV3 : overload {
|
-- mkV3 : overload {
|
||||||
@@ -66,7 +87,8 @@ oper
|
|||||||
--2 Structural categories
|
--2 Structural categories
|
||||||
|
|
||||||
mkPrep : overload {
|
mkPrep : overload {
|
||||||
mkPrep : (e : Str) -> Prep ; -- Particle like 에, attaches to the NP.
|
mkPrep : (e : Str) -> Prep ; -- Particle/postposition like 에: same form after vowel and consonant, attaches to the NP. Despite the name Prep, these are always postpositions.
|
||||||
|
mkPrep : (ro,euro : Str) -> Prep ; -- Particle like 로/으로: first argument is the form after vowel, second argument after consonant. Attaches to the NP.
|
||||||
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep ; -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
|
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep ; -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -91,10 +113,26 @@ oper
|
|||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
-- hidden from the document.
|
-- hidden from the document.
|
||||||
|
|
||||||
|
CaseParticle : Type = ResKor.NForm ;
|
||||||
|
topic = Topic ;
|
||||||
|
subject = Subject ;
|
||||||
|
object = Object ;
|
||||||
|
noCase = Bare ;
|
||||||
|
|
||||||
|
NumOrigin : Type = ResKor.NumOrigin ;
|
||||||
|
nativeKorean = NK ;
|
||||||
|
sinoKorean = SK ;
|
||||||
|
|
||||||
mkN = overload {
|
mkN = overload {
|
||||||
mkN : Str -> N = \s -> lin N (mkNoun s) ;
|
mkN : Str -> N = \s -> lin N (mkNoun s) ;
|
||||||
|
mkN : (noun,counter : Str) -> N = \n,c -> mkNCounter n c nativeKorean ;
|
||||||
|
mkN : (noun,counter : Str) -> NumOrigin -> N = mkNCounter
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkNCounter : (noun,counter : Str) -> NumOrigin -> N = \n,c,o ->
|
||||||
|
let noun : Noun = mkNoun n ;
|
||||||
|
counter : Counter = mkCounter c o ;
|
||||||
|
in lin N (noun ** {c = counter}) ;
|
||||||
|
|
||||||
mkN2 = overload {
|
mkN2 = overload {
|
||||||
mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ;
|
mkN2 : Str -> N2 = \s -> lin N2 (mkNoun s) ;
|
||||||
@@ -108,12 +146,27 @@ oper
|
|||||||
mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ;
|
mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ;
|
||||||
mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda ->
|
mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda ->
|
||||||
jakda ** {s = \\af => kiga ++ jakda.s ! af} ;
|
jakda ** {s = \\af => kiga ++ jakda.s ! af} ;
|
||||||
|
mkA : (plain,polite,formal,attr : Str) -> A
|
||||||
|
= \x1,x2,x3,x4 -> lin A (mkAdjReg x1 x2 x3 x4) ;
|
||||||
|
mkA : (jaemi : Str) -> (itda : V) -> A
|
||||||
|
= \jaemi,itda -> lin A ({s = \\vf => jaemi ++ itda.s ! vf}) ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkA2 = overload {
|
||||||
|
mkA2 : Str -> A2 = \s -> lin A2 (atoa2 (mkAdj s)) ;
|
||||||
|
mkA2 : Str -> Str -> A2
|
||||||
|
= \s,p -> let adj : Adjective = mkAdj s ;
|
||||||
|
prep : Prep = mkPrep p
|
||||||
|
in lin A2 (atoa2 adj ** {p2 = prep}) ;
|
||||||
|
mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (atoa2 a ** {p2 = p}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV = overload {
|
mkV = overload {
|
||||||
mkV : (plain : Str) -> V = \v -> lin V (mkVerb v) ;
|
mkV : (plain : Str) -> V = \v -> lin V (mkVerb v) ;
|
||||||
mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** {
|
mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** {
|
||||||
s = \\vf => nore + hada.s ! vf} ;
|
s = \\vf => nore + hada.s ! vf} ;
|
||||||
|
mkV : (plain,polite,formal,attr : Str) -> V
|
||||||
|
= \x1,x2,x3,x4 -> lin V (mkVerbReg x1 x2 x3 x4) ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
copula = ResKor.copula ;
|
copula = ResKor.copula ;
|
||||||
@@ -124,6 +177,8 @@ oper
|
|||||||
mkV2 = overload {
|
mkV2 = overload {
|
||||||
mkV2 : (plain : Str) -> V2 = \v2 -> lin V2 (mkVerb2 v2) ;
|
mkV2 : (plain : Str) -> V2 = \v2 -> lin V2 (mkVerb2 v2) ;
|
||||||
mkV2 : V -> V2 = vtov2 ;
|
mkV2 : V -> V2 = vtov2 ;
|
||||||
|
mkV2 : V -> (subj,obj : CaseParticle) -> V2 = \v,sc,c2 ->
|
||||||
|
vtov2 v ** {sc = sc ; c2 = c2} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkV3 = overload {
|
mkV3 = overload {
|
||||||
@@ -136,6 +191,8 @@ oper
|
|||||||
mkPrep = overload {
|
mkPrep = overload {
|
||||||
mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP.
|
mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP.
|
||||||
= \e -> lin Prep (ResKor.mkPrep e) ;
|
= \e -> lin Prep (ResKor.mkPrep e) ;
|
||||||
|
mkPrep : (ro,euro : Str) -> Prep
|
||||||
|
= \ro,euro -> lin Prep (ResKor.mkPrep2 ro euro) ;
|
||||||
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
|
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
|
||||||
= \dwie,f -> lin Prep (ResKor.mkPrep dwie ** {attaches = f}) ;
|
= \dwie,f -> lin Prep (ResKor.mkPrep dwie ** {attaches = f}) ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
Binary file not shown.
@@ -6,20 +6,21 @@ concrete PhraseKor of Phrase = CatKor ** open Prelude, ResKor in {
|
|||||||
UttS s = {s = s.s ! Statement} ;
|
UttS s = {s = s.s ! Statement} ;
|
||||||
UttQS qs = qs ;
|
UttQS qs = qs ;
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
|
UttAdv adv = adv ;
|
||||||
|
UttInterj i = i ;
|
||||||
{-
|
{-
|
||||||
UttImpSg pol imp =
|
UttImpSg pol imp =
|
||||||
UttImpPl pol imp =
|
UttImpPl pol imp =
|
||||||
UttImpPol = UttImpSg ;
|
UttImpPol = UttImpSg ;
|
||||||
|
-}
|
||||||
|
UttIP ip = {s = ip.s ! Bare} ;
|
||||||
|
|
||||||
|
UttNP np = {s = np.s ! Bare} ;
|
||||||
|
UttVP vp = {s = linVP vp} ;
|
||||||
|
UttCN cn = {s = cn.rs ++ cn.s ! Bare} ;
|
||||||
|
UttCard n = {s = n.s ! NK ! Indep} ;
|
||||||
|
UttAP ap = { s = ap.compar ++ ap.s ! VF Plain Pos} ;
|
||||||
|
|
||||||
UttIP ip = {s = ip.s ! } ;
|
|
||||||
UttNP np = {s = np.s ! } ;
|
|
||||||
UttVP vp = {s = } ;
|
|
||||||
UttAdv adv = {s = } ;
|
|
||||||
UttCN n = {s = } ;
|
|
||||||
UttCard n = {s = } ;
|
|
||||||
UttAP ap = { s = ap.s ! } ;
|
|
||||||
UttInterj i = i ;
|
|
||||||
-}
|
|
||||||
NoPConj = {s = []} ;
|
NoPConj = {s = []} ;
|
||||||
-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
|
-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
concrete RelativeKor of Relative = CatKor ** open
|
concrete RelativeKor of Relative = CatKor ** open
|
||||||
ResKor, Prelude, (NS=NounKor), (SS=StructuralKor) in {
|
ResKor, Prelude, (NS=NounKor), (SS=StructuralKor) in {
|
||||||
|
|
||||||
{-
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> RCl ; -- such that John loves her
|
-- : Cl -> RCl ; -- such that John loves her
|
||||||
-- RelCl cl = ;
|
RelCl = relSlash (ss "") ;
|
||||||
|
|
||||||
-- : RP -> VP -> RCl ;
|
-- : RP -> VP -> RCl ;
|
||||||
RelVP rp vp =
|
RelVP rp vp = { -- TODO no tenses yet in the grammar
|
||||||
|
s = \\t,a,p,cltyp =>
|
||||||
|
rp.s ++ vp.adv ++ vp.nObj ++
|
||||||
|
case cltyp of {
|
||||||
|
WithConj => vp.s ! VStem ;
|
||||||
|
_ => vp.s ! VAttr p } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
RelSlash rp cls =
|
RelSlash = relSlash ;
|
||||||
|
|
||||||
|
|
||||||
-- : RP ;
|
-- : RP ;
|
||||||
IdRP = {s = ""} ;
|
IdRP = {s = ""} ;
|
||||||
|
|
||||||
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||||
--FunRP prep np rp = {} ;
|
--FunRP prep np rp = {} ;
|
||||||
-}
|
|
||||||
|
oper
|
||||||
|
relSlash : SS -> ClSlash -> ResKor.RClause = \rp,cls -> {
|
||||||
|
s = \\t,a,p,cltyp => rp.s ++
|
||||||
|
case cltyp of {
|
||||||
|
WithConj => cls.s ! t ! a ! p ! WithConj ;
|
||||||
|
_ => cls.s ! t ! a ! p ! Subord } ;
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,76 +13,75 @@ oper
|
|||||||
origin = NK
|
origin = NK
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Noun : Type = {
|
mkCounter : Str -> NumOrigin -> Counter = \s,o -> baseCounter ** {
|
||||||
|
s = s ;
|
||||||
|
origin = o ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
BaseNoun : Type = {
|
||||||
s : NForm => Str ;
|
s : NForm => Str ;
|
||||||
p : Phono ;
|
p : Phono ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
Noun : Type = BaseNoun ** {
|
||||||
c : Counter ;
|
c : Counter ;
|
||||||
} ;
|
} ;
|
||||||
Noun2 : Type = Noun ; -- TODO eventually more parameters?
|
Noun2 : Type = Noun ; -- TODO eventually more parameters?
|
||||||
Noun3 : Type = Noun ;
|
Noun3 : Type = Noun ;
|
||||||
|
|
||||||
CNoun : Type = Noun ** {
|
CNoun : Type = Noun ** {
|
||||||
|
rs : Str ; -- Relative clause comes before determiner
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PNoun : Type = Noun ;
|
|
||||||
|
|
||||||
mkNoun : Str -> Noun = \str -> {
|
mkNoun : Str -> Noun = \str -> {
|
||||||
s = \\cas => str + allomorph cas str ;
|
s = \\cas => str + allomorph cas str ;
|
||||||
p = if_then_else Phono (vowFinal str) Vowel Consonant ;
|
p = if_then_else Phono (vowFinal str) Vowel Consonant ;
|
||||||
c = baseCounter
|
c = baseCounter
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
useN : Noun -> CNoun = \n -> n ;
|
useN : Noun -> CNoun = \n -> n ** {
|
||||||
|
rs = []
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
-- NP
|
-- NP
|
||||||
|
|
||||||
-- BaseNP : Type = {
|
NounPhrase = BaseNoun ** {
|
||||||
-- a : Agreement ;
|
|
||||||
-- isPron : Bool ;
|
|
||||||
-- empty : Str ; -- standard trick for pro-drop
|
-- empty : Str ; -- standard trick for pro-drop
|
||||||
-- } ;
|
} ;
|
||||||
--
|
|
||||||
-- emptyNP : NounPhrase = {
|
|
||||||
-- s = \\_ => [] ;
|
|
||||||
-- a = Sg3 Masc ;
|
|
||||||
-- isPron = False ;
|
|
||||||
-- empty = [] ;
|
|
||||||
-- } ;
|
|
||||||
--
|
|
||||||
-- indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\c => s} ;
|
|
||||||
|
|
||||||
--NounPhrase : Type = BaseNP ** {s : NForm => Str} ;
|
|
||||||
NounPhrase = Noun ;
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Pronouns
|
-- Pronouns
|
||||||
|
|
||||||
Pronoun : Type = NounPhrase ** {
|
Pronoun : Type = BaseNoun ** {
|
||||||
-- poss : { -- for PossPron : Pron -> Quant
|
poss : Quant ;
|
||||||
-- } ;
|
|
||||||
sp : NForm => Str ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkPron = overload {
|
||||||
|
mkPron : (stem,poss : Str) -> Pronoun = \s,poss -> mkNoun s ** {
|
||||||
|
poss = mkQuant poss (poss ++ "것") ;
|
||||||
|
} ;
|
||||||
|
mkPron : (stem : Str) -> Pronoun = \s -> mkNoun s ** {
|
||||||
|
poss = mkQuant (s + "의") (s + "의" ++ "것") ;
|
||||||
|
}
|
||||||
|
} ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Det, Quant, Card, Ord
|
-- Det, Quant, Card, Ord
|
||||||
|
|
||||||
BaseQuant : Type = {
|
BaseQuant : Type = {
|
||||||
|
sp : NForm => Str ;
|
||||||
isPoss : Bool ;
|
isPoss : Bool ;
|
||||||
p : Phono
|
p : Phono
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Determiner : Type = BaseQuant ** {
|
Determiner : Type = BaseQuant ** {
|
||||||
s : NumOrigin => Str ; -- Chosen by the counter of CN
|
s : NumOrigin => Str ; -- Chosen by the counter of CN
|
||||||
sp : NForm => Str ;
|
|
||||||
n : Number ;
|
n : Number ;
|
||||||
numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl
|
numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Quant : Type = BaseQuant ** {
|
Quant : Type = BaseQuant ** {
|
||||||
s : Str ;
|
s : Str ;
|
||||||
sp : NForm => Str ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Num : Type = {
|
Num : Type = {
|
||||||
@@ -104,6 +103,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
baseQuant : BaseQuant = {
|
baseQuant : BaseQuant = {
|
||||||
|
sp = \\_ => [] ;
|
||||||
isPoss = False ;
|
isPoss = False ;
|
||||||
p = Vowel ;
|
p = Vowel ;
|
||||||
} ;
|
} ;
|
||||||
@@ -114,6 +114,13 @@ oper
|
|||||||
p = (mkNoun sp).p ;
|
p = (mkNoun sp).p ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkDet : Str -> Number -> Determiner = \s,num -> baseQuant ** {
|
||||||
|
s = \\_ => (mkNoun s).s ! Bare ; -- NumOrigin irrelevant for non-numbers
|
||||||
|
sp = (mkNoun s).s ;
|
||||||
|
n = num ;
|
||||||
|
numtype = NoNum ;
|
||||||
|
} ;
|
||||||
|
|
||||||
plural : NForm => Str = table {
|
plural : NForm => Str = table {
|
||||||
Bare => "들" ;
|
Bare => "들" ;
|
||||||
nf => "들" + allomorph nf "들"
|
nf => "들" + allomorph nf "들"
|
||||||
@@ -121,9 +128,13 @@ oper
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Postpositions
|
-- Postpositions
|
||||||
|
|
||||||
Postposition : Type = {s : Str ; attaches : Bool} ;
|
Postposition : Type = {s : Phono => Str ; attaches : Bool} ;
|
||||||
|
|
||||||
mkPrep : Str -> Postposition = \str -> {s=str ; attaches=True} ;
|
mkPrep : Str -> Postposition = \str -> {s=\\_ => str ; attaches=True} ;
|
||||||
|
mkPrep2 : (ro,euro : Str) -> Postposition = \ro,euro -> {
|
||||||
|
s = table {Vowel => ro ; Consonant => euro} ;
|
||||||
|
attaches = True
|
||||||
|
} ;
|
||||||
|
|
||||||
emptyPP : Postposition = mkPrep [] ** {attaches=False} ;
|
emptyPP : Postposition = mkPrep [] ** {attaches=False} ;
|
||||||
datPP : Postposition = mkPrep "에게" ;
|
datPP : Postposition = mkPrep "에게" ;
|
||||||
@@ -131,16 +142,25 @@ oper
|
|||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Adjectives
|
-- Adjectives
|
||||||
|
|
||||||
Adjective : Type = {s : AForm => Str} ;
|
Adjective : Type = {s : VForm => Str} ; -- Adjectives are verbs
|
||||||
Adjective2 : Type = Adjective ;
|
Adjective2 : Type = Adjective ** {c2 : NForm ; p2 : Postposition} ;
|
||||||
|
|
||||||
|
v2a : (attrpos : Str) -> Verb -> Adjective = \attrpos,v -> {
|
||||||
|
s = table {
|
||||||
|
VAttr Pos => attrpos ; -- Positive Attr is different in
|
||||||
|
vf => v.s ! vf } -- adjectives, otherwise adj forms == verb forms.
|
||||||
|
} ;
|
||||||
|
|
||||||
mkAdj : Str -> Adjective = \plain ->
|
mkAdj : Str -> Adjective = \plain ->
|
||||||
let stem = init plain ;
|
let v : Verb = mkVerb plain ;
|
||||||
verb = mkVerb plain ;
|
stem : Str = v.s ! VStem ;
|
||||||
in {
|
attrpos : Str = add_N stem ;
|
||||||
s = table { AAttr => add_N stem ;
|
in v2a attrpos v ;
|
||||||
APred vf => verb.s ! vf }
|
|
||||||
} ;
|
mkAdjReg : (x1,_,_,x4 : Str) -> Adjective = \plain,polite,formal,attr ->
|
||||||
|
v2a attr (mkVerbReg plain polite formal attr) ;
|
||||||
|
|
||||||
|
atoa2 : Adjective -> Adjective2 = \a -> a ** {c2=Bare ; p2=emptyPP} ;
|
||||||
|
|
||||||
AdjPhrase : Type = Adjective ** {compar : Str} ;
|
AdjPhrase : Type = Adjective ** {compar : Str} ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -159,16 +179,13 @@ oper
|
|||||||
|
|
||||||
mkVerb : (plain : Str) -> Verb = \plain ->
|
mkVerb : (plain : Str) -> Verb = \plain ->
|
||||||
let stem = init plain ;
|
let stem = init plain ;
|
||||||
-- plainpres = case vowFinal stem of { -- not used in grammar yet
|
|
||||||
-- True => add_N stem + "다" ;
|
|
||||||
-- False => stem + "는다" } ;
|
|
||||||
informal = add_eo stem ; -- not used in grammar yet
|
informal = add_eo stem ; -- not used in grammar yet
|
||||||
polpres = informal + "요" ;
|
polite = informal + "요" ;
|
||||||
formalpres = case vowFinal stem of {
|
formal = case vowFinal stem of {
|
||||||
True => add_B stem + "니다" ;
|
True => add_B stem + "니다" ;
|
||||||
False => stem + "습니다" } ;
|
False => stem + "습니다" } ;
|
||||||
neg = stem + "지" ;
|
attrpos = stem + "는" ;
|
||||||
in mkVerbReg plain polpres formalpres neg ;
|
in mkVerbReg plain polite formal attrpos ;
|
||||||
|
|
||||||
mkVerb2 : (plain : Str) -> Verb2 = \plain -> vtov2 (mkVerb plain) ;
|
mkVerb2 : (plain : Str) -> Verb2 = \plain -> vtov2 (mkVerb plain) ;
|
||||||
mkVerb3 : (plain : Str) -> Verb3 = \plain -> v2tov3 (mkVerb2 plain) ;
|
mkVerb3 : (plain : Str) -> Verb3 = \plain -> v2tov3 (mkVerb2 plain) ;
|
||||||
@@ -176,18 +193,23 @@ oper
|
|||||||
vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Object ; p2 = emptyPP} ;
|
vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Object ; p2 = emptyPP} ;
|
||||||
v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Bare ; p3 = datPP} ;
|
v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Bare ; p3 = datPP} ;
|
||||||
|
|
||||||
|
-- ㄹ-irregulars, ㅎ-irregular
|
||||||
mkVerbReg : (x1,_,_,x4 : Str) -> Verb =
|
mkVerbReg : (x1,_,_,x4 : Str) -> Verb =
|
||||||
\plain,polite,formal,neg ->
|
\plain,polite,formal,attrpos ->
|
||||||
let stem = init plain ;
|
let stem = init plain ;
|
||||||
|
neg = stem + "지" ;
|
||||||
|
attrneg = neg ++ "않는" ;
|
||||||
planeg = neg ++ negForms ! Plain ;
|
planeg = neg ++ negForms ! Plain ;
|
||||||
polneg = neg ++ negForms ! Polite ;
|
polneg = neg ++ negForms ! Polite ;
|
||||||
formneg = neg ++ negForms ! Formal ;
|
formneg = neg ++ negForms ! Formal ;
|
||||||
in mkVerbFull stem plain polite formal planeg polneg formneg ;
|
in mkVerbFull stem attrpos attrneg plain polite formal planeg polneg formneg ;
|
||||||
|
|
||||||
mkVerbFull : (x1,_,_,_,_,_,x7 : Str) -> Verb =
|
mkVerbFull : (x1,_,_,_,_,_,_,_,x9 : Str) -> Verb =
|
||||||
\stem,plain,polite,formal,planeg,polneg,formneg -> {
|
\stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg -> {
|
||||||
s = table {
|
s = table {
|
||||||
VStem => stem ;
|
VStem => stem ;
|
||||||
|
VAttr Pos => attrpos ;
|
||||||
|
VAttr Neg => attrneg ;
|
||||||
VF Plain Pos => plain ;
|
VF Plain Pos => plain ;
|
||||||
VF Plain Neg => planeg ;
|
VF Plain Neg => planeg ;
|
||||||
VF Polite Pos => polite ;
|
VF Polite Pos => polite ;
|
||||||
@@ -200,6 +222,8 @@ oper
|
|||||||
|
|
||||||
copula : Verb = mkVerbFull
|
copula : Verb = mkVerbFull
|
||||||
"이"
|
"이"
|
||||||
|
"이는" -- TODO does this exist?
|
||||||
|
"아니는" -- TODO does this exist?
|
||||||
"이다"
|
"이다"
|
||||||
"이에요"
|
"이에요"
|
||||||
"입니다"
|
"입니다"
|
||||||
@@ -209,6 +233,7 @@ oper
|
|||||||
|
|
||||||
copulaAfterVowel : Verb = copula ** {
|
copulaAfterVowel : Verb = copula ** {
|
||||||
s = \\vf => case vf of {
|
s = \\vf => case vf of {
|
||||||
|
VAttr Pos => "는" ; -- TODO just guessing
|
||||||
VF Plain Pos => "다" ;
|
VF Plain Pos => "다" ;
|
||||||
VF Polite Pos => "예요" ;
|
VF Polite Pos => "예요" ;
|
||||||
_ => copula.s ! vf }
|
_ => copula.s ! vf }
|
||||||
@@ -216,6 +241,8 @@ oper
|
|||||||
|
|
||||||
have_V : Verb = mkVerbFull
|
have_V : Verb = mkVerbFull
|
||||||
"있"
|
"있"
|
||||||
|
"있는"
|
||||||
|
"없는"
|
||||||
"있다"
|
"있다"
|
||||||
"있어요"
|
"있어요"
|
||||||
"있습니다"
|
"있습니다"
|
||||||
@@ -223,11 +250,19 @@ oper
|
|||||||
"없어요"
|
"없어요"
|
||||||
"없습니다" ;
|
"없습니다" ;
|
||||||
|
|
||||||
|
-- For building an adjective. Different attr from do_V.
|
||||||
|
do_A : Verb = mkVerbReg
|
||||||
|
"하다"
|
||||||
|
"해요"
|
||||||
|
"합니다"
|
||||||
|
"한" ;
|
||||||
|
hada_A = do_A ; -- Exposing both names (hada=transliteration, do=translation)
|
||||||
|
|
||||||
do_V : Verb = mkVerbReg
|
do_V : Verb = mkVerbReg
|
||||||
"하다"
|
"하다"
|
||||||
"해요"
|
"해요"
|
||||||
"합니다"
|
"합니다"
|
||||||
"하지" ;
|
"하는" ;
|
||||||
|
|
||||||
negForms : Style => Str =
|
negForms : Style => Str =
|
||||||
table { Plain => "않다" ;
|
table { Plain => "않다" ;
|
||||||
@@ -239,26 +274,37 @@ oper
|
|||||||
|
|
||||||
Adverb : Type = SS ;
|
Adverb : Type = SS ;
|
||||||
|
|
||||||
|
prepNP : NForm -> Postposition -> NounPhrase -> Adverb = \nf,pp,np -> {
|
||||||
|
s = case pp.attaches of {
|
||||||
|
True => glue (np.s ! nf) (pp.s ! np.p) ;
|
||||||
|
False => np.s ! nf ++ (pp.s ! np.p)}
|
||||||
|
} ;
|
||||||
------------------
|
------------------
|
||||||
-- 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 ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- Do not remove this. Used in a particular application grammar.
|
||||||
|
commaConj : Conj = {
|
||||||
|
s1, s2 = [] ;
|
||||||
|
c = Comma ;
|
||||||
|
n = Pl ;
|
||||||
|
} ;
|
||||||
|
|
||||||
------------------
|
------------------
|
||||||
-- VP
|
-- VP
|
||||||
|
|
||||||
Complement : Type = {
|
Complement : Type = {
|
||||||
s : VForm => Str ;
|
s : VForm => Str ;
|
||||||
-- compar : Str ; -- comparative is discontinuous
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
emptyComp : Complement = {
|
emptyComp : Complement = {
|
||||||
s = \\_ => [] ;
|
s = \\_ => [] ;
|
||||||
-- compar : Str ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
BaseVP : Type = {
|
BaseVP : Type = {
|
||||||
@@ -285,7 +331,7 @@ oper
|
|||||||
useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ;
|
useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ;
|
||||||
|
|
||||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** {
|
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** {
|
||||||
nObj = np.s ! v2.c2 ++ v2.p2.s
|
nObj = np.s ! v2.c2 ++ v2.p2.s ! np.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ;
|
insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ;
|
||||||
@@ -302,16 +348,20 @@ oper
|
|||||||
|
|
||||||
QClause : Type = Clause ;
|
QClause : Type = Clause ;
|
||||||
|
|
||||||
RClause : Type = {s : NForm => Tense => Anteriority => Polarity => Str} ;
|
RClause : Type = Clause ;
|
||||||
|
|
||||||
Sentence : Type = {s : ClType => Str} ;
|
Sentence : Type = {s : ClType => Str} ;
|
||||||
|
|
||||||
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
|
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp ->
|
||||||
|
let npstr : Str = np.s ! vp.sc in predVP' npstr vp ;
|
||||||
|
|
||||||
|
predVP' : (np : Str) -> VerbPhrase -> ClSlash = \np,vp -> vp ** {
|
||||||
s = \\t,a,p,cltyp =>
|
s = \\t,a,p,cltyp =>
|
||||||
let vf = case cltyp of {
|
let vf = case cltyp of {
|
||||||
Subord => VStem ;
|
Subord => VAttr p ;
|
||||||
|
WithConj => VStem ;
|
||||||
_ => VF Polite p } -- TODO: more tenses, politeness
|
_ => VF Polite p } -- TODO: more tenses, politeness
|
||||||
in np.s ! vp.sc
|
in np
|
||||||
++ vp.nObj -- an object, not copula complement
|
++ vp.nObj -- an object, not copula complement
|
||||||
++ vp.adv
|
++ vp.adv
|
||||||
++ vp.s ! vf
|
++ vp.s ! vf
|
||||||
@@ -321,5 +371,6 @@ oper
|
|||||||
-- linrefs
|
-- linrefs
|
||||||
|
|
||||||
linVerb : Verb -> Str = \v -> v.s ! linVF ;
|
linVerb : Verb -> Str = \v -> v.s ! linVF ;
|
||||||
|
linVP : VerbPhrase -> Str = \vp -> vp.nObj ++ vp.adv ++ vp.s ! linVF ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ lin
|
|||||||
PredVP = predVP ;
|
PredVP = predVP ;
|
||||||
|
|
||||||
-- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94)
|
-- : SC -> VP -> Cl ; -- that she goes is good (Saeed p. 94)
|
||||||
--PredSCVP sc vp = ;
|
PredSCVP sc vp = predVP' sc.s vp ;
|
||||||
|
|
||||||
--2 Clauses missing object noun phrases
|
--2 Clauses missing object noun phrases
|
||||||
-- : NP -> VPSlash -> ClSlash ;
|
-- : NP -> VPSlash -> ClSlash ;
|
||||||
@@ -35,16 +35,16 @@ lin
|
|||||||
ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ;
|
ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ;
|
||||||
|
|
||||||
--2 Embedded sentences
|
--2 Embedded sentences
|
||||||
|
-}
|
||||||
-- : S -> SC ;
|
-- : S -> SC ;
|
||||||
EmbedS s = {s = s.s ! True} ; -- choose subordinate
|
EmbedS s = {s = s.s ! Subord ++ "것이"} ; -- TODO check subject case
|
||||||
|
|
||||||
-- : QS -> SC ;
|
-- : QS -> SC ;
|
||||||
-- EmbedQS qs = { } ;
|
-- EmbedQS qs = { } ;
|
||||||
|
|
||||||
-- : VP -> SC ;
|
-- : VP -> SC ;
|
||||||
EmbedVP vp = {s = infVP vp} ;
|
EmbedVP vp = {s = vp.s ! VAttr Pos ++ "것이"} ;
|
||||||
-}
|
|
||||||
--2 Sentences
|
--2 Sentences
|
||||||
|
|
||||||
-- : Temp -> Pol -> Cl -> S ;
|
-- : Temp -> Pol -> Cl -> S ;
|
||||||
@@ -56,7 +56,7 @@ lin
|
|||||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> RCl -> RS ;
|
-- : Temp -> Pol -> RCl -> RS ;
|
||||||
-- UseRCl t p cl = {s = } ;
|
UseRCl t p rcl = {s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! c} ;
|
||||||
|
|
||||||
-- AdvS : Adv -> S -> S ; -- then I will go home
|
-- AdvS : Adv -> S -> S ; -- then I will go home
|
||||||
AdvS = advS "" ;
|
AdvS = advS "" ;
|
||||||
|
|||||||
@@ -38,16 +38,15 @@ lin there_Adv = ss "" ;
|
|||||||
-------
|
-------
|
||||||
-- Conj
|
-- Conj
|
||||||
|
|
||||||
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 = {s2 = \\_ => "" ; s1 = [] ; n = Sg} ;
|
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} ;
|
||||||
@@ -68,17 +67,16 @@ lin all_Predet = {s = \\_ => "마다" ; p = Vowel} ;
|
|||||||
lin only_Predet = {s = \\_ => "만" ; p = Consonant} ;
|
lin only_Predet = {s = \\_ => "만" ; p = Consonant} ;
|
||||||
--lin most_Predet = {s = ""} ;
|
--lin most_Predet = {s = ""} ;
|
||||||
|
|
||||||
{-
|
|
||||||
lin every_Det = R.defDet [] pl **
|
|
||||||
{ s = mkVow } ;
|
|
||||||
lin few_Det = R.indefDet "" pl ;
|
|
||||||
lin many_Det = R.indefDet "" pl ;
|
|
||||||
lin much_Det = R.indefDet "" sg ;
|
|
||||||
|
|
||||||
lin somePl_Det =
|
--lin every_Det = ;
|
||||||
lin someSg_Det =
|
lin few_Det = mkDet "조금의" Pl ;
|
||||||
lin no_Quant =
|
lin many_Det = mkDet "많은" Pl ;
|
||||||
-}
|
-- lin much_Det = ;
|
||||||
|
|
||||||
|
lin somePl_Det = mkDet "어떤" Pl ;
|
||||||
|
lin someSg_Det = mkDet "어떤" Sg ;
|
||||||
|
--lin no_Quant =
|
||||||
|
|
||||||
lin that_Quant = mkQuant "그" "그것" ;
|
lin that_Quant = mkQuant "그" "그것" ;
|
||||||
lin this_Quant = mkQuant "이" "이것" ;
|
lin this_Quant = mkQuant "이" "이것" ;
|
||||||
{-lin which_IQuant =
|
{-lin which_IQuant =
|
||||||
@@ -92,11 +90,8 @@ lin everything_NP = defNP "" N.NumSg ;
|
|||||||
lin nobody_NP = mkVerb; ""
|
lin nobody_NP = mkVerb; ""
|
||||||
lin nothing_NP = defNP "" N.NumSg ;
|
lin nothing_NP = defNP "" N.NumSg ;
|
||||||
lin somebody_NP = defNP "" N.NumSg ;
|
lin somebody_NP = defNP "" N.NumSg ;
|
||||||
lin something_NP = defNP "" N.NumSg ;
|
|
||||||
|
|
||||||
oper
|
|
||||||
defNP : Str -> Num -> NP = {} ;
|
|
||||||
-}
|
-}
|
||||||
|
lin something_NP = mkNoun "무엇" ;
|
||||||
|
|
||||||
-------
|
-------
|
||||||
-- Prep
|
-- Prep
|
||||||
@@ -106,8 +101,8 @@ oper
|
|||||||
-- lin before_Prep = mkPrep "" ;
|
-- lin before_Prep = mkPrep "" ;
|
||||||
lin behind_Prep = mkPrep "뒤에" False ;
|
lin behind_Prep = mkPrep "뒤에" False ;
|
||||||
-- lin between_Prep = = mkPrep "" ;
|
-- lin between_Prep = = mkPrep "" ;
|
||||||
-- lin by8agent_Prep = mkPrep ;
|
lin by8agent_Prep = mkPrep "에 의해" ; -- TODO check
|
||||||
-- lin by8means_Prep = mkPrep ;
|
lin by8means_Prep = mkPrep "에 인해" ; -- TODO check
|
||||||
-- lin during_Prep = mkPrep ;
|
-- lin during_Prep = mkPrep ;
|
||||||
-- lin except_Prep = mkPrep ;
|
-- lin except_Prep = mkPrep ;
|
||||||
lin for_Prep = mkPrep "에게" ;
|
lin for_Prep = mkPrep "에게" ;
|
||||||
@@ -115,12 +110,12 @@ lin for_Prep = mkPrep "에게" ;
|
|||||||
-- lin in8front_Prep = mkPrep "" ;
|
-- lin in8front_Prep = mkPrep "" ;
|
||||||
lin in_Prep = mkPrep "에서" ;
|
lin in_Prep = mkPrep "에서" ;
|
||||||
-- lin on_Prep = mkPrep "에서" ;
|
-- lin on_Prep = mkPrep "에서" ;
|
||||||
-- lin part_Prep = mkPrep ;
|
lin part_Prep = mkPrep "의" ;
|
||||||
lin possess_Prep = mkPrep "의" ;
|
lin possess_Prep = mkPrep "의" ;
|
||||||
-- lin through_Prep = mkPrep ;
|
-- lin through_Prep = mkPrep ;
|
||||||
lin to_Prep = mkPrep "에";
|
lin to_Prep = mkPrep "에";
|
||||||
-- lin under_Prep = mkPrep "" ;
|
-- lin under_Prep = mkPrep "" ;
|
||||||
-- lin with_Prep = mkPrep "" ;
|
lin with_Prep = mkPrep "와" "과" ;
|
||||||
-- lin without_Prep = mkPrep "" ;
|
-- lin without_Prep = mkPrep "" ;
|
||||||
|
|
||||||
|
|
||||||
@@ -129,13 +124,15 @@ lin to_Prep = mkPrep "에";
|
|||||||
|
|
||||||
-- Pronouns are closed class, no constructor in ParadigmsKor.
|
-- Pronouns are closed class, no constructor in ParadigmsKor.
|
||||||
-- it_Pron =
|
-- it_Pron =
|
||||||
-- i_Pron =
|
i_Pron = let iReg : Pronoun = mkPron "저" "제" in
|
||||||
-- youPol_Pron,
|
iReg ** {s = table {Subject => "제가"; nf => iReg.s ! nf}
|
||||||
-- youSg_Pron =
|
} ;
|
||||||
-- he_Pron =
|
youPol_Pron = mkPron "당신" ;
|
||||||
-- she_Pron =
|
youSg_Pron = mkPron "너" ; -- NB. this is very informal, best not used
|
||||||
|
he_Pron = mkPron "그" ;
|
||||||
|
she_Pron = mkPron "그녀" ;
|
||||||
-- we_Pron =
|
-- we_Pron =
|
||||||
-- youPl_Pron =
|
youPl_Pron = mkPron "너희" ;
|
||||||
-- they_Pron =
|
-- they_Pron =
|
||||||
|
|
||||||
--lin whatPl_IP = ;
|
--lin whatPl_IP = ;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--# -path=.:../abstract:../common:../prelude
|
--# -path=.:../abstract:../common:../prelude
|
||||||
|
|
||||||
concrete SymbolKor of Symbol = CatKor **
|
concrete SymbolKor of Symbol = CatKor **
|
||||||
open Prelude, ParadigmsKor, ResKor, (NS=NounKor) in {
|
open Prelude, ResKor, (NK=NounKor), (VK=VerbKor) in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
@@ -15,28 +15,40 @@ lin
|
|||||||
FloatPN i = mkPN i.s ;
|
FloatPN i = mkPN i.s ;
|
||||||
|
|
||||||
-- : Card -> PN ; -- twelve [as proper name]
|
-- : Card -> PN ; -- twelve [as proper name]
|
||||||
NumPN i = mkPN i.s ;
|
NumPN i = mkPN (i.s ! NK ! Indep) ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
mkPN : Str -> NounPhrase = \s -> {
|
||||||
|
s = \\_ => s ;
|
||||||
|
p = Consonant ; -- ??
|
||||||
|
} ;
|
||||||
|
|
||||||
{-
|
|
||||||
lin
|
lin
|
||||||
-- CNIntNP cn i = {} ;
|
-- : CN -> Int -> NP
|
||||||
|
CNIntNP cn i = NK.MassNP (cn ** {
|
||||||
|
s = \\nf => cn.s ! nf ++ i.s}) ;
|
||||||
|
|
||||||
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||||
CNSymbNP det cn xs =
|
CNSymbNP det cn xs =
|
||||||
let cnSymb = cn ** { comp = cn.comp ++ xs.s }
|
let cnSymb : CN = cn ** {s = \\nf => cn.s ! nf ++ xs.s}
|
||||||
in NS.DetCN det cnSymb ;
|
in NK.DetCN det cnSymb ;
|
||||||
|
|
||||||
-- : CN -> Card -> NP ; -- level five ; level 5
|
-- : CN -> Card -> NP ; -- level five ; level 5
|
||||||
CNNumNP cn i = NS.MassNP (cn ** { comp = cn.comp ++ i.s }) ;
|
CNNumNP cn i = NK.MassNP (cn ** {
|
||||||
|
s = \\nf => cn.s ! nf ++ i.s ! cn.c.origin ! Indep}) ;
|
||||||
|
|
||||||
-- : Symb -> S ;
|
-- : Symb -> S ;
|
||||||
SymbS sy = {s = } ;
|
SymbS sy = {s = \\_ => sy.s} ;
|
||||||
|
|
||||||
-- : Symb -> Card ;
|
-- : Symb -> Card ;
|
||||||
SymbNum sy = { s = sy.s ; n = Pl } ;
|
SymbNum sy = baseNum ** {s = \\_,_ => sy.s} ;
|
||||||
|
|
||||||
-- : Symb -> Ord ;
|
-- : Symb -> Ord ;
|
||||||
SymbOrd sy = { s =} ;
|
SymbOrd sy =
|
||||||
-}
|
let comp : Comp = VK.CompAdv (lin Adv sy)
|
||||||
|
in {s = comp.s ; n=Pl} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ lin
|
|||||||
|
|
||||||
-- : AP -> Comp ;
|
-- : AP -> Comp ;
|
||||||
CompAP ap = emptyComp ** {
|
CompAP ap = emptyComp ** {
|
||||||
s = \\vf => ap.s ! APred vf
|
s = \\vf => ap.compar ++ ap.s ! vf
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : CN -> Comp ;
|
-- : CN -> Comp ;
|
||||||
|
|||||||
9
src/korean/unittest/adjective.gftest
Normal file
9
src/korean/unittest/adjective.gftest
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
-- Comparatives
|
||||||
|
|
||||||
|
-- LangEng: I am smaller than a cat
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComparA small_A (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))))) NoVoc
|
||||||
|
LangKor: 제가 고양이 &+ 보다 더 작아요
|
||||||
|
|
||||||
|
-- LangEng: I am a woman smaller than a cat
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompCN (AdjCN (ComparA small_A (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))) (UseN woman_N))))))) NoVoc
|
||||||
|
LangKor: 제가 고양이 &+ 보다 더 작은 여자 &+ 예요
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
|
||||||
LangEng: the cat is in the house
|
LangEng: the cat is in the house
|
||||||
LangKor: 고양이가 집 BIND 에서 있어요
|
LangKor: 고양이가 집 &+ 에서 있어요
|
||||||
|
|
||||||
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP behind_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP behind_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
|
||||||
LangEng: the cat is behind the house
|
LangEng: the cat is behind the house
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Lang: eat_V2
|
|||||||
LangKor: 먹어요
|
LangKor: 먹어요
|
||||||
|
|
||||||
Lang: UseComp (CompAP (PositA good_A))
|
Lang: UseComp (CompAP (PositA good_A))
|
||||||
LangKor: 좋어요
|
LangKor: 좋아요
|
||||||
|
|
||||||
-- Final ㅏ or ㅓ does not repeat itself
|
-- Final ㅏ or ㅓ does not repeat itself
|
||||||
Lang: go_V
|
Lang: go_V
|
||||||
|
|||||||
16
src/korean/unittest/relative.gftest
Normal file
16
src/korean/unittest/relative.gftest
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV laugh_V))))
|
||||||
|
LangEng: a cat that laughs
|
||||||
|
LangKor: 웃는 고양이
|
||||||
|
|
||||||
|
Lang: AdvNP (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))) now_Adv
|
||||||
|
LangEng: a cat that drinks milk now
|
||||||
|
LangKor: 지금 우유를 마시는 고양이
|
||||||
|
-- 지금 우유를 마시고 있는 고양이
|
||||||
|
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV laugh_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))))))))) NoVoc
|
||||||
|
LangEng: I like cats that laugh and that drink milk
|
||||||
|
LangKor: 저는 웃 &+ 고 우유를 마시는 고양이를 좋아해요
|
||||||
|
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a like_V2) (UsePron i_Pron)))))))))) NoVoc
|
||||||
|
LangEng: I like cats that like me
|
||||||
|
LangKor: 저는 저를 좋아하는 고양이가 좋아요
|
||||||
22
src/korean/unittest/subjcases.gftest
Normal file
22
src/korean/unittest/subjcases.gftest
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
-- Subject as subject case
|
||||||
|
|
||||||
|
-- LangEng: I see a cat
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc
|
||||||
|
LangKor: 제가 고양이를 봐요
|
||||||
|
|
||||||
|
-- Double subject case
|
||||||
|
-- LangEng: the cat is short
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAP (PositA short_A)))))) NoVoc
|
||||||
|
LangKor: 고양이가 키가 작아요
|
||||||
|
|
||||||
|
-- Topic as subject case
|
||||||
|
|
||||||
|
-- LangEng: I have a cat
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc
|
||||||
|
LangKor: 저는 고양이가 있어요
|
||||||
|
|
||||||
|
-- Topic + object
|
||||||
|
|
||||||
|
-- LangEng: I like cats
|
||||||
|
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (UseN cat_N)))))) NoVoc
|
||||||
|
LangKor: 저는 고양이를 좋아해요
|
||||||
Reference in New Issue
Block a user