mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
partial adjectives support
This commit is contained in:
@@ -31,6 +31,10 @@ concrete CatBul of Cat = CommonX ** open ResBul, Prelude in {
|
||||
|
||||
Comp = {s : Agr => Str} ;
|
||||
|
||||
-- Adjective
|
||||
|
||||
AP = {s : AForm => Str; isPre : Bool} ;
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {s : NForm => Str; g : DGender} ;
|
||||
@@ -57,6 +61,7 @@ concrete CatBul of Cat = CommonX ** open ResBul, Prelude in {
|
||||
V3 = Verb ** {c2, c3 : Str} ;
|
||||
|
||||
A = {s : AForm => Str} ;
|
||||
A2 = {s : AForm => Str ; c2 : Str} ;
|
||||
|
||||
N = {s : NForm => Str; g : DGender} ;
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
concrete GrammarBul of Grammar =
|
||||
NounBul,
|
||||
VerbBul,
|
||||
AdjectiveBul,
|
||||
NumeralBul,
|
||||
SentenceBul,
|
||||
QuestionBul,
|
||||
|
||||
@@ -44,7 +44,7 @@ lin
|
||||
long_A = mkA80 "äúëúă" ;
|
||||
lose_V2 = dirV2 (mkV173 "ăóá˙") ;
|
||||
love_V2 = dirV2 (mkV186 "îáč÷ŕě") ;
|
||||
-- married_A2 = mkA2 (mkA76 "ćĺíĺí") toP ;
|
||||
married_A2 = mkA2 (mkA76 "ćĺíĺí") zaP ;
|
||||
narrow_A = mkA84 "ňĺńĺí" ;
|
||||
new_A = mkA76 "íîâ" ;
|
||||
old_A = mkA76 "ńňŕđ" ;
|
||||
|
||||
@@ -64,4 +64,9 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in {
|
||||
} ;
|
||||
|
||||
UseN noun = noun ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\nf => preOrPost ap.isPre (ap.s ! nform2aform nf cn.g) (cn.s ! (indefNForm nf)) ;
|
||||
g = cn.g
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ resource ParadigmsBul = VerbParadigmsBul, AdjParadigmsBul ** open
|
||||
in {
|
||||
|
||||
oper
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
@@ -49,6 +55,8 @@ oper
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ;
|
||||
|
||||
mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
|
||||
|
||||
@@ -139,6 +139,22 @@ resource ResBul = ParamX ** open Prelude in {
|
||||
<DNeut,Def> => DNeutDef
|
||||
} ;
|
||||
|
||||
nform2aform : NForm -> DGender -> AForm
|
||||
= \nf,g -> case nf of {
|
||||
NF n spec => aform (gennum g n) spec Acc ;
|
||||
NFSgDefNom => aform (gennum g Sg) Def Nom ;
|
||||
NFPlCount => APl Indef ;
|
||||
NFVocative => aform (gennum g Sg) Indef Acc
|
||||
} ;
|
||||
|
||||
indefNForm : NForm -> NForm
|
||||
= \nf -> case nf of {
|
||||
NF n spec => NF n Indef ;
|
||||
NFSgDefNom => NF Sg Indef ;
|
||||
NFPlCount => NFPlCount ;
|
||||
NFVocative => NFVocative
|
||||
} ;
|
||||
|
||||
oper
|
||||
-- For $Verb$.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user