From 25e5edcde6985090554549e1eb36f5a30a05128a Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 17 Jan 2006 13:56:38 +0000 Subject: [PATCH] moved stuff from MorphoSwe to ParadigmsSwe (to be continued) --- lib/resource-1.0/swedish/MorphoSwe.gf | 54 ------------------------ lib/resource-1.0/swedish/ParadigmsSwe.gf | 54 +++++++++++++++++++++++- 2 files changed, 52 insertions(+), 56 deletions(-) diff --git a/lib/resource-1.0/swedish/MorphoSwe.gf b/lib/resource-1.0/swedish/MorphoSwe.gf index 2afb993d0..f5dc7af09 100644 --- a/lib/resource-1.0/swedish/MorphoSwe.gf +++ b/lib/resource-1.0/swedish/MorphoSwe.gf @@ -10,7 +10,6 @@ resource MorphoSwe = ResScand, DiffSwe ** open Prelude, (Predef=Predef) in { - -- Nouns oper @@ -24,59 +23,6 @@ oper } } ; - reg2Noun : Str -> Str -> Noun = \bil,bilar -> - let - l = last bil ; - b = Predef.tk 2 bil ; - ar = Predef.dp 2 bilar ; - bile = Predef.tk 2 bilar - in - case ar of { - "or" => case l of { - "a" => decl1Noun bil ; - "r" => decl5Noun bil ; - "o" => mkNoun bil (bil + "n") bilar (bilar + "na") ; - _ => mkNoun bil (bil + "en") bilar (bilar + "na") - } ; - "ar" => ifTok Noun bil bilar - (decl5Noun bil) - (ifTok Noun bile bil - (decl2Noun bil) - (case l of { - "e" => decl2Noun bil ; -- pojke-pojkar - _ => mkNoun bil (bile + "en") bilar (bilar + "na") -- mun-munnar - } - ) - ) ; - "er" => case l of { - "e" => mkNoun bil (bil + "n") (bil +"r") (bil + "rna") ; - "y" | "å" | "é" => decl3Noun bil ; - _ => mkNoun bil (bil + "en") bilar (bilar + "na") - } ; - "en" => ifTok Noun bil bilar (decl5Noun bil) (decl4Noun bil) ; -- ben-ben - _ => ifTok Noun bil bilar ( - case Predef.dp 3 bil of { - "are" => let kikar = init bil in - mkNoun bil (kikar + "en") bil (kikar + "na") ; - _ => decl5Noun bil - } - ) - (decl5Noun bil) --- rest case with lots of garbage - } ; - ---- this is a very rough heuristic and misses "er". - - regNoun : Str -> Gender -> Noun = \bil,g -> case g of { - Utr => case last bil of { - "a" => decl1Noun bil ; - _ => decl2Noun bil - } ; - Neutr => case last bil of { - "e" => decl4Noun bil ; - _ => decl5Noun bil - } - } ; - -- School declensions. diff --git a/lib/resource-1.0/swedish/ParadigmsSwe.gf b/lib/resource-1.0/swedish/ParadigmsSwe.gf index b0dca68aa..bd8803132 100644 --- a/lib/resource-1.0/swedish/ParadigmsSwe.gf +++ b/lib/resource-1.0/swedish/ParadigmsSwe.gf @@ -168,6 +168,7 @@ oper mk2ADeg : (bred,brett : Str) -> ADeg ; + --2 Adverbs -- Adverbs are not inflected. Most lexical ones have position @@ -290,8 +291,57 @@ oper genitive = Gen ; mkN x y z u = mkNoun x y z u ** {lock_N = <>} ; - regN x g = regNoun x g ** {lock_N = <>} ; - mk2N x g = reg2Noun x g ** {lock_N = <>} ; + regN bil g = case g of { + Utr => case last bil of { + "a" => decl1Noun bil ; + _ => decl2Noun bil + } ; + Neutr => case last bil of { + "e" => decl4Noun bil ; + _ => decl5Noun bil + } + } ** {lock_N = <>} ; + + mk2N bil bilar = + let + l = last bil ; + b = Predef.tk 2 bil ; + ar = Predef.dp 2 bilar ; + bile = Predef.tk 2 bilar + in + case ar of { + "or" => case l of { + "a" => decl1Noun bil ; + "r" => decl5Noun bil ; + "o" => mkNoun bil (bil + "n") bilar (bilar + "na") ; + _ => mkNoun bil (bil + "en") bilar (bilar + "na") + } ; + "ar" => ifTok Noun bil bilar + (decl5Noun bil) + (ifTok Noun bile bil + (decl2Noun bil) + (case l of { + "e" => decl2Noun bil ; -- pojke-pojkar + _ => mkNoun bil (bile + "en") bilar (bilar + "na") -- mun-munnar + } + ) + ) ; + "er" => case l of { + "e" => mkNoun bil (bil + "n") (bil +"r") (bil + "rna") ; + "y" | "å" | "é" => decl3Noun bil ; + _ => mkNoun bil (bil + "en") bilar (bilar + "na") + } ; + "en" => ifTok Noun bil bilar (decl5Noun bil) (decl4Noun bil) ; -- ben-ben + _ => ifTok Noun bil bilar ( + case Predef.dp 3 bil of { + "are" => let kikar = init bil in + mkNoun bil (kikar + "en") bil (kikar + "na") ; + _ => decl5Noun bil + } + ) + (decl5Noun bil) --- rest case with lots of garbage + } ** {lock_N = <>} ; + mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; regN2 n g = mkN2 (regN n g) (mkPreposition "av") ;