mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Finnish and res doc
This commit is contained in:
@@ -26,6 +26,9 @@ gfdoc:
|
|||||||
gfdoc ../norwegian/VerbsNor.gf ; mv ../norwegian/VerbsNor.html .
|
gfdoc ../norwegian/VerbsNor.gf ; mv ../norwegian/VerbsNor.html .
|
||||||
gfdoc ../norwegian/BasicNor.gf ; mv ../norwegian/BasicNor.html .
|
gfdoc ../norwegian/BasicNor.gf ; mv ../norwegian/BasicNor.html .
|
||||||
|
|
||||||
|
gfdoc ../finnish/ParadigmsFin.gf ; mv ../finnish/ParadigmsFin.html .
|
||||||
|
gfdoc ../finnish/BasicFin.gf ; mv ../finnish/BasicFin.html .
|
||||||
|
|
||||||
gfdoc ../italian/ParadigmsIta.gf ; mv ../italian/ParadigmsIta.html .
|
gfdoc ../italian/ParadigmsIta.gf ; mv ../italian/ParadigmsIta.html .
|
||||||
gfdoc ../italian/BasicIta.gf ; mv ../italian/BasicIta.html .
|
gfdoc ../italian/BasicIta.gf ; mv ../italian/BasicIta.html .
|
||||||
gfdoc ../italian/BeschIta.gf ; mv ../italian/BeschIta.html .
|
gfdoc ../italian/BeschIta.gf ; mv ../italian/BeschIta.html .
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
Third Version, 22 May 2005
|
Third Version, 22 May 2005. Completed 1 July.
|
||||||
<br>
|
<br>
|
||||||
Second Version, 1 March 2005
|
Second Version, 1 March 2005
|
||||||
<br>
|
<br>
|
||||||
@@ -467,6 +467,12 @@ Alternative views on sentence formation:
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
<a href="ParadigmsFin.html">Finnish paradigms</a>
|
||||||
|
<br>
|
||||||
|
<a href="BasicFin.html">example use of Finnish oaradigms</a>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
|
||||||
<a href="ParadigmsFre.html">French paradigms</a>
|
<a href="ParadigmsFre.html">French paradigms</a>
|
||||||
<br>
|
<br>
|
||||||
<a href="BasicFre.html">example use of French paradigms</a>
|
<a href="BasicFre.html">example use of French paradigms</a>
|
||||||
@@ -847,7 +853,8 @@ English:
|
|||||||
<p>
|
<p>
|
||||||
Finnish:
|
Finnish:
|
||||||
missing many nominal forms of verbs;
|
missing many nominal forms of verbs;
|
||||||
the basic lexicon has some erroneous inflectional patterns;
|
compiling the heuristic paradigms is slow;
|
||||||
|
the basic lexicon has some erroneous inflectional forms;
|
||||||
possessive and interrogative suffixes have no proper lexer.
|
possessive and interrogative suffixes have no proper lexer.
|
||||||
<p>
|
<p>
|
||||||
French:
|
French:
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ lincat
|
|||||||
V = Verb1 ;
|
V = Verb1 ;
|
||||||
-- = {s : VForm => Str}
|
-- = {s : VForm => Str}
|
||||||
---- VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
---- VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||||
VPI = {s : VIForm => Str} ;
|
VPI = {s : Bool => VIForm => Str ; sc : Case} ;
|
||||||
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
||||||
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
||||||
V2 = TransVerb ;
|
V2 = TransVerb ;
|
||||||
|
|||||||
@@ -51,23 +51,22 @@ concrete ClauseFin of Clause = CategoriesFin **
|
|||||||
sats2clause (
|
sats2clause (
|
||||||
insertComplement
|
insertComplement
|
||||||
(mkSats subj verb)
|
(mkSats subj verb)
|
||||||
(vp.s ! VIInfinit)
|
(vp.s ! True ! VIInfinit Simul)
|
||||||
) ;
|
) ;
|
||||||
SPredObjV2V subj verb obj vp =
|
SPredObjV2V subj verb obj vp =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertComplement
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(vp.s ! VIInfinit)
|
(vp.s ! True ! VIInfinit Simul)
|
||||||
) ;
|
) ;
|
||||||
SPredSubjV2V subj verb obj vp =
|
SPredSubjV2V subj verb obj vp =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertComplement
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(vp.s ! VIInfinit)
|
(vp.s ! True ! VIInfinit Simul)
|
||||||
) ;
|
) ;
|
||||||
{-
|
|
||||||
SPredProgVP np vp = sats2clause (progressiveSats np vp) ;
|
SPredProgVP np vp = sats2clause (progressiveSats np vp) ;
|
||||||
-}
|
|
||||||
|
|
||||||
SPredAP subj adj =
|
SPredAP subj adj =
|
||||||
sats2clause (mkSatsCopula subj (complAdjPhrase subj.n adj)) ;
|
sats2clause (mkSatsCopula subj (complAdjPhrase subj.n adj)) ;
|
||||||
@@ -154,7 +153,7 @@ concrete ClauseFin of Clause = CategoriesFin **
|
|||||||
sats2quest (mkSatsCopula (intNounPhrase subj) adv.s) ;
|
sats2quest (mkSatsCopula (intNounPhrase subj) adv.s) ;
|
||||||
|
|
||||||
QPredProgVP np vp = sats2quest (progressiveSats (intNounPhrase np) vp) ;
|
QPredProgVP np vp = sats2quest (progressiveSats (intNounPhrase np) vp) ;
|
||||||
|
-}
|
||||||
|
|
||||||
----- gender and number of Adj
|
----- gender and number of Adj
|
||||||
|
|
||||||
@@ -163,11 +162,14 @@ concrete ClauseFin of Clause = CategoriesFin **
|
|||||||
IPredV2 a v y =
|
IPredV2 a v y =
|
||||||
sats2verbPhrase a (mkSatsObject pronImpers v y) ;
|
sats2verbPhrase a (mkSatsObject pronImpers v y) ;
|
||||||
IPredAP a adj =
|
IPredAP a adj =
|
||||||
sats2verbPhrase a (mkSatsCopula pronImpers (adj.s ! AF Masc Sg)) ;
|
sats2verbPhrase a (mkSatsCopula pronImpers (complAdjPhrase Sg adj)) ; ---
|
||||||
IPredPassV a v =
|
|
||||||
sats2verbPhrase a (mkSatsCopula pronImpers (v.s ! VPart (pgen2gen pronImpers.g) pronImpers.n)) ;
|
|
||||||
IPredV3 a verb obj1 obj2 =
|
IPredV3 a verb obj1 obj2 =
|
||||||
sats2verbPhrase a (insertObject (mkSatsObject pronImpers verb obj1) verb.c3 verb.s3 obj2) ;
|
sats2verbPhrase a (insertObject (mkSatsObject pronImpers verb obj1) verb.c2 verb.s5 verb.p obj2) ;
|
||||||
|
|
||||||
|
{-
|
||||||
|
IPredPassV a v =
|
||||||
|
sats2verbPhrase a (mkSatsCopula pronImpers (v.s ! VPart (pgen2gen
|
||||||
|
pronImpers.g) pronImpers.n)) ;
|
||||||
IPredReflV2 a verb =
|
IPredReflV2 a verb =
|
||||||
sats2verbPhrase a (
|
sats2verbPhrase a (
|
||||||
mkSatsObject pronImpers
|
mkSatsObject pronImpers
|
||||||
|
|||||||
@@ -9,9 +9,10 @@
|
|||||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||||
--
|
--
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
-- accessed through the resource syntax API, $Structural$.
|
||||||
--
|
--
|
||||||
-- The main difference with $MorphoFin.gf$ is that the types
|
-- The low-level definitions of inflectional patterns are in
|
||||||
|
-- $MorphoFin$. The main difference with that module is that here the types
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
-- had the design principle of always having existing forms, not
|
-- had the design principle of always having existing forms, not
|
||||||
-- stems, as string arguments of the paradigms, not stems.
|
-- stems, as string arguments of the paradigms, not stems.
|
||||||
@@ -26,7 +27,9 @@ resource ParadigmsFin =
|
|||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
-- To abstract over gender, number, and (some) case names,
|
-- To abstract over gender, number, and (some) case names,
|
||||||
-- we define the following identifiers.
|
-- we define the following identifiers. The application programmer
|
||||||
|
-- should always use these constants instead of their definitions
|
||||||
|
-- in $TypesInf$.
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Gender : Type;
|
Gender : Type;
|
||||||
@@ -39,44 +42,65 @@ oper
|
|||||||
singular : Number ;
|
singular : Number ;
|
||||||
plural : Number ;
|
plural : Number ;
|
||||||
|
|
||||||
Case : Type ;
|
Case : Type ;
|
||||||
nominative : Case ;
|
nominative : Case ;
|
||||||
genitive : Case ;
|
genitive : Case ;
|
||||||
partitive : Case ;
|
partitive : Case ;
|
||||||
translative : Case ;
|
translative : Case ;
|
||||||
inessive : Case ;
|
inessive : Case ;
|
||||||
elative : Case ;
|
elative : Case ;
|
||||||
illative : Case ;
|
illative : Case ;
|
||||||
adessive : Case ;
|
adessive : Case ;
|
||||||
ablative : Case ;
|
ablative : Case ;
|
||||||
allative : Case ;
|
allative : Case ;
|
||||||
|
|
||||||
|
-- The following type is used for defining *rection*, i.e. complements
|
||||||
|
-- of many-place verbs and adjective. A complement can be defined by
|
||||||
|
-- just a case, or a pre/postposition and a case.
|
||||||
|
|
||||||
PPosition : Type ;
|
PPosition : Type ;
|
||||||
prepP : Case -> Str -> PPosition ;
|
|
||||||
postpP : Case -> Str -> PPosition ;
|
prepP : Case -> Str -> PPosition ;
|
||||||
caseP : Case -> PPosition ;
|
postpP : Case -> Str -> PPosition ;
|
||||||
|
caseP : Case -> PPosition ;
|
||||||
accusative : PPosition ;
|
accusative : PPosition ;
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
-- Worst case: give ten forms and the semantic gender.
|
-- The worst case gives ten forms and the semantic gender.
|
||||||
-- In practice just a couple of forms are needed, to define the different
|
-- In practice just a couple of forms are needed, to define the different
|
||||||
-- stems, vowel alternation, and vowel harmony.
|
-- stems, vowel alternation, and vowel harmony.
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkN :
|
mkN : (talo, talon, talona, taloa, taloon,
|
||||||
(talo,talon,talona,taloa,taloon,taloina,taloissa,talojen,taloja,taloihin
|
taloina,taloissa,talojen,taloja,taloihin : Str) -> Gender -> N ;
|
||||||
: Str) -> Gender -> N ;
|
|
||||||
|
|
||||||
-- The regular noun heuristic takes just one form and analyses its suffixes.
|
-- The regular noun heuristic takes just one form (singular
|
||||||
|
-- nominative) and analyses it to pick the correct paradigm.
|
||||||
|
-- It does automatic grade alternation, and is hence not usable
|
||||||
|
-- for words like "auto" (whose genitive would become "audon").
|
||||||
|
|
||||||
regN : (talo : Str) -> N ;
|
regN : (talo : Str) -> N ;
|
||||||
|
|
||||||
-- The almost-regular heuristics analyse two or three forms.
|
-- If $regN$ does not give the correct result, one can try and give
|
||||||
|
-- two or three forms as follows. Examples of the use of these
|
||||||
|
-- functions are given in $BasicFin$. Most notably, $reg2N$ is used
|
||||||
|
-- for nouns like "kivi - kiviä", which would otherwise become like
|
||||||
|
-- "rivi - rivejä". $regN3$ is used e.g. for
|
||||||
|
-- "sydän - sydämen - sydämiä", which would otherwise become
|
||||||
|
-- "sydän - sytämen".
|
||||||
|
|
||||||
reg2N : (savi,savia : Str) -> N ;
|
reg2N : (savi,savia : Str) -> N ;
|
||||||
reg3N : (vesi,veden,vesiä : Str) -> N ;
|
reg3N : (vesi,veden,vesiä : Str) -> N ;
|
||||||
|
|
||||||
|
-- Some nouns have an unexpected singular partitive, e.g. "meri", "lumi".
|
||||||
|
|
||||||
|
sgpartN : (meri : N) -> (merta : Str) -> N ;
|
||||||
|
nMeri : (meri : Str) -> N ;
|
||||||
|
|
||||||
|
-- The rest of the noun paradigms are mostly covered by the three
|
||||||
|
-- heuristics.
|
||||||
|
--
|
||||||
-- Nouns with partitive "a"/"ä" are a large group.
|
-- Nouns with partitive "a"/"ä" are a large group.
|
||||||
-- To determine for grade and vowel alternation, three forms are usually needed:
|
-- To determine for grade and vowel alternation, three forms are usually needed:
|
||||||
-- singular nominative and genitive, and plural partitive.
|
-- singular nominative and genitive, and plural partitive.
|
||||||
@@ -163,11 +187,6 @@ oper
|
|||||||
|
|
||||||
nNauris : (naurista : Str) -> N ;
|
nNauris : (naurista : Str) -> N ;
|
||||||
|
|
||||||
-- Some nouns have an unexpected singular partitive, e.g. "meri", "juuri".
|
|
||||||
|
|
||||||
sgpartN : N -> Str -> N ;
|
|
||||||
nMeri : Str -> N ;
|
|
||||||
|
|
||||||
-- Separately-written compound nouns, like "sambal oelek", "Urho Kekkonen",
|
-- Separately-written compound nouns, like "sambal oelek", "Urho Kekkonen",
|
||||||
-- have only their last part inflected.
|
-- have only their last part inflected.
|
||||||
|
|
||||||
@@ -203,23 +222,29 @@ oper
|
|||||||
|
|
||||||
mkADeg : (kiva : N) -> (kivempaa,kivinta : Str) -> ADeg ;
|
mkADeg : (kiva : N) -> (kivempaa,kivinta : Str) -> ADeg ;
|
||||||
|
|
||||||
-- Without $optimize=noexpand$, this function would expands to enormous size.
|
-- The regular adjectives are based on $regN$ in the positive.
|
||||||
|
|
||||||
|
regADeg : (punainen : Str) -> ADeg ;
|
||||||
|
|
||||||
regADeg : (suuri : Str) -> ADeg ;
|
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
-- The fragment only has present tense so far, but in all persons.
|
-- The grammar does not cover the potential mood and some nominal
|
||||||
|
-- forms. One way to see the coverage is to linearize a verb to
|
||||||
|
-- a table.
|
||||||
-- The worst case needs twelve forms, as shown in the following.
|
-- The worst case needs twelve forms, as shown in the following.
|
||||||
|
|
||||||
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,
|
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,
|
||||||
tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
|
||||||
|
|
||||||
|
-- The following heuristics cover more and more verbs.
|
||||||
|
|
||||||
regV : (soutaa : Str) -> V ;
|
regV : (soutaa : Str) -> V ;
|
||||||
reg2V : (soutaa,souti : Str) -> V ;
|
reg2V : (soutaa,souti : Str) -> V ;
|
||||||
reg3V : (soutaa,soudan,souti : Str) -> V ;
|
reg3V : (soutaa,soudan,souti : Str) -> V ;
|
||||||
|
|
||||||
-- A simple special case is the one with just one stem and no grade alternation.
|
-- The rest of the paradigms are special cases mostly covered by the heuristics.
|
||||||
-- It covers e.g. "sanoa", "valua", "kysyä".
|
-- A simple special case is the one with just one stem and without grade alternation.
|
||||||
|
|
||||||
vValua : (valua : Str) -> V ;
|
vValua : (valua : Str) -> V ;
|
||||||
|
|
||||||
@@ -253,19 +278,20 @@ oper
|
|||||||
vEi : V ;
|
vEi : V ;
|
||||||
|
|
||||||
-- Two-place verbs need a case, and can have a pre- or postposition.
|
-- Two-place verbs need a case, and can have a pre- or postposition.
|
||||||
-- At least one of the latter is empty, $[]$.
|
|
||||||
|
|
||||||
mkV2 : V -> PPosition -> V2 ;
|
mkV2 : V -> PPosition -> V2 ;
|
||||||
|
|
||||||
-- If both are empty, the following special function can be used.
|
-- If the complement needs just a case, the following special function can be used.
|
||||||
|
|
||||||
caseV2 : V -> Case -> V2 ;
|
caseV2 : V -> Case -> V2 ;
|
||||||
|
|
||||||
-- Verbs with a direct (accusative) object
|
-- Verbs with a direct (accusative) object
|
||||||
-- are special, since their complement case is finally decided in syntax.
|
-- are special, since their complement case is finally decided in syntax.
|
||||||
|
-- But this is taken care of by $ClauseFin$.
|
||||||
|
|
||||||
dirV2 : V -> V2 ;
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
|
|
||||||
--3 Three-place verbs
|
--3 Three-place verbs
|
||||||
--
|
--
|
||||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||||
@@ -275,6 +301,7 @@ oper
|
|||||||
dirV3 : V -> Case -> V3 ; -- give,_,to
|
dirV3 : V -> Case -> V3 ; -- give,_,to
|
||||||
dirdirV3 : V -> V3 ; -- acc, allat
|
dirdirV3 : V -> V3 ; -- acc, allat
|
||||||
|
|
||||||
|
|
||||||
--3 Other complement patterns
|
--3 Other complement patterns
|
||||||
--
|
--
|
||||||
-- Verbs and adjectives can take complements such as sentences,
|
-- Verbs and adjectives can take complements such as sentences,
|
||||||
@@ -295,7 +322,6 @@ oper
|
|||||||
mkAV : A -> AV ;
|
mkAV : A -> AV ;
|
||||||
mkA2V : A2 -> A2V ;
|
mkA2V : A2 -> A2V ;
|
||||||
|
|
||||||
|
|
||||||
-- 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.
|
||||||
--.
|
--.
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ lin
|
|||||||
UseA = adj2adjPhrase ;
|
UseA = adj2adjPhrase ;
|
||||||
ComplA2 = complAdj ;
|
ComplA2 = complAdj ;
|
||||||
|
|
||||||
ComplAV av vpi = {s = \\_,a => av.s ! a ++ vpi.s ! VIInfinit} ;
|
---- ComplAV av vpi = {s = \\_,a => av.s ! a ++ vpi.s ! VIInfinit} ;
|
||||||
ComplObjA2V av obj vpi = {s = \\_,a => av.s ! a ++ obj.s ! complCase
|
---- ComplObjA2V av obj vpi = {s = \\_,a => av.s ! a ++ obj.s ! complCase
|
||||||
True av.c VImperat ++ vpi.s ! VIInfinit} ;
|
---- True av.c (SVI VIInf3Iness) ++ vpi.s ! VIInfinit} ;
|
||||||
|
|
||||||
PositADeg = positAdjPhrase ;
|
PositADeg = positAdjPhrase ;
|
||||||
ComparADeg = comparAdjPhrase ;
|
ComparADeg = comparAdjPhrase ;
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ oper
|
|||||||
{s = \\f => jussi.s ! npForm2Case Sg f ; n = Sg ; p = NP3} ;
|
{s = \\f => jussi.s ! npForm2Case Sg f ; n = Sg ; p = NP3} ;
|
||||||
|
|
||||||
impersNounPhrase : NounPhrase = nameNounPhrase {s = \\_ => []} ;
|
impersNounPhrase : NounPhrase = nameNounPhrase {s = \\_ => []} ;
|
||||||
|
pronImpers = impersNounPhrase ;
|
||||||
|
|
||||||
singularNounPhrase : CommNounPhrase -> NounPhrase = \cn ->
|
singularNounPhrase : CommNounPhrase -> NounPhrase = \cn ->
|
||||||
{s = \\f => cn.s ! False ! Sg ! (npForm2Case Sg f) ; n = Sg ; p = NP3} ;
|
{s = \\f => cn.s ! False ! Sg ! (npForm2Case Sg f) ; n = Sg ; p = NP3} ;
|
||||||
@@ -375,7 +376,7 @@ oper
|
|||||||
complAdj : AdjCompl -> NounPhrase -> AdjPhrase = \hyva,paini ->
|
complAdj : AdjCompl -> NounPhrase -> AdjPhrase = \hyva,paini ->
|
||||||
let
|
let
|
||||||
hyvat : AForm => Str = \\a => hyva.s ! a ;
|
hyvat : AForm => Str = \\a => hyva.s ! a ;
|
||||||
c : NPForm = complCase True hyva.c VImperat ;
|
c : NPForm = complCase True hyva.c (SVI VIInf3Iness) ;
|
||||||
painissa : Str = paini.s ! c
|
painissa : Str = paini.s ! c
|
||||||
in
|
in
|
||||||
{s = table {
|
{s = table {
|
||||||
@@ -493,35 +494,36 @@ oper
|
|||||||
Tense = Present | Past | Future | Conditional ;
|
Tense = Present | Past | Future | Conditional ;
|
||||||
Anteriority = Simul | Anter ;
|
Anteriority = Simul | Anter ;
|
||||||
|
|
||||||
SForm =
|
SForm = VFinite SType Tense Anteriority ;
|
||||||
VFinite SType Tense Anteriority
|
|
||||||
| VInfinit Anteriority
|
|
||||||
| VImperat
|
|
||||||
;
|
|
||||||
|
|
||||||
SType = SDecl | SQuest ;
|
SType = SDecl | SQuest ;
|
||||||
|
|
||||||
VIForm =
|
VIForm =
|
||||||
VIInfinit
|
VIInfinit Anteriority
|
||||||
| VIImperat Bool Number
|
| VIImperat Number
|
||||||
| VIInf3Iness
|
| VIInf3Iness
|
||||||
| VIInf3Elat
|
| VIInf3Elat
|
||||||
| VIInf3Illat
|
| VIInf3Illat
|
||||||
| VIInf3Adess
|
| VIInf3Adess
|
||||||
| VIInf3Abess ;
|
| VIInf3Abess ;
|
||||||
|
|
||||||
|
-- This is an auxiliary.
|
||||||
|
|
||||||
|
SVIForm = SCl SForm | SVI VIForm ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Clause : Type = {s : Bool => SForm => Str} ;
|
Clause : Type = {s : Bool => SForm => Str} ;
|
||||||
VerbPhraseInf : Type = {s : VIForm => Str} ;
|
VerbPhraseInf : Type = {s : Bool => VIForm => Str ; sc : Case} ;
|
||||||
|
|
||||||
Sats : Type = {
|
Sats : Type = {
|
||||||
subj : Str ;
|
subj : Str ;
|
||||||
pred : Bool => SForm => {
|
pred : Bool => SForm => {
|
||||||
fin : Str ;
|
fin : Str ;
|
||||||
inf : Str ;
|
inf : Str
|
||||||
obj : Str -- object case depends on both
|
|
||||||
} ;
|
} ;
|
||||||
comp : Str
|
obj : Bool => SVIForm => Str ;
|
||||||
|
comp : Str ;
|
||||||
|
vpi : VerbPhraseInf
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
sats2clause : Sats -> Clause = \sats ->
|
sats2clause : Sats -> Clause = \sats ->
|
||||||
@@ -531,7 +533,7 @@ oper
|
|||||||
pred = sats.pred ! b ! sf ;
|
pred = sats.pred ! b ! sf ;
|
||||||
fin = pred.fin ;
|
fin = pred.fin ;
|
||||||
inf = pred.inf ;
|
inf = pred.inf ;
|
||||||
obj = pred.obj ;
|
obj = sats.obj ! b ! (SCl sf) ;
|
||||||
comp = sats.comp
|
comp = sats.comp
|
||||||
in
|
in
|
||||||
case sf of {
|
case sf of {
|
||||||
@@ -540,19 +542,54 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
sats2verbPhrase : {s : Str ; a : Anteriority} -> Sats -> VerbPhraseInf = \a,sats ->
|
||||||
|
{s = \\b,vi =>
|
||||||
|
let
|
||||||
|
inf = sats.vpi.s ! b ! vi ;
|
||||||
|
obj = sats.obj ! b ! (SVI vi) ;
|
||||||
|
comp = sats.comp
|
||||||
|
in
|
||||||
|
a.s ++ inf ++ obj ++ comp ;
|
||||||
|
sc = sats.vpi.sc
|
||||||
|
} ;
|
||||||
|
|
||||||
questPart : Str -> Str = \s -> glueParticle s "ko" ; --- "kö"
|
questPart : Str -> Str = \s -> glueParticle s "ko" ; --- "kö"
|
||||||
|
|
||||||
mkSats : NounPhrase -> Verb1 -> Sats = \subj,verb ->
|
mkSats : NounPhrase -> Verb1 -> Sats = \subj,verb ->
|
||||||
let
|
let
|
||||||
np = case verb.sc of {
|
sc = verb.sc ;
|
||||||
|
np = case sc of {
|
||||||
Nom => <subj.n, np2Person subj.p> ;
|
Nom => <subj.n, np2Person subj.p> ;
|
||||||
_ => <Sg, P3>
|
_ => <Sg, P3>
|
||||||
}
|
} ;
|
||||||
|
vi = inflectVerb verb np.p1 np.p2
|
||||||
in
|
in
|
||||||
{subj = subj.s ! NPCase verb.sc ; -- "minusta tulee poliisi"
|
{subj = subj.s ! NPCase sc ; -- "minusta tulee poliisi"
|
||||||
pred = \\b,sf =>
|
pred = \\b,sf => vi b (SCl sf) ;
|
||||||
inflectVerb verb np.p1 np.p2 b sf ** {obj = []} ;
|
obj = \\_,_ => [] ;
|
||||||
comp = []
|
comp = [] ;
|
||||||
|
vpi = {
|
||||||
|
s = \\b,f => let vp = vi b (SVI f) in vp.fin ++ vp.inf ;
|
||||||
|
sc = sc
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
progressiveSats : NounPhrase -> VerbPhraseInf -> Sats = \subj,vp ->
|
||||||
|
let
|
||||||
|
np = case vp.sc of {
|
||||||
|
Nom => <subj.n, np2Person subj.p> ;
|
||||||
|
_ => <Sg, P3>
|
||||||
|
} ;
|
||||||
|
vi = inflectVerb verbOlla np.p1 np.p2
|
||||||
|
in
|
||||||
|
{subj = subj.s ! NPCase vp.sc ; -- "minusta on tulossa poliisi"
|
||||||
|
pred = \\b,sf => vi b (SCl sf) ;
|
||||||
|
obj = \\_,_ => [] ;
|
||||||
|
comp = vp.s ! True ! VIInf3Iness ;
|
||||||
|
vpi = {
|
||||||
|
s = \\b,f => let vv = vi b (SVI f) in vv.fin ++ vv.inf ;
|
||||||
|
sc = Nom
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkSatsObject : NounPhrase -> TransVerb -> NounPhrase -> Sats = \subj,verb,obj ->
|
mkSatsObject : NounPhrase -> TransVerb -> NounPhrase -> Sats = \subj,verb,obj ->
|
||||||
@@ -567,31 +604,34 @@ oper
|
|||||||
pred = \\b,sf =>
|
pred = \\b,sf =>
|
||||||
let spred = sats.pred ! b ! sf in
|
let spred = sats.pred ! b ! sf in
|
||||||
{fin = spred.fin ;
|
{fin = spred.fin ;
|
||||||
inf = spred.inf ;
|
inf = spred.inf
|
||||||
obj = spred.obj ++ pPosit prep pos (obj.s ! complCase b c sf)
|
|
||||||
} ;
|
} ;
|
||||||
comp = sats.comp
|
obj = \\b,f => sats.obj ! b ! f ++ pPosit prep pos (obj.s ! complCase b c f) ;
|
||||||
|
comp = sats.comp ;
|
||||||
|
vpi = sats.vpi
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertComplement : Sats -> Str -> Sats =
|
insertComplement : Sats -> Str -> Sats =
|
||||||
\sats, comp ->
|
\sats, comp ->
|
||||||
{subj = sats.subj ;
|
{subj = sats.subj ;
|
||||||
pred = sats.pred ;
|
pred = sats.pred ;
|
||||||
comp = sats.comp ++ comp
|
obj = sats.obj ;
|
||||||
|
comp = sats.comp ++ comp ;
|
||||||
|
vpi = sats.vpi
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
complCase : Bool -> ComplCase -> SForm -> NPForm = \b,c,v -> case c of {
|
complCase : Bool -> ComplCase -> SVIForm -> NPForm = \b,c,v -> case c of {
|
||||||
CCase k => NPCase k ;
|
CCase k => NPCase k ;
|
||||||
CAcc => case b of {
|
CAcc => case b of {
|
||||||
True => case v of {
|
True => case v of {
|
||||||
VFinite _ _ _ => NPAccGen ;
|
SCl _ => NPAccGen ;
|
||||||
_ => NPAccNom
|
_ => NPAccNom
|
||||||
} ;
|
} ;
|
||||||
_ => NPCase Part
|
_ => NPCase Part
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
inflectVerb : Verb -> Number -> Person -> Bool -> SForm -> {fin, inf : Str} =
|
inflectVerb : Verb -> Number -> Person -> Bool -> SVIForm -> {fin, inf : Str} =
|
||||||
\verb,n,p,b,sf ->
|
\verb,n,p,b,sf ->
|
||||||
let
|
let
|
||||||
vs = verb.s ;
|
vs = verb.s ;
|
||||||
@@ -608,13 +648,6 @@ oper
|
|||||||
<False,Simul> => {fin = eis ! vf ; inf = vs ! neg} ;
|
<False,Simul> => {fin = eis ! vf ; inf = vs ! neg} ;
|
||||||
<False,Anter> => {fin = eis ! vf ; inf = olla ! neg ++ vs ! part}
|
<False,Anter> => {fin = eis ! vf ; inf = olla ! neg ++ vs ! part}
|
||||||
} ;
|
} ;
|
||||||
inf : Anteriority -> {fin,inf : Str} =
|
|
||||||
\a -> case <b,a> of {
|
|
||||||
<True, Simul> => {fin = vs ! Inf ; inf = []} ;
|
|
||||||
<True, Anter> => {fin = olla ! Inf ; inf = vs ! part} ;
|
|
||||||
<False,Simul> => {fin = olla ! Inf ; inf = abess} ;
|
|
||||||
<False,Anter> => {fin = olla ! Inf ; inf = olla ! part ++ abess}
|
|
||||||
} ;
|
|
||||||
fut : Anteriority -> VForm -> VForm -> {fin,inf : Str} =
|
fut : Anteriority -> VForm -> VForm -> {fin,inf : Str} =
|
||||||
\a,vf,neg -> case <b,a> of {
|
\a,vf,neg -> case <b,a> of {
|
||||||
<True, Simul> => {fin = tulla ! vf ; inf = illat} ;
|
<True, Simul> => {fin = tulla ! vf ; inf = illat} ;
|
||||||
@@ -623,21 +656,39 @@ oper
|
|||||||
<False,Anter> => {fin = eis ! vf ;
|
<False,Anter> => {fin = eis ! vf ;
|
||||||
inf = olla ! neg ++ tulla ! part ++ illat}
|
inf = olla ! neg ++ tulla ! part ++ illat}
|
||||||
} ;
|
} ;
|
||||||
älä = case b of {
|
inf : VIForm -> Anteriority -> {fin,inf : Str} =
|
||||||
True => {fin = vs ! Imper n ; inf = []} ;
|
\if,a ->
|
||||||
False => {fin = eis ! Imper n ;
|
let i = case if of {
|
||||||
inf = vs ! case n of {
|
VIInf3Iness => Inf3Iness ;
|
||||||
|
VIInf3Elat => Inf3Elat ;
|
||||||
|
VIInf3Illat => Inf3Illat ;
|
||||||
|
VIInf3Adess => Inf3Adess ;
|
||||||
|
VIInf3Abess => Inf3Abess ;
|
||||||
|
_ => Inf --- not used for imperative
|
||||||
|
}
|
||||||
|
in
|
||||||
|
case <b,a> of {
|
||||||
|
<True, Simul> => {fin = vs ! i ; inf = []} ;
|
||||||
|
<True, Anter> => {fin = olla ! i ; inf = vs ! part} ;
|
||||||
|
<False,Simul> => {fin = olla ! i ; inf = abess} ;
|
||||||
|
<False,Anter> => {fin = olla ! i ; inf = olla ! part ++ abess}
|
||||||
|
} ;
|
||||||
|
älä : Number -> {fin,inf : Str} =
|
||||||
|
\nu -> case b of {
|
||||||
|
True => {fin = vs ! Imper nu ; inf = []} ;
|
||||||
|
False => {fin = eis ! Imper nu ;
|
||||||
|
inf = vs ! case nu of {
|
||||||
Sg => Imper n ;
|
Sg => Imper n ;
|
||||||
Pl => ImpNegPl}
|
Pl => ImpNegPl}
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
in case sf of {
|
in case sf of {
|
||||||
VFinite _ Past a => ei a (Impf n p) (part) ;
|
SCl (VFinite _ Past a) => ei a (Impf n p) (part) ;
|
||||||
VFinite _ Conditional a => ei a (Cond n p) (Cond Sg P3) ;
|
SCl (VFinite _ Conditional a) => ei a (Cond n p) (Cond Sg P3) ;
|
||||||
VFinite _ Present a => ei a (Pres n p) (Imper Sg) ;
|
SCl (VFinite _ Present a) => ei a (Pres n p) (Imper Sg) ;
|
||||||
VFinite _ Future a => fut a (Pres n p) (Imper Sg) ;
|
SCl (VFinite _ Future a) => fut a (Pres n p) (Imper Sg) ;
|
||||||
VInfinit a => inf a ;
|
SVI (VIImperat n ) => älä n ;
|
||||||
VImperat => älä
|
SVI i => inf i Simul ---- Anter
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -1069,7 +1120,7 @@ oper
|
|||||||
Imperative = SS1 Number ;
|
Imperative = SS1 Number ;
|
||||||
|
|
||||||
imperVerbPhrase : Bool -> VerbPhraseInf -> Imperative = \b,ui ->
|
imperVerbPhrase : Bool -> VerbPhraseInf -> Imperative = \b,ui ->
|
||||||
{s = \\n => ui.s ! VIImperat b n} ;
|
{s = \\n => ui.s ! b ! VIImperat n} ;
|
||||||
|
|
||||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||||
ss (I.s ! n ++ exclPunct) ;
|
ss (I.s ! n ++ exclPunct) ;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/07/01 17:14:26 $
|
-- > CVS $Date: 2005/07/01 19:54:09 $
|
||||||
-- > CVS $Author: peb $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.8 $
|
-- > CVS $Revision: 1.9 $
|
||||||
--
|
--
|
||||||
-- Help on shell commands. Generated from HelpFile by 'make help'.
|
-- Help on shell commands. Generated from HelpFile by 'make help'.
|
||||||
-- PLEASE DON'T EDIT THIS FILE.
|
-- PLEASE DON'T EDIT THIS FILE.
|
||||||
|
|||||||
Reference in New Issue
Block a user