summaryrefslogtreecommitdiff
path: root/next-lib/src/swedish/MorphoSwe.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-09-22 11:49:15 +0000
committeraarne <aarne@cs.chalmers.se>2008-09-22 11:49:15 +0000
commit98665df78b8018af30051cb4a9a31f845e0ba19d (patch)
tree67ba30b09e2b9590a00a4b193bf7611caa935af8 /next-lib/src/swedish/MorphoSwe.gf
parent4862018f140a1bdcc7961d445ed9aa92facd742f (diff)
moved lib/next-resource to next-lib/src, to enable linking with next-lib as value of GF_LIB_PATH
Diffstat (limited to 'next-lib/src/swedish/MorphoSwe.gf')
-rw-r--r--next-lib/src/swedish/MorphoSwe.gf73
1 files changed, 73 insertions, 0 deletions
diff --git a/next-lib/src/swedish/MorphoSwe.gf b/next-lib/src/swedish/MorphoSwe.gf
new file mode 100644
index 000000000..48180b781
--- /dev/null
+++ b/next-lib/src/swedish/MorphoSwe.gf
@@ -0,0 +1,73 @@
+--# -path=.:../scandinavian:../common:../../prelude
+
+--1 A Simple Swedish Resource Morphology
+--
+-- Aarne Ranta 2002 -- 2005
+--
+-- This resource morphology contains definitions needed in the resource
+-- syntax. To build a lexicon, it is better to use $ParadigmsSwe$, which
+-- gives a higher-level access to this module.
+
+resource MorphoSwe = CommonScand, ResSwe ** open Prelude, (Predef=Predef) in {
+
+
+-- Verbs
+
+-- Heuristic to infer all participle forms from one.
+
+oper
+ ptPretAll : Str -> Str * Str = \funnen ->
+ case funnen of {
+ ko +"mmen" => <ko +"mmet", ko + "mna"> ;
+ vun +"nen" => <vun +"net", vun + "na"> ;
+ bjud + "en" => <bjud + "et", bjud + "na"> ;
+ se + "dd" => <se + "tt", se +"dda"> ;
+ tal + "ad" => <tal + "at", tal +"ade"> ;
+ kaen + "d" => <kaen + "t", kaen + "da"> ;
+ lekt => <lekt, lekt + "a">
+ } ;
+
+ ptPretForms : Str -> AFormPos => Case => Str = \funnen -> \\a,c =>
+ let
+ funfun = ptPretAll funnen
+ in
+ mkCase c (case a of {
+ (Strong (SgUtr)) => funnen ;
+ (Strong (SgNeutr)) => funfun.p1 ;
+ _ => funfun.p2
+ }
+ ) ;
+
+-- For $Numeral$.
+
+param DForm = ental | ton | tiotal ;
+
+oper
+ LinDigit = {s : DForm => CardOrd => Str} ;
+
+ cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje ->
+ table {
+ NCard _ => tre ;
+ NOrd a => tredje ---- a
+ } ;
+
+ cardReg : Str -> CardOrd => Str = \tio ->
+ cardOrd tio (tio + "nde") ;
+
+ mkTal : (x1,_,_,_,x5 : Str) -> LinDigit =
+ \två, tolv, tjugo, andra, tolfte ->
+ {s = table {
+ ental => cardOrd två andra ;
+ ton => cardOrd tolv tolfte ;
+ tiotal => cardReg tjugo
+ }
+ } ;
+
+ numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n ->
+ {s = n ; n = Pl} ;
+
+ invNum : CardOrd = NCard Neutr ;
+
+
+} ;
+