mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Est) more API-friendly overloads for mkPrep
This commit is contained in:
@@ -32,7 +32,7 @@ lin
|
|||||||
n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ;
|
n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (mkPrep partitive))) (lin NP np) ;
|
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (casePrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (casePrep partitive))) (lin NP np) ;
|
||||||
|
|
||||||
|
|
||||||
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
|
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ oper
|
|||||||
postGenPrep : Str -> Prep ; -- genitive postposition, e.g. "taga"
|
postGenPrep : Str -> Prep ; -- genitive postposition, e.g. "taga"
|
||||||
casePrep : Case -> Prep ; -- just case, e.g. adessive
|
casePrep : Case -> Prep ; -- just case, e.g. adessive
|
||||||
|
|
||||||
|
mkPrep : overload {
|
||||||
|
mkPrep : Str -> Prep ; -- API-friendly version of postGenPrep—many applications assume there is a `mkX : Str -> X' available for any X
|
||||||
|
mkPrep : Case -> Prep ; -- API-friendly version of casePrep
|
||||||
|
mkPrep : Case -> Str -> Prep ; -- API-friendly version of postPrep
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Conjunctions, adverbs
|
--2 Conjunctions, adverbs
|
||||||
|
|
||||||
@@ -311,19 +317,25 @@ oper
|
|||||||
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
|
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
|
||||||
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infMine = InfMine ;
|
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ; infMine = InfMine ;
|
||||||
|
|
||||||
mkPrep : (isPre : Bool) -> Case -> Str -> Prep = \isPre,c,p -> lin Prep {
|
mkAdposition : (isPre : Bool) -> Case -> Str -> Prep = \isPre,c,p -> lin Prep {
|
||||||
c = casep2npformp c ;
|
c = casep2npformp c ;
|
||||||
s = p ;
|
s = p ;
|
||||||
isPre = isPre
|
isPre = isPre
|
||||||
} ;
|
} ;
|
||||||
prePrep : Case -> Str -> Prep = mkPrep True ;
|
prePrep : Case -> Str -> Prep = mkAdposition True ;
|
||||||
postPrep : Case -> Str -> Prep = mkPrep False ;
|
postPrep : Case -> Str -> Prep = mkAdposition False ;
|
||||||
postGenPrep : Str -> Prep = postPrep genitive ;
|
postGenPrep : Str -> Prep = postPrep genitive ;
|
||||||
|
mkPrep = overload {
|
||||||
|
mkPrep : Str -> Prep = postGenPrep ;
|
||||||
|
mkPrep : Case -> Prep = casePrep ;
|
||||||
|
mkPrep : Case -> Str -> Prep = postPrep ;
|
||||||
|
mkPrep : (isPre : Bool) -> Case -> Str -> Prep = mkAdposition
|
||||||
|
} ;
|
||||||
|
|
||||||
-- The Prep's isPre field is used in a special (hacky) way in mkN3 and mkN2.
|
-- The Prep's isPre field is used in a special (hacky) way in mkN3 and mkN2.
|
||||||
-- Used to be able to match whether the Prep's case is Gen, but now several
|
-- Used to be able to match whether the Prep's case is Gen, but now several
|
||||||
-- Preps use the genitive stem, so we need to check if it's actually genitive.
|
-- Preps use the genitive stem, so we need to check if it's actually genitive.
|
||||||
casePrep : Case -> Prep = \c -> mkPrep (isActuallyGenitive c) c [] ;
|
casePrep : Case -> Prep = \c -> mkAdposition (isActuallyGenitive c) c [] ;
|
||||||
|
|
||||||
-- NPAcc is different, it's not formed from a Case(Plus)
|
-- NPAcc is different, it's not formed from a Case(Plus)
|
||||||
accPrep : Prep = lin Prep {
|
accPrep : Prep = lin Prep {
|
||||||
|
|||||||
Reference in New Issue
Block a user