vt -o ; Finnish infinitives

This commit is contained in:
aarne
2005-07-01 07:16:31 +00:00
parent 3377aaabdd
commit 0cfbd86af0
10 changed files with 96 additions and 28 deletions

View File

@@ -84,7 +84,7 @@ fun
-- Formation of infinitival phrases.
AdjPart : V -> A ; -- forgotten
AdjPart : V -> A ; -- past participle, e.g. "forgotten"
UseCl : TP -> Cl -> S ;
UseRCl : TP -> RCl -> RS ;

View File

@@ -856,8 +856,9 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
tuji = init tulin ;
a = Predef.dp 1 tulkaa ;
tulleena = Predef.tk 2 tullut + ("een" + a) ;
tulleen = (sRae tullut tulleena).s ;
tullun = (sKukko tultu tullun (tultu + ("j"+a))).s ;
tulleen = (noun2adj (sRae tullut tulleena)).s ;
tullun = (noun2adj (sKukko tultu tullun (tultu + ("j"+a)))).s ;
tulema = Predef.tk 3 tulevat + "m" + a ;
vat = "v" + a + "t"
in
{s = table {
@@ -886,7 +887,12 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
Pass True => tullaan ;
Pass False => Predef.tk 2 tullaan ;
PastPartAct n => tulleen ! n ;
PastPartPass n => tullun ! n
PastPartPass n => tullun ! n ;
Inf3Iness => tulema + "ss" + a ;
Inf3Elat => tulema + "st" + a ;
Inf3Illat => tulema + a + "n" ;
Inf3Adess => tulema + "ll" + a ;
Inf3Ablat => tulema + "tt" + a
}
} ;
@@ -996,6 +1002,28 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
(palka + "tt" + u)
(palka + "t" + u + "n") ;
vHarkita : Str -> Verb = \harkita ->
let
a = Predef.dp 1 harkita ;
harki = Predef.tk 2 harkita ;
harkitse = harki + "tse" ;
harkitsi = harki + "tsi" ;
u = case a of {"a" => "u" ; _ => "y"}
in
mkVerb
harkita
(harkitse + "e")
(harkitse + "n")
(harkitse + "v" + a + "t")
(harki + "tk"+ a + a)
(harkita + a + "n")
(harkitsi)
(harkitsi + "n")
(harkitsi + "si")
(harki + "nn" + u + "t")
(harki + "tt" + u)
(harki + "t" + u + "n") ;
----- tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun

View File

@@ -465,6 +465,7 @@ regV soutaa =
u = ifTok Str a "a" "u" "y" ;
joi = Predef.tk 2 juo + (o + "i")
in case ta of {
"it" => vHarkita soutaa ;
"st" | "nn" | "rr" | "ll" => vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
_ => case aa of {
"aa" | "ää" => vOttaa soutaa (souda + "n") ;

View File

@@ -6,18 +6,14 @@
--
-- This is the Finnish concrete syntax of the multilingual resource
-- grammar. Most of the work is done in the file $SyntaxFin.gf$.
-- However, for the purpose of documentation, we make here explicit the
-- linearization types of each category, so that their structures and
-- dependencies can be seen.
-- Another substantial part are the linearization rules of some
-- structural words.
--
-- The users of the resource grammar should not look at this file for the
-- linearization rules, which are in fact hidden in the document version.
-- They should use $resource.Abs.gf$ to access the syntactic rules.
-- They should use $Rules.gf$ to access the syntactic rules.
-- This file can be consulted in those, hopefully rare, occasions in which
-- one has to know how the syntactic categories are
-- implemented. The parameter types are defined in $TypesFin.gf$.
-- one has to know how the rules are
-- implemented. The parameter types are defined in $TypesFin.gf$. For
-- parameter values, access through $ParadigmFin$ is recommended.
concrete RulesFin of Rules = CategoriesFin ** open Prelude, SyntaxFin in {
@@ -103,7 +99,7 @@ lin
TPresent = {s = [] ; t = Present} ;
TPast = {s = [] ; t = Past} ;
TFuture = {s = [] ; t = Present} ;
TFuture = {s = [] ; t = Future} ;
TConditional = {s = [] ; t = Conditional} ;
ASimul = {s = [] ; a = Simul} ;

View File

@@ -490,7 +490,7 @@ oper
param
Tense = Present | Past | Conditional ;
Tense = Present | Past | Future | Conditional ;
Anteriority = Simul | Anter ;
SForm =
@@ -501,7 +501,14 @@ oper
SType = SDecl | SQuest ;
VIForm = VIInfinit | VIImperat Bool Number ;
VIForm =
VIInfinit
| VIImperat Bool Number
| VIInf3Iness
| VIInf3Elat
| VIInf3Illat
| VIInf3Adess
| VIInf3Abess ;
oper
Clause : Type = {s : Bool => SForm => Str} ;
@@ -584,14 +591,16 @@ oper
}
} ;
inflectVerb : Verb -> Number -> Person -> Bool -> SForm -> {fin, inf : Str} =
\verb,n,p,b,sf ->
let
vs = verb.s ;
olla = verbOlla.s ;
tulla = (vJuosta "tulla" "tulen" "tullut" "tultu").s ;
eis = verbEi.s ;
part = PastPartAct (NCase n Nom) ;
part = PastPartAct (AN (NCase n Nom)) ;
abess = vs ! Inf3Abess ;
illat = vs ! Inf3Illat ;
ei : Anteriority -> VForm -> VForm -> {fin,inf : Str} =
\a,vf,neg -> case <b,a> of {
<True, Simul> => {fin = vs ! vf ; inf = []} ;
@@ -599,6 +608,21 @@ oper
<False,Simul> => {fin = eis ! vf ; inf = vs ! neg} ;
<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} =
\a,vf,neg -> case <b,a> of {
<True, Simul> => {fin = tulla ! vf ; inf = illat} ;
<True, Anter> => {fin = olla ! vf ; inf = tulla ! part ++ illat} ;
<False,Simul> => {fin = eis ! vf ; inf = tulla ! neg ++ illat} ;
<False,Anter> => {fin = eis ! vf ;
inf = olla ! neg ++ tulla ! part ++ illat}
} ;
älä = case b of {
True => {fin = vs ! Imper n ; inf = []} ;
False => {fin = eis ! Imper n ;
@@ -610,8 +634,9 @@ oper
in case sf of {
VFinite _ Past a => ei a (Impf n p) (part) ;
VFinite _ Conditional a => ei a (Cond n p) (Cond Sg P3) ;
VFinite _ _ a => ei a (Pres n p) (Imper Sg) ; -- Present
VInfinit a => ei a (Inf) (Inf) ; --- olla tulematta
VFinite _ Present a => ei a (Pres n p) (Imper Sg) ;
VFinite _ Future a => fut a (Pres n p) (Imper Sg) ;
VInfinit a => inf a ;
VImperat => älä
} ;

View File

@@ -93,8 +93,14 @@ param
| Imper Number
| ImpNegPl
| Pass Bool
| PastPartAct NForm
| PastPartPass NForm
| PastPartAct AForm
| PastPartPass AForm
| Inf3Iness -- 5 forms acc. to Karlsson
| Inf3Elat
| Inf3Illat
| Inf3Adess
| Inf3Abess
;
oper

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/06/20 16:14:19 $
-- > CVS $Date: 2005/07/01 08:16:32 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.41 $
-- > CVS $Revision: 1.42 $
--
-- GF shell command interpreter.
-----------------------------------------------------------------------------
@@ -208,6 +208,8 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
_ -> Nothing
returnArg (ATrms $ generateTrees opts gro mt) sa
CShowTreeGraph | oElem emitCode opts -> do -- -o
returnArg (AString $ visualizeTrees opts $ strees $ s2t a) sa
CShowTreeGraph -> do
let g0 = writeFile "grphtmp.dot" $ visualizeTrees opts $ strees $ s2t a
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/06/20 16:14:19 $
-- > CVS $Date: 2005/07/01 08:16:32 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.6 $
-- > CVS $Revision: 1.7 $
--
-- Help on shell commands. Generated from HelpFile by 'make help'.
-- PLEASE DON'T EDIT THIS FILE.
@@ -317,6 +317,11 @@ txtHelpFile =
"\n -c show categories only (no functions)" ++
"\n -f show functions only (no categories)" ++
"\n -g show as graph (sharing uses of the same function)" ++
"\n -o just generate the .dot file" ++
"\n examples:" ++
"\n p \"hello world\" | vt -o | wf my.dot ;; ! open -a GraphViz my.dot" ++
"\n -- This writes the parse tree into my.dot and opens the .dot file" ++
"\n -- with another application without generating .ps." ++
"\n" ++
"\n-- subshells" ++
"\n" ++

View File

@@ -5,9 +5,9 @@
-- Stability : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/06/20 16:14:20 $
-- > CVS $Date: 2005/07/01 08:16:32 $
-- > CVS $Author: aarne $
-- > CVS $Revision: 1.38 $
-- > CVS $Revision: 1.39 $
--
-- The datatype of shell commands and the list of their options.
-----------------------------------------------------------------------------
@@ -191,7 +191,7 @@ optionsOfCommand co = case co of
CSpeakAloud -> flags "language"
CPutString -> both "utf8" "filter length"
CShowTerm -> flags "printer"
CShowTreeGraph -> opts "c f g"
CShowTreeGraph -> opts "c f g o"
CSystemCommand _ -> none
CPrintGrammar -> both "utf8" "printer lang"

View File

@@ -288,6 +288,11 @@ vt, visualize_tree: vt Tree
-c show categories only (no functions)
-f show functions only (no categories)
-g show as graph (sharing uses of the same function)
-o just generate the .dot file
examples:
p "hello world" | vt -o | wf my.dot ;; ! open -a GraphViz my.dot
-- This writes the parse tree into my.dot and opens the .dot file
-- with another application without generating .ps.
-- subshells