mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
vt -o ; Finnish infinitives
This commit is contained in:
@@ -84,7 +84,7 @@ fun
|
|||||||
|
|
||||||
-- Formation of infinitival phrases.
|
-- Formation of infinitival phrases.
|
||||||
|
|
||||||
AdjPart : V -> A ; -- forgotten
|
AdjPart : V -> A ; -- past participle, e.g. "forgotten"
|
||||||
|
|
||||||
UseCl : TP -> Cl -> S ;
|
UseCl : TP -> Cl -> S ;
|
||||||
UseRCl : TP -> RCl -> RS ;
|
UseRCl : TP -> RCl -> RS ;
|
||||||
|
|||||||
@@ -856,8 +856,9 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
|||||||
tuji = init tulin ;
|
tuji = init tulin ;
|
||||||
a = Predef.dp 1 tulkaa ;
|
a = Predef.dp 1 tulkaa ;
|
||||||
tulleena = Predef.tk 2 tullut + ("een" + a) ;
|
tulleena = Predef.tk 2 tullut + ("een" + a) ;
|
||||||
tulleen = (sRae tullut tulleena).s ;
|
tulleen = (noun2adj (sRae tullut tulleena)).s ;
|
||||||
tullun = (sKukko tultu tullun (tultu + ("j"+a))).s ;
|
tullun = (noun2adj (sKukko tultu tullun (tultu + ("j"+a)))).s ;
|
||||||
|
tulema = Predef.tk 3 tulevat + "m" + a ;
|
||||||
vat = "v" + a + "t"
|
vat = "v" + a + "t"
|
||||||
in
|
in
|
||||||
{s = table {
|
{s = table {
|
||||||
@@ -886,7 +887,12 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
|||||||
Pass True => tullaan ;
|
Pass True => tullaan ;
|
||||||
Pass False => Predef.tk 2 tullaan ;
|
Pass False => Predef.tk 2 tullaan ;
|
||||||
PastPartAct n => tulleen ! n ;
|
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 + "tt" + u)
|
||||||
(palka + "t" + u + "n") ;
|
(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
|
----- tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun
|
||||||
|
|
||||||
|
|||||||
@@ -465,6 +465,7 @@ regV soutaa =
|
|||||||
u = ifTok Str a "a" "u" "y" ;
|
u = ifTok Str a "a" "u" "y" ;
|
||||||
joi = Predef.tk 2 juo + (o + "i")
|
joi = Predef.tk 2 juo + (o + "i")
|
||||||
in case ta of {
|
in case ta of {
|
||||||
|
"it" => vHarkita soutaa ;
|
||||||
"st" | "nn" | "rr" | "ll" => vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
|
"st" | "nn" | "rr" | "ll" => vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
|
||||||
_ => case aa of {
|
_ => case aa of {
|
||||||
"aa" | "ää" => vOttaa soutaa (souda + "n") ;
|
"aa" | "ää" => vOttaa soutaa (souda + "n") ;
|
||||||
|
|||||||
@@ -6,18 +6,14 @@
|
|||||||
--
|
--
|
||||||
-- This is the Finnish concrete syntax of the multilingual resource
|
-- This is the Finnish concrete syntax of the multilingual resource
|
||||||
-- grammar. Most of the work is done in the file $SyntaxFin.gf$.
|
-- 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
|
-- 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.
|
-- 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
|
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||||
-- one has to know how the syntactic categories are
|
-- one has to know how the rules are
|
||||||
-- implemented. The parameter types are defined in $TypesFin.gf$.
|
-- 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 {
|
concrete RulesFin of Rules = CategoriesFin ** open Prelude, SyntaxFin in {
|
||||||
|
|
||||||
@@ -103,7 +99,7 @@ lin
|
|||||||
|
|
||||||
TPresent = {s = [] ; t = Present} ;
|
TPresent = {s = [] ; t = Present} ;
|
||||||
TPast = {s = [] ; t = Past} ;
|
TPast = {s = [] ; t = Past} ;
|
||||||
TFuture = {s = [] ; t = Present} ;
|
TFuture = {s = [] ; t = Future} ;
|
||||||
TConditional = {s = [] ; t = Conditional} ;
|
TConditional = {s = [] ; t = Conditional} ;
|
||||||
|
|
||||||
ASimul = {s = [] ; a = Simul} ;
|
ASimul = {s = [] ; a = Simul} ;
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ oper
|
|||||||
|
|
||||||
param
|
param
|
||||||
|
|
||||||
Tense = Present | Past | Conditional ;
|
Tense = Present | Past | Future | Conditional ;
|
||||||
Anteriority = Simul | Anter ;
|
Anteriority = Simul | Anter ;
|
||||||
|
|
||||||
SForm =
|
SForm =
|
||||||
@@ -501,7 +501,14 @@ oper
|
|||||||
|
|
||||||
SType = SDecl | SQuest ;
|
SType = SDecl | SQuest ;
|
||||||
|
|
||||||
VIForm = VIInfinit | VIImperat Bool Number ;
|
VIForm =
|
||||||
|
VIInfinit
|
||||||
|
| VIImperat Bool Number
|
||||||
|
| VIInf3Iness
|
||||||
|
| VIInf3Elat
|
||||||
|
| VIInf3Illat
|
||||||
|
| VIInf3Adess
|
||||||
|
| VIInf3Abess ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Clause : Type = {s : Bool => SForm => Str} ;
|
Clause : Type = {s : Bool => SForm => Str} ;
|
||||||
@@ -584,14 +591,16 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
inflectVerb : Verb -> Number -> Person -> Bool -> SForm -> {fin, inf : Str} =
|
inflectVerb : Verb -> Number -> Person -> Bool -> SForm -> {fin, inf : Str} =
|
||||||
\verb,n,p,b,sf ->
|
\verb,n,p,b,sf ->
|
||||||
let
|
let
|
||||||
vs = verb.s ;
|
vs = verb.s ;
|
||||||
olla = verbOlla.s ;
|
olla = verbOlla.s ;
|
||||||
|
tulla = (vJuosta "tulla" "tulen" "tullut" "tultu").s ;
|
||||||
eis = verbEi.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} =
|
ei : Anteriority -> VForm -> VForm -> {fin,inf : Str} =
|
||||||
\a,vf,neg -> case <b,a> of {
|
\a,vf,neg -> case <b,a> of {
|
||||||
<True, Simul> => {fin = vs ! vf ; inf = []} ;
|
<True, Simul> => {fin = vs ! vf ; inf = []} ;
|
||||||
@@ -599,6 +608,21 @@ 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} =
|
||||||
|
\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 {
|
älä = case b of {
|
||||||
True => {fin = vs ! Imper n ; inf = []} ;
|
True => {fin = vs ! Imper n ; inf = []} ;
|
||||||
False => {fin = eis ! Imper n ;
|
False => {fin = eis ! Imper n ;
|
||||||
@@ -610,8 +634,9 @@ oper
|
|||||||
in case sf of {
|
in case sf of {
|
||||||
VFinite _ Past a => ei a (Impf n p) (part) ;
|
VFinite _ Past a => ei a (Impf n p) (part) ;
|
||||||
VFinite _ Conditional a => ei a (Cond n p) (Cond Sg P3) ;
|
VFinite _ Conditional a => ei a (Cond n p) (Cond Sg P3) ;
|
||||||
VFinite _ _ a => ei a (Pres n p) (Imper Sg) ; -- Present
|
VFinite _ Present a => ei a (Pres n p) (Imper Sg) ;
|
||||||
VInfinit a => ei a (Inf) (Inf) ; --- olla tulematta
|
VFinite _ Future a => fut a (Pres n p) (Imper Sg) ;
|
||||||
|
VInfinit a => inf a ;
|
||||||
VImperat => älä
|
VImperat => älä
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -93,8 +93,14 @@ param
|
|||||||
| Imper Number
|
| Imper Number
|
||||||
| ImpNegPl
|
| ImpNegPl
|
||||||
| Pass Bool
|
| Pass Bool
|
||||||
| PastPartAct NForm
|
| PastPartAct AForm
|
||||||
| PastPartPass NForm
|
| PastPartPass AForm
|
||||||
|
| Inf3Iness -- 5 forms acc. to Karlsson
|
||||||
|
| Inf3Elat
|
||||||
|
| Inf3Illat
|
||||||
|
| Inf3Adess
|
||||||
|
| Inf3Abess
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/06/20 16:14:19 $
|
-- > CVS $Date: 2005/07/01 08:16:32 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.41 $
|
-- > CVS $Revision: 1.42 $
|
||||||
--
|
--
|
||||||
-- GF shell command interpreter.
|
-- GF shell command interpreter.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -208,6 +208,8 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of
|
|||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
returnArg (ATrms $ generateTrees opts gro mt) sa
|
returnArg (ATrms $ generateTrees opts gro mt) sa
|
||||||
|
|
||||||
|
CShowTreeGraph | oElem emitCode opts -> do -- -o
|
||||||
|
returnArg (AString $ visualizeTrees opts $ strees $ s2t a) sa
|
||||||
CShowTreeGraph -> do
|
CShowTreeGraph -> do
|
||||||
let g0 = writeFile "grphtmp.dot" $ visualizeTrees opts $ strees $ s2t a
|
let g0 = writeFile "grphtmp.dot" $ visualizeTrees opts $ strees $ s2t a
|
||||||
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"
|
g1 = system "dot -Tps grphtmp.dot >grphtmp.ps"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/06/20 16:14:19 $
|
-- > CVS $Date: 2005/07/01 08:16:32 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.6 $
|
-- > CVS $Revision: 1.7 $
|
||||||
--
|
--
|
||||||
-- 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.
|
||||||
@@ -317,6 +317,11 @@ txtHelpFile =
|
|||||||
"\n -c show categories only (no functions)" ++
|
"\n -c show categories only (no functions)" ++
|
||||||
"\n -f show functions only (no categories)" ++
|
"\n -f show functions only (no categories)" ++
|
||||||
"\n -g show as graph (sharing uses of the same function)" ++
|
"\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" ++
|
||||||
"\n-- subshells" ++
|
"\n-- subshells" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-- Stability : (stable)
|
-- Stability : (stable)
|
||||||
-- Portability : (portable)
|
-- Portability : (portable)
|
||||||
--
|
--
|
||||||
-- > CVS $Date: 2005/06/20 16:14:20 $
|
-- > CVS $Date: 2005/07/01 08:16:32 $
|
||||||
-- > CVS $Author: aarne $
|
-- > CVS $Author: aarne $
|
||||||
-- > CVS $Revision: 1.38 $
|
-- > CVS $Revision: 1.39 $
|
||||||
--
|
--
|
||||||
-- The datatype of shell commands and the list of their options.
|
-- The datatype of shell commands and the list of their options.
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
@@ -191,7 +191,7 @@ optionsOfCommand co = case co of
|
|||||||
CSpeakAloud -> flags "language"
|
CSpeakAloud -> flags "language"
|
||||||
CPutString -> both "utf8" "filter length"
|
CPutString -> both "utf8" "filter length"
|
||||||
CShowTerm -> flags "printer"
|
CShowTerm -> flags "printer"
|
||||||
CShowTreeGraph -> opts "c f g"
|
CShowTreeGraph -> opts "c f g o"
|
||||||
CSystemCommand _ -> none
|
CSystemCommand _ -> none
|
||||||
|
|
||||||
CPrintGrammar -> both "utf8" "printer lang"
|
CPrintGrammar -> both "utf8" "printer lang"
|
||||||
|
|||||||
@@ -288,6 +288,11 @@ vt, visualize_tree: vt Tree
|
|||||||
-c show categories only (no functions)
|
-c show categories only (no functions)
|
||||||
-f show functions only (no categories)
|
-f show functions only (no categories)
|
||||||
-g show as graph (sharing uses of the same function)
|
-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
|
-- subshells
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user