concrete StructuralFin of Structural = CatFin ** 
  open MorphoFin, ParadigmsFin, Prelude in {

  flags optimize=all ;

  lin
  above_Prep = postGenPrep "yläpuolella" ;
  after_Prep = postGenPrep "jälkeen" ;

  all_Predet = {s = \\n,c => 
    let
      kaiket = caseTable n ((mkN "kaikki" "kaiken" "kaikkena"))
    in
    case npform2case n c of {
      Nom => "kaikki" ;
      k => kaiket ! k
      }
    } ;
  almost_AdA, almost_AdN = ss "melkein" ;
  although_Subj = ss "vaikka" ;
  always_AdV = ss "aina" ;
  and_Conj = ss "ja" ** {n = Pl} ;
  because_Subj = ss "koska" ;
  before_Prep = prePrep partitive "ennen" ;
  behind_Prep = postGenPrep "takana" ;
  between_Prep = postGenPrep "välissä" ;
  both7and_DConj = sd2 "sekä" "että" ** {n = Pl} ;
  but_PConj = ss "mutta" ;
  by8agent_Prep = postGenPrep "toimesta" ;
  by8means_Prep = casePrep adessive ;
  can8know_VV = mkV "osata" "osasi" ;
  can_VV = mkV "voida" "voi" ;
  during_Prep = postGenPrep "aikana" ;
  either7or_DConj = sd2 "joko" "tai" ** {n = Sg} ;
  everybody_NP = makeNP (mkN "jokainen") Sg ;
  every_Det = mkDet Sg (mkN "jokainen") ;
  everything_NP = makeNP (((mkN "kaikki" "kaiken" "kaikkena")) **
    {lock_N = <>}) Sg ;
  everywhere_Adv = ss "kaikkialla" ;
  few_Det  = mkDet Sg (mkN "harva") ;
---  first_Ord = {s = \\n,c => (mkN "ensimmäinen").s ! NCase n c} ;
  for_Prep = casePrep allative ;
  from_Prep = casePrep elative ;
  he_Pron = mkPronoun "hän" "hänen" "häntä"  "hänenä" "häneen" Sg P3 ;
  here_Adv = ss "täällä" ;
  here7to_Adv = ss "tänne" ;
  here7from_Adv = ss "täältä" ;
  how_IAdv = ss "miten" ;
  how8many_IDet = 
    {s = \\c => "kuinka" ++ (mkN "moni" "monia").s ! NCase Sg c ; n = Sg} ;
  if_Subj = ss "jos" ;
  in8front_Prep = postGenPrep "edessä" ;
  i_Pron  = mkPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
  in_Prep = casePrep inessive ;
  it_Pron = {
    s = \\c => pronSe.s ! npform2case Sg c ; 
    a = agrP3 Sg ; 
    isPron = False
    } ;
  less_CAdv = ss "vähemmän" ;
  many_Det = mkDet Sg (mkN "moni" "monia") ;
  more_CAdv = ss "enemmän" ;
  most_Predet = {s = \\n,c => (nForms2N (dSuurin "useinta")).s ! NCase n (npform2case n c)} ;
  much_Det = mkDet Sg {s = \\_ => "paljon"} ;
  must_VV = caseV genitive (mkV "täytyä") ;
  no_Phr = ss "ei" ;
  on_Prep = casePrep adessive ;
---  one_Quant = mkDet Sg  DEPREC
  only_Predet = {s = \\_,_ => "vain"} ;
  or_Conj = ss "tai" ** {n = Sg} ;
  otherwise_PConj = ss "muuten" ;
  part_Prep = casePrep partitive ;
  please_Voc = ss ["ole hyvä"] ; --- number
  possess_Prep = casePrep genitive ;
  quite_Adv = ss "melko" ;
  she_Pron = mkPronoun "hän" "hänen" "häntä"  "hänenä" "häneen" Sg P3 ;
  so_AdA = ss "niin" ;
  somebody_NP = {
    s = \\c => jokuPron ! Sg ! npform2case Sg c ;
    a = agrP3 Sg ; 
    isPron = False
    } ;
  someSg_Det = {
    s1 = jokuPron ! Sg ;
    s2 = [] ;
    isNum,isPoss = False ; isDef = True ; n = Sg
    } ;
  somePl_Det = {
    s1 = jokuPron ! Pl ;
    s2 = [] ; isNum,isPoss = False ; isDef = True ; 
    n = Pl
    } ;
  something_NP = {
    s = \\c => jokinPron ! Sg ! npform2case Sg c ;
    a = agrP3 Sg ; 
    isPron = False
    } ;
  somewhere_Adv = ss "jossain" ;
  that_Quant = {
    s1 = table (MorphoFin.Number) [
          table (MorphoFin.Case) {
            c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
            } ;
          table (MorphoFin.Case) {
            c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
            }
          ] ;
    s2 = [] ; isNum,isPoss = False ; isDef = True ; 
    } ;
  that_NP = 
    mkDemPronoun "tuo" "tuon" "tuota" "tuona" "tuohon"  Sg **
    {isPron = False} ;
  there_Adv = ss "siellä" ; --- tuolla
  there7to_Adv = ss "sinne" ;
  there7from_Adv = ss "sieltä" ;
  therefore_PConj = ss "siksi" ;
  these_NP = 
    mkDemPronoun "nämä" "näiden" "näitä" "näinä" "näihin"  Pl **
    {isPron = False} ;
  they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin"  Pl P3 ; --- ne
  this_Quant = {
    s1 = table (MorphoFin.Number) [
          table (MorphoFin.Case) {
            c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
            } ;
          table (MorphoFin.Case) {
            c => (mkPronoun "nämä" "näiden" "näitä" "näinä" "näihin" Sg P3).s ! NPCase c
            }
          ] ;
    s2 = [] ; isNum,isPoss = False ; isDef = True ; 
    } ;
  this_NP = 
    mkDemPronoun "tämä" "tämän" "tätä" "tänä" "tähän"  Sg **
    {isPron = False} ;
  those_NP = 
    mkDemPronoun "nuo" "noiden" "noita" "noina" "noihin"  Pl **
    {isPron = False} ;
  through_Prep = postGenPrep "kautta" ;
  too_AdA = ss "liian" ;
  to_Prep = casePrep illative ; --- allative
  under_Prep = postGenPrep "alla" ;
  very_AdA = ss "erittäin" ;
  want_VV = mkV "tahtoa" ;
  we_Pron = mkPronoun "me" "meidän" "meitä" "meinä" "meihin" Pl P1 ;
  whatPl_IP = {
    s = table {NPAcc => "mitkä" ; c => mikaInt ! Pl ! npform2case Pl c} ;
    n = Pl
    } ;
  whatSg_IP = {
    s = \\c => mikaInt ! Sg ! npform2case Sg c ;
    n = Sg
    } ;
  when_IAdv = ss "milloin" ;
  when_Subj = ss "kun" ;
  where_IAdv = ss "missä" ;
  whichPl_IDet = {
    s = mikaInt ! Pl ;
    n = Pl
    } ;
  whichSg_IDet = {
    s = mikaInt ! Sg ;
    n = Sg
    } ;
  whoSg_IP = {
    s = table {NPAcc => "kenet" ; c => kukaInt ! Sg ! npform2case Sg c} ;
    n = Sg
    } ;
  whoPl_IP = {
    s = table {NPAcc => "ketkä" ; c => kukaInt ! Pl ! npform2case Pl c} ;
    n = Pl
    } ;
  why_IAdv = ss "miksi" ;
  without_Prep = prePrep partitive "ilman" ;
  with_Prep = postGenPrep "kanssa" ;
  yes_Phr = ss "kyllä" ;
  youSg_Pron = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun"  Sg P2 ;
  youPl_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin"  Pl P2 ;
  youPol_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin"  Pl P2 ; --- Sg


oper
  jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str =
    let 
      ku = mkN "ku" ;
      kui = mkN "kuu" 
    in
    table {
      Sg => table {
        Nom => "joku" ;
        Gen => "jonkun" ;
        c => relPron ! Sg ! c + ku.s ! NCase Sg c
       } ; 
      Pl => table {
        Nom => "jotkut" ;
        c => relPron ! Pl ! c + kui.s ! NCase Pl c
        }
      } ;

  jokinPron : MorphoFin.Number => (MorphoFin.Case) => Str =
    table {
      Sg => table {
        Nom => "jokin" ;
        Gen => "jonkin" ;
        c => relPron ! Sg ! c + "kin"
       } ; 
      Pl => table {
        Nom => "jotkin" ;
        c => relPron ! Pl ! c + "kin"
        }
      } ;

  mikaInt : MorphoFin.Number => (MorphoFin.Case) => Str = 
    let {
      mi  = mkN "mi"
    } in
    table {
      Sg => table {
        Nom => "mikä" ;
        Gen => "minkä" ;
        c   => mi.s ! NCase Sg c
       } ; 
      Pl => table {
        Nom => "mitkä" ;
        Gen => "mittenkä" ;
        c   => mi.s ! NCase Sg c
        }
      } ;

  kukaInt : MorphoFin.Number => (MorphoFin.Case) => Str = 
    let {
      ku = mkN "kuka" "keitä" ;    -----
      ket = mkN "kuka" "keitä"} in
    table {
      Sg => table {
        Nom => "kuka" ;
        Part => "ketä" ;
        Illat => "keneen" ;
        c   => ku.s ! NCase Sg c
       } ; 
      Pl => table {
        Nom => "ketkä" ;
        Illat => "keihin" ;
        c   => ket.s ! NCase Pl c
        }
      } ;
  mikaanPron : MorphoFin.Number => (MorphoFin.Case) => Str = \\n,c =>
    case <n,c> of {
        <Sg,Nom> => "mikään" ;
        <_,Part> => "mitään" ;
        <Sg,Gen> => "minkään" ;
        <Pl,Nom> => "mitkään" ;
        <Pl,Gen> => "mittenkään" ;
        <_,Ess>  => "minään" ;
        <_,Iness> => "missään" ;
        <_,Elat> => "mistään" ;
        <_,Adess> => "millään" ;
        <_,Ablat> => "miltään" ;
        _   => mikaInt ! n ! c + "kään"
       } ; 

  kukaanPron : MorphoFin.Number => (MorphoFin.Case) => Str =
    table {
      Sg => table {
        Nom => "kukaan" ;
        Part => "ketään" ;
        Ess => "kenään" ;
        Iness => "kessään" ;
        Elat  => "kestään" ;
        Illat => "kehenkään" ;
        Adess => "kellään" ;
        Ablat => "keltään" ;
        c   => kukaInt ! Sg ! c + "kään"
       } ; 
      Pl => table {
        Nom => "ketkään" ;
        Part => "keitään" ;
        Ess => "keinään" ;
        Iness => "keissään" ;
        Elat => "keistään" ;
        Adess => "keillään" ;
        Ablat => "keiltään" ;
        c   => kukaInt ! Pl ! c + "kään"
        }
      } ;

  pronSe : ProperName  = {
    s = table {
      Nom    => "se" ;
      Gen    => "sen" ;
      Part   => "sitä" ;
      Transl => "siksi" ;
      Ess    => "sinä" ;
      Iness  => "siinä" ;
      Elat   => "siitä" ;
      Illat  => "siihen" ;
      Adess  => "sillä" ;
      Ablat  => "siltä" ;
      Allat  => "sille" ;
      Abess  => "sittä"
      } ;
    } ;


oper
  makeNP  : N -> Number -> CatFin.NP ; 
  makeNP noun num = {
    s = \\c => noun.s ! NCase num (npform2case num c) ; 
    a = agrP3 num ;
    isPron = False ;
    lock_NP = <>
    } ;



}

