Hi,
Export Preps in ParadigmsX
accusative | Prep | direct object |
genitive | Prep | preposition "de" and its contractions |
dative | Prep | preposition "a" and its contractions |
Any other preposition in Spanish either doesn't merge with article (sobre el …) or is a compound preposition using one of the merging prepositions (antes del …).
Export Cases and casePrep : Case -> Prep in ParadigmsX
casePrep | Case -> Prep | just case, e.g. adessive |
and all cases exported in Paradigms, so that you can write this to get a NP inflected in ablative:
mkAdv (casePrep ablative) (mkNP (mkN "talo"))
Create your own casePrep
Many languages don't have these functions in their Paradigms module, so if you want to use them, you need to write them yourself (or create an issue and ask someone else to do it). If you want to do it like it's done for Finnish, you need two things:
How to start doing this for some language X? The most important clues are CatX, to see the lincat of Prep, and AdverbX, to see the implementation of PrepNP. For instance, in the
Scandinavian functor, we actually have this hardcoded situation:
PrepNP prep np = {s = prep.s ++ np.s ! accusative} ;
The preposition doesn't affect which case is chosen, it's always accusative. Changing that behaviour would be a bigger change in the Scandinavian functor, and that's not something many people would be willing to do. So for Swedish, the solution with the least hassle is to add an UttGenNP to Extend.
Let's take another language, say Hungarian. Hungarian actually has already
casePrep, but let's imagine for a moment it doesn't have it yet.
This is the lincat for Prep (defined as Adposition in ResHun):
pr : Str ; -- Preposition
s : Str ; -- Postposition
And this is how PrepNP is implemented (using the oper applyAdp from ResHun, simplified):
applyAdp : Adposition -> NounPhrase -> Str = \adp,np ->
adp.pr ++ np.s ! adp.c ++ adp.s ;
The crucial information here is
np.s ! adp.c --- the case inherent in the Prep is used to choose the form from the NP. So now, all you need to do to create your casePrep for, say, superessive, is to produce a record that is
{s = [] ; pr = [] ; c = Sup}. Preposition and postposition fields contain just an empty string, and the c field contains the case parameter
Sup. I haven't exported the Hungarian cases in ParadigmsHun (because I'm lazy), so you need to either export them yourself following the example for Finnish, or use the
raw internal parameters. If you don't export the cases in ParadigmsHun, then this is what the application grammar code would look like:
concrete MyGrammarHun of MyGrammar = … ** open (R=ResHun), SyntaxHun, ParadigmsHun in {
…
myAblativeAdv = mkAdv (casePrep R.Abl) (mkNP (mkN "ház")) ;
…
}
And if you do, then it's the same except you can skip opening (R=ResHun) and write mkAdv (casePrep ablative) (mkNP (mkN "ház")) instead.
If you find that you don't need cases for anything other than preps, you can skip the casePrep : Case -> Prep step and just export the cases as Preps, like in the Spanish grammar. You just need to do this in ParadigmsX:
nominative : Prep ; -- e.g. "house"
genitive : Prep ; -- e.g. "house's"
And define them like this
nominative = lin Prep {c = NPCase Nom ; s = <[],[],\\_ => []>} ; -- or whatever internals the Prep of your language has
(or rather using an internal casePrep oper, instead of repeating the non-variable part in the 14 times. :-P)