LargeFin with no lexicon, but just one word in each category+inherent features; still incomplete

This commit is contained in:
aarne
2016-09-23 12:32:51 +00:00
parent 02358dbd80
commit d7f88e46eb
8 changed files with 106 additions and 36 deletions

View File

@@ -387,7 +387,7 @@ mkVS = overload {
infFirst = Inf1 ; infElat = Inf3Elat ; infIllat = Inf3Illat ; infIness = Inf3Iness ; infPresPart = InfPresPart ; infPresPartAgr = InfPresPartAgr ;
prePrep : Case -> Str -> Prep =
\c,p -> lin Prep {c = NPCase c ; s = <p, [],\\_ => []>} ; -- no possessive suffix
\c,p -> lin Prep {c = NPCase c ; s = <tagFeature (tagPOS "ADP" p) "AdvType" "Pre", [],\\_ => []>} ; -- no possessive suffix
postPrep : Case -> Str -> Prep =
\c,p ->
@@ -397,9 +397,10 @@ mkVS = overload {
Gen => \\a => p ++ possSuffixGen h a ;
_ => \\a => p
} ;
pt = tagFeature (tagPOS "ADP" p) "AdvType" "Post" ;
in case p of {
mukaa + "n" => lin Prep {c = NPCase c ; s = <[],p, a2p>} ;
_ => lin Prep {c = NPCase c ; s = <[],p, a2p>}
mukaa + "n" => lin Prep {c = NPCase c ; s = <[],pt, a2p>} ; ---- p --> mukaa
_ => lin Prep {c = NPCase c ; s = <[],pt, a2p>}
} ;
postGenPrep = postPrep genitive ;

View File

@@ -8,6 +8,7 @@ oper
-- other classes not treated below are POS tagged when the grammar is used with Omorfi
tagPOS : Str -> Str -> Str = \_,s -> s ;
tagFeature : Str -> Str -> Str -> Str = \s,_,_ -> s ;
oper
SNForm : Type = NForm ;

View File

@@ -17,7 +17,7 @@ concrete StructuralFin of Structural = CatFin **
k => kaiket ! k
}
} ;
almost_AdA, almost_AdN = ss "melkein" ;
almost_AdA, almost_AdN = ssp "ADV" "melkein" ;
although_Subj = ssp "CONJ" "vaikka" ;
always_AdV = ssp "ADV" "aina" ;
and_Conj = {s1 = [] ; s2 = tagPOS "CONJ" "ja" ; n = Pl} ;
@@ -25,23 +25,23 @@ concrete StructuralFin of Structural = CatFin **
before_Prep = prePrep partitive "ennen" ;
behind_Prep = postGenPrep "takana" ;
between_Prep = postGenPrep "välissä" ;
both7and_DConj = sd2 "sekä" "että" ** {n = Pl} ;
both7and_DConj = sd2 (tagPOS "CONJ" "sekä") (tagPOS "CONJ" "että") ** {n = Pl} ;
but_PConj = ssp "CONJ" "mutta" ;
by8agent_Prep = postGenPrep "toimesta" ;
by8means_Prep = casePrep adessive ;
can8know_VV = mkVV (mkV "osata" "osasi") ;
can_VV = mkVV (mkV "voida" "voi") ;
during_Prep = postGenPrep "aikana" ;
either7or_DConj = sd2 "joko" "tai" ** {n = Sg} ;
everybody_NP = lin NP (makeNP (((mkN "jokainen"))) Sg) ;
every_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "jokainen")) ;
either7or_DConj = sd2 (tagPOS "CONJ" "joko") (tagPOS "CONJ" "tai") ** {n = Sg} ;
everybody_NP = lin NP (makeNP (((mkN "jokainen"))) Sg) ; --UD
every_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "jokainen")) ; --UD
everything_NP = makeNP ((((mkN "kaikki" "kaiken" "kaikkena")))) Sg ;
everywhere_Adv = mkAdv "kaikkialla" ;
few_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "harva")) ;
everywhere_Adv = mkAdv "kaikkialla" ; --UD
few_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "harva")) ; --UD
--- 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 ;
he_Pron = mkPersonPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
here_Adv = mkAdv "täällä" ;
here7to_Adv = mkAdv "tänne" ;
here7from_Adv = mkAdv "täältä" ;
@@ -51,7 +51,7 @@ concrete StructuralFin of Structural = CatFin **
{s = \\c => "kuinka" ++ (snoun2nounBind (mkN "moni" "monia")).s ! NCase Sg c ; n = Sg ; isNum = False} ;
if_Subj = ssp "CONJ" "jos" ;
in8front_Prep = postGenPrep "edessä" ;
i_Pron = mkPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
i_Pron = mkPersonPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
in_Prep = casePrep inessive ;
it_Pron = {
s = \\c => pronSe.s ! npform2case Sg c ;
@@ -75,7 +75,7 @@ concrete StructuralFin of Structural = CatFin **
please_Voc = ss ["ole hyvä"] ; --- number
possess_Prep = casePrep genitive ;
quite_Adv = ssp "ADV" "melko" ;
she_Pron = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
she_Pron = mkPersonPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
so_AdA = ssp "ADV" "niin" ;
somebody_NP = {
s = \\c => jokuPron ! Sg ! npform2case Sg c ;
@@ -101,10 +101,10 @@ concrete StructuralFin of Structural = CatFin **
that_Quant = heavyQuant {
s1 = table (MorphoFin.Number) {
Sg => table (MorphoFin.Case) {
c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
c => (mkPersonPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
} ;
Pl => table (MorphoFin.Case) {
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
c => (mkPersonPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
}
} ;
s2 = \\_ => [] ; isNum,isPoss = False ; isDef = True ; isNeg = False
@@ -114,14 +114,14 @@ concrete StructuralFin of Structural = CatFin **
there7to_Adv = ssp "ADV" "sinne" ;
there7from_Adv = ssp "ADV" "sieltä" ;
therefore_PConj = ssp "ADV" "siksi" ;
they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
they_Pron = mkPersonPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
this_Quant = heavyQuant {
s1 = table (MorphoFin.Number) {
Sg => table (MorphoFin.Case) {
c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
c => (mkPersonPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
} ;
Pl => table (MorphoFin.Case) {
c => (mkPronoun "nämä" "näiden" "näitä" "näinä" "näihin" Sg P3).s ! NPCase c
c => (mkPersonPronoun "nämä" "näiden" "näitä" "näinä" "näihin" Sg P3).s ! NPCase c
}
} ;
s2 = \\_ => [] ; isNum,isPoss = False ; isDef = True ; isNeg = False
@@ -132,7 +132,7 @@ concrete StructuralFin of Structural = CatFin **
under_Prep = postGenPrep "alla" ;
very_AdA = ssp "ADV" "erittäin" ;
want_VV = mkVV (mkV "tahtoa") ;
we_Pron = mkPronoun "me" "meidän" "meitä" "meinä" "meihin" Pl P1 ;
we_Pron = mkPersonPronoun "me" "meidän" "meitä" "meinä" "meihin" Pl P1 ;
whatPl_IP = {
s = table {NPAcc => "mitkä" ; c => mikaInt ! Pl ! npform2case Pl c} ;
n = Pl
@@ -159,10 +159,10 @@ concrete StructuralFin of Structural = CatFin **
without_Prep = prePrep partitive "ilman" ;
with_Prep = postGenPrep "kanssa" ;
yes_Utt = ssp "INTERJ" "kyllä" ;
youSg_Pron = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
youPl_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
youSg_Pron = mkPersonPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
youPl_Pron = mkPersonPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
youPol_Pron =
let p = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 in
let p = mkPersonPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 in
{s = p.s ; a = AgPol ; hasPoss = True ; poss = p.poss} ;
oper
@@ -313,5 +313,8 @@ lin
oper
ssp : Str -> Str -> {s : Str} = \p,s -> ss (tagPOS p s) ; -- used in tagged/ for Omorfi, otherwise =ss
mkPersonPronoun : (_,_,_,_,_ : Str) -> Number -> Person -> Pron = \a,b,c,d,e,n,p ->
lin Pron (MorphoFin.mkPronoun a b c d e n p) ;
}

View File

@@ -8,7 +8,7 @@ oper
-- other classes not treated below are POS tagged when the grammar is used with Omorfi
tagPOS : Str -> Str -> Str = \_,s -> s ;
tagFeature : Str -> Str -> Str -> Str = \s,_,_ -> s ;
oper
SNForm : Type = Predef.Ints 10 ;

View File

@@ -7,17 +7,18 @@ concrete LargeFin of LargeFinAbs =
VerbFin,
AdjectiveFin,
AdverbFin,
NumeralFin,
-- NumeralFin,
SentenceFin,
QuestionFin,
RelativeFin,
ConjunctionFin,
PhraseFin,
StructuralFin,
-- StructuralFin - [mkPronoun],
IdiomFin,
TenseX,
ExtraFin,
WordsFin ** open TagFin, StemFin in {
TenseX
---- ,ExtraFin
-- ,WordsFin
** open TagFin, StemFin, ResFin, ParadigmsFin, Prelude in {
lincat
Top = {s : Str} ;
@@ -26,5 +27,32 @@ lin
PhrPunctTop phr pu = {s = phr.s ++ pu.s} ;
PhrTop phr = phr ;
fullstopPunct = {s = tagPOS "PUNCT" "."} ;
thePunct = {s = tagPOS "PUNCT" ""} ;
lin
theN = mkN [] ;
theA = mkA [] ;
theV = mkSVerb [] ** {sc = SCNom ; p = []} ;
theAdv = mkAdv [] ;
theV2 = mkV2 theV ; ---- plus other complement cases?
sg1Pron = mkPron Sg P1 ;
sg2Pron = mkPron Sg P2 ;
sg3Pron = mkPron Sg P3 ;
pl1Pron = mkPron Pl P1 ;
pl2Pron = mkPron Pl P2 ;
pl3Pron = mkPron Pl P3 ;
oper
mkPron : Number -> Person -> Pron = \n,p -> lin Pron {
s = \\npf => tagWord (tagPron "Prs" (Ag n p) npf) (mkTag "PRON") ;
a = Ag n p ;
hasPoss = True ;
poss = [] ; ----
} ;
}

View File

@@ -5,17 +5,18 @@ abstract LargeFinAbs =
Verb,
Adjective,
Adverb,
Numeral,
-- Numeral,
Sentence,
Question,
Relative,
Conjunction,
Phrase,
Idiom,
Structural,
Tense,
ExtraFinAbs,
WordsFinAbs ** {
-- Structural,
Tense
---- ,ExtraFinAbs
-- ,WordsFinAbs
** {
flags startcat = Top ;
@@ -25,8 +26,29 @@ cat
fun
PhrPunctTop : Phr -> Punct -> Top ;
PhrTop : Phr -> Top ;
fullstopPunct : Punct ;
thePunct : Punct ;
fun
theN : N ;
theA : A ;
theV : V ;
theAdv : Adv ;
theV2 : V2 ;
sg1Pron : Pron ;
sg2Pron : Pron ;
sg3Pron : Pron ;
sg4Pron : Pron ;
sg5Pron : Pron ;
sg6Pron : Pron ;
theConj : Conj ;
theDistrConj : Conj ;
theSubj : Subj ;
theSgDet : Det ;
thePlDet : Det ;
}

View File

@@ -8,6 +8,7 @@ oper
-- other classes not treated below are POS tagged when the grammar is used with Omorfi
tagPOS : Str -> Str -> Str = \p,s -> tagWord ("+" + p) s ;
tagFeature : Str -> Str -> Str -> Str = \s,f,v -> s ++ mkTag f v ;
oper
SNForm : Type = Predef.Ints 0 ; --- not really needed

View File

@@ -33,6 +33,20 @@ oper
NCompound => pairTag (mkTag "Form" "Comp") (tagNumber Sg) ---- TODO: how is this in UD?
} ;
tagPron : Str -> Agr -> NPForm -> Tag = \typ,agr,npf ->
let tagr : Number * Person = case agr of {
Ag n p => <n, p> ;
AgPol => <Pl, P2> ---- Plur in ud?
} ;
n = tagr.p1 ; p = tagr.p2 ;
pt : Tag = mkTag "PronType" typ ; -- Dem Ind Int Prs Rel
in
case npf of {
NPCase c => consTag (tagNForm (NCase n c))(tagPerson p) pt ;
NPAcc => consTag (mkTag "Case" "Acc") (tagNumber n) (tagPerson p) pt ; ---- effect for pronouns only?
NPSep => consTag (tagNForm (NCase n Nom))(tagPerson p) pt ---- correct pro-drop effect?
} ;
tagDegreeAForm : Degree -> AForm -> Str = \d,af -> case af of {
AN nf => let ts = tagNForms nf in consTag ts.p1 (tagDegree d) ts.p2 ;
AAdv => consTag adverbTag (tagDegree d) ---- TODO: how is this in UD?