diff --git a/lib/resource/abstract/Rules.gf b/lib/resource/abstract/Rules.gf index 0d905fc6f..f53e11014 100644 --- a/lib/resource/abstract/Rules.gf +++ b/lib/resource/abstract/Rules.gf @@ -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 ; diff --git a/lib/resource/finnish/MorphoFin.gf b/lib/resource/finnish/MorphoFin.gf index c01bc5e27..c1f4663e4 100644 --- a/lib/resource/finnish/MorphoFin.gf +++ b/lib/resource/finnish/MorphoFin.gf @@ -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 diff --git a/lib/resource/finnish/ParadigmsFin.gf b/lib/resource/finnish/ParadigmsFin.gf index 203db7ed2..28b3853fa 100644 --- a/lib/resource/finnish/ParadigmsFin.gf +++ b/lib/resource/finnish/ParadigmsFin.gf @@ -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") ; diff --git a/lib/resource/finnish/RulesFin.gf b/lib/resource/finnish/RulesFin.gf index b742da31f..97c9d6398 100644 --- a/lib/resource/finnish/RulesFin.gf +++ b/lib/resource/finnish/RulesFin.gf @@ -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} ; diff --git a/lib/resource/finnish/SyntaxFin.gf b/lib/resource/finnish/SyntaxFin.gf index 9685b7a70..104e611bb 100644 --- a/lib/resource/finnish/SyntaxFin.gf +++ b/lib/resource/finnish/SyntaxFin.gf @@ -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 of { => {fin = vs ! vf ; inf = []} ; @@ -599,6 +608,21 @@ oper => {fin = eis ! vf ; inf = vs ! neg} ; => {fin = eis ! vf ; inf = olla ! neg ++ vs ! part} } ; + inf : Anteriority -> {fin,inf : Str} = + \a -> case of { + => {fin = vs ! Inf ; inf = []} ; + => {fin = olla ! Inf ; inf = vs ! part} ; + => {fin = olla ! Inf ; inf = abess} ; + => {fin = olla ! Inf ; inf = olla ! part ++ abess} + } ; + fut : Anteriority -> VForm -> VForm -> {fin,inf : Str} = + \a,vf,neg -> case of { + => {fin = tulla ! vf ; inf = illat} ; + => {fin = olla ! vf ; inf = tulla ! part ++ illat} ; + => {fin = eis ! vf ; inf = tulla ! neg ++ illat} ; + => {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ä } ; diff --git a/lib/resource/finnish/TypesFin.gf b/lib/resource/finnish/TypesFin.gf index dfe40405c..3d5d3d779 100644 --- a/lib/resource/finnish/TypesFin.gf +++ b/lib/resource/finnish/TypesFin.gf @@ -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 diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs index ac5a5d660..8ae01017c 100644 --- a/src/GF/Shell.hs +++ b/src/GF/Shell.hs @@ -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" diff --git a/src/GF/Shell/HelpFile.hs b/src/GF/Shell/HelpFile.hs index 6a95ff7bf..6a1b55d33 100644 --- a/src/GF/Shell/HelpFile.hs +++ b/src/GF/Shell/HelpFile.hs @@ -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" ++ diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs index e2b809b21..9d6718faf 100644 --- a/src/GF/Shell/ShellCommands.hs +++ b/src/GF/Shell/ShellCommands.hs @@ -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" diff --git a/src/HelpFile b/src/HelpFile index dcd246858..03a1c1be5 100644 --- a/src/HelpFile +++ b/src/HelpFile @@ -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