forked from GitHub/gf-core
editor command pc n ; resource/finnish
This commit is contained in:
@@ -294,7 +294,7 @@ oper
|
||||
vOlla = verbOlla ** {lock_V = <>} ;
|
||||
vEi = verbEi ** {lock_V = <>} ;
|
||||
|
||||
mkTV = \v,c,p,o -> v ** {s3 = p ; s4 = o ; c = c ; lock_TV = <>} ;
|
||||
---- mkTV = \v,c,p,o -> v ** {s3 = p ; s4 = o ; c = c ; lock_TV = <>} ;
|
||||
tvCase = \v,c -> mkTV v c [] [] ;
|
||||
tvDir v = mkTransVerbDir v ** {lock_TV = <>} ;
|
||||
} ;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
---- abstract Resource = Rules, Verbphrase ** {} ;
|
||||
abstract Resource = Rules, Clause, Structural ** {} ;
|
||||
|
||||
@@ -54,9 +54,9 @@ oper
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
|
||||
-- Prepositions used in many-argument functions are just strings.
|
||||
-- Prepositions are used in many-argument functions for rection.
|
||||
|
||||
Preposition : Type = Str ;
|
||||
Preposition : Type ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
@@ -187,9 +187,13 @@ oper
|
||||
|
||||
--2 Prepositions
|
||||
--
|
||||
-- A preposition is just a string.
|
||||
-- A preposition as used for rection in the lexicon, as well as to
|
||||
-- build $PP$s in the resource API, just requires a string.
|
||||
|
||||
mkPreposition : Str -> Preposition ;
|
||||
mkPrep : Str -> Prep ;
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
@@ -282,6 +286,8 @@ oper
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
|
||||
Preposition = Str ;
|
||||
|
||||
regN = \ray ->
|
||||
let
|
||||
ra = Predef.tk 1 ray ;
|
||||
@@ -360,6 +366,7 @@ oper
|
||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
|
||||
mkPreposition p = p ;
|
||||
mkPrep p = ss p ** {lock_Prep = <>} ;
|
||||
|
||||
mkV a b c d e = mkVerbP3worst a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||
|
||||
|
||||
1009
lib/resource/finnish/MorphoFin.gf
Normal file
1009
lib/resource/finnish/MorphoFin.gf
Normal file
File diff suppressed because it is too large
Load Diff
1160
lib/resource/finnish/SyntaxFin.gf
Normal file
1160
lib/resource/finnish/SyntaxFin.gf
Normal file
File diff suppressed because it is too large
Load Diff
134
lib/resource/finnish/TypesFin.gf
Normal file
134
lib/resource/finnish/TypesFin.gf
Normal file
@@ -0,0 +1,134 @@
|
||||
--1 Finnish Word Classes and Morphological Parameters
|
||||
--
|
||||
-- This is a resource module for Finnish morphology, defining the
|
||||
-- morphological parameters and word classes of Finnish. It is aimed
|
||||
-- to be complete w.r.t. the description of word forms.
|
||||
-- However, it only includes those parameters that are needed for
|
||||
-- analysing individual words: such parameters are defined in syntax modules.
|
||||
--
|
||||
-- We use the language-independent prelude.
|
||||
|
||||
resource TypesFin = open Prelude in {
|
||||
|
||||
--
|
||||
--2 Enumerated parameter types
|
||||
--
|
||||
-- These types are the ones found in school grammars.
|
||||
-- Their parameter values are atomic. The accusative cases are only
|
||||
-- defined in syntax; in morphology, there is a special accusative for
|
||||
-- pronouns.
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Case = Nom | Gen | Part | Transl | Ess
|
||||
| Iness | Elat | Illat | Adess | Ablat | Allat
|
||||
| Abess ; -- Comit, Instruct in NForm
|
||||
Person = P1 | P2 | P3 ;
|
||||
Degree = Pos | Comp | Sup ;
|
||||
Gender = NonHuman | Human ;
|
||||
|
||||
-- For data abstraction, we define
|
||||
|
||||
oper
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
--2 Word classes and hierarchical parameter types
|
||||
--
|
||||
-- Real parameter types (i.e. ones on which words and phrases depend)
|
||||
-- are often hierarchical. The alternative would be cross-products of
|
||||
-- simple parameters, but this would usually overgenerate.
|
||||
--
|
||||
|
||||
--3 Common nouns
|
||||
--
|
||||
-- Common nouns are inflected in number and noun case. In noun case, we include
|
||||
-- forms used in connection with possessive suffixes.
|
||||
|
||||
param
|
||||
NForm = NCase Number Case
|
||||
| NComit | NInstruct -- no number dist
|
||||
| NPossNom | NPossGenPl | NPossTransl Number | NPossIllat Number ;
|
||||
|
||||
oper
|
||||
CommonNoun : Type = {s : NForm => Str} ;
|
||||
|
||||
useNForm : NForm -> (Number => Case => Str) -> Str = \nf,f -> case nf of {
|
||||
NCase n c => f ! n ! c ;
|
||||
NPossNom => f ! Sg ! Nom ; ---- "iso autoni"; also "isot autoni" etc
|
||||
NPossGenPl => f ! Pl ! Gen ;
|
||||
NPossTransl n => f ! n ! Transl ;
|
||||
NPossIllat n => f ! n ! Illat ;
|
||||
_ => f ! Sg ! Nom --- NComit, NInstruct ; should not happen
|
||||
} ;
|
||||
|
||||
|
||||
--
|
||||
--3 Adjectives
|
||||
--
|
||||
-- The major division is between the comparison degrees, but it
|
||||
-- is also good to leave room for adjectives that cannon be compared.
|
||||
-- Such adjectives are like common nouns, except for the adverbial form.
|
||||
|
||||
param
|
||||
AForm = AN NForm | AAdv ;
|
||||
|
||||
oper
|
||||
Adjective : Type = {s : AForm => Str} ;
|
||||
AdjDegr : Type = {s : Degree => AForm => Str} ;
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- We limit the grammar so far to verbs in the infinitive, second-person
|
||||
-- imperative, and present tense indicative active and passive.
|
||||
-- A special form is needed for
|
||||
-- the negated plural imperative.
|
||||
|
||||
param
|
||||
VForm =
|
||||
Inf
|
||||
| Pres Number Person
|
||||
| Impf Number Person
|
||||
| Imper Number
|
||||
| ImpNegPl
|
||||
| Pass Bool
|
||||
;
|
||||
|
||||
oper
|
||||
Verb : Type = SS1 VForm ;
|
||||
|
||||
vFormNeg = Imper Sg ;
|
||||
|
||||
vform2number : VForm -> Number = \v -> case v of {
|
||||
Pres n _ => n ;
|
||||
Impf n _ => n ;
|
||||
Imper n => n ;
|
||||
ImpNegPl => Pl ;
|
||||
_ => Sg ---
|
||||
} ;
|
||||
|
||||
--
|
||||
--3 Pronouns
|
||||
--
|
||||
-- For pronouns, we need the noun case forms, plus an accusative.
|
||||
|
||||
param
|
||||
PForm = PCase Case | PAcc ;
|
||||
|
||||
oper
|
||||
Pronoun : Type = {s : PForm => Str ; n : Number ; p : Person} ;
|
||||
|
||||
--3 Proper names
|
||||
--
|
||||
-- Proper names only need case forms.
|
||||
|
||||
ProperName : Type = SS1 Case ;
|
||||
|
||||
|
||||
--3 Relative pronouns
|
||||
--
|
||||
-- Relative pronouns are inflected like nouns, except for possessive suffixes.
|
||||
|
||||
RelPron : Type = {s : Number => Case => Str} ;
|
||||
|
||||
} ;
|
||||
@@ -5,9 +5,9 @@
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/06/03 22:44:36 $
|
||||
-- > CVS $Date: 2005/06/10 15:59:58 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.17 $
|
||||
-- > CVS $Revision: 1.18 $
|
||||
--
|
||||
-- (Description of the module)
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -122,6 +122,7 @@ pCommandMsg s = (m,pCommandWords $ words c) where
|
||||
"u" : _ -> CUndo
|
||||
"d" : _ -> CDelete
|
||||
"ac" : _ -> CAddClip
|
||||
"pc": i : _ -> CRemoveClip (readIntArg i)
|
||||
"c" : s : _ -> CTermCommand s
|
||||
"a" : _ -> CRefineRandom --- *a*leatoire
|
||||
"m" : _ -> CMenu
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/04/21 16:23:19 $
|
||||
-- > CVS $Author: bringert $
|
||||
-- > CVS $Revision: 1.37 $
|
||||
-- > CVS $Date: 2005/06/10 15:59:58 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.38 $
|
||||
--
|
||||
-- temporary hacks for GF 2.0
|
||||
--
|
||||
@@ -91,6 +91,7 @@ data Command =
|
||||
| CRemoveOption Option
|
||||
| CDelete
|
||||
| CAddClip
|
||||
| CRemoveClip Int
|
||||
| CUndo
|
||||
| CView
|
||||
| CMenu
|
||||
@@ -284,6 +285,7 @@ execECommand env c = case c of
|
||||
CRemoveOption o -> changeStOptions (removeOption o)
|
||||
CDelete -> action2commandNext $ deleteSubTree cgr
|
||||
CAddClip -> \s -> (addtoClip (actTree (stateSState s))) s
|
||||
CRemoveClip n -> \s -> (removeClip n) s
|
||||
CUndo -> undoCommand
|
||||
CMenu -> \s -> changeMsg (menuState env s) s
|
||||
CView -> changeView
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/04/21 16:23:51 $
|
||||
-- > CVS $Author: bringert $
|
||||
-- > CVS $Revision: 1.9 $
|
||||
-- > CVS $Date: 2005/06/10 15:59:59 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.10 $
|
||||
--
|
||||
-- (Description of the module)
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -82,6 +82,9 @@ changeCands ts ss@((s,(_,cb),(_,b)):_) = (s,(ts,cb),(candInfo ts,b)) : ss
|
||||
addtoClip :: Clip -> ECommand
|
||||
addtoClip t ss@((s,(ts,cb),(i,b)):_) = (s,(ts,t:cb),(i,b)) : ss
|
||||
|
||||
removeClip :: Int -> ECommand
|
||||
removeClip n ss@((s,(ts,cb),(i,b)):_) = (s,(ts, drop n cb),(i,b)) : ss
|
||||
|
||||
changeMsg :: [String] -> ECommand
|
||||
changeMsg m ((s,ts,(_,b)):ss) = (s,ts,(m,b)) : ss -- just change message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user