(Est) more API-friendly overloads for mkPrep

This commit is contained in:
Inari Listenmaa
2022-06-29 14:35:23 +02:00
parent 4fec15272c
commit e4a195a777
2 changed files with 17 additions and 5 deletions

View File

@@ -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) ;
{-
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)) ;

View File

@@ -83,6 +83,12 @@ oper
postGenPrep : Str -> Prep ; -- genitive postposition, e.g. "taga"
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
@@ -311,19 +317,25 @@ oper
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
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 ;
s = p ;
isPre = isPre
} ;
prePrep : Case -> Str -> Prep = mkPrep True ;
postPrep : Case -> Str -> Prep = mkPrep False ;
prePrep : Case -> Str -> Prep = mkAdposition True ;
postPrep : Case -> Str -> Prep = mkAdposition False ;
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.
-- 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.
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)
accPrep : Prep = lin Prep {