Finnish negation particle stored in VP for vowel harmony

This commit is contained in:
aarne
2008-06-22 18:33:15 +00:00
parent 29a677730b
commit f283528094
9 changed files with 47 additions and 21 deletions

View File

@@ -95,6 +95,6 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
N3 = {s : NForm => Str} ** {c2,c3 : Compl} ; N3 = {s : NForm => Str} ** {c2,c3 : Compl} ;
PN = {s : Case => Str} ; PN = {s : Case => Str} ;
oper Verb1 = {s : VForm => Str ; sc : NPForm} ; oper Verb1 = {s : VForm => Str ; sc : NPForm ; qp : Str} ;
} }

View File

@@ -41,7 +41,8 @@ concrete IdiomFin of Idiom = CatFin **
s = \\_ => vp.s ! VIPass ; s = \\_ => vp.s ! VIPass ;
s2 = vp.s2 ; s2 = vp.s2 ;
ext = vp.ext ; ext = vp.ext ;
sc = vp.sc sc = vp.sc ;
qp = vp.qp
} ; } ;
ProgrVP vp = ProgrVP vp =
@@ -52,7 +53,8 @@ concrete IdiomFin of Idiom = CatFin **
s = on.s ; s = on.s ;
s2 = \\b,p,a => inf ++ vp.s2 ! b ! p ! a ; s2 = \\b,p,a => inf ++ vp.s2 ! b ! p ! a ;
ext = vp.ext ; ext = vp.ext ;
sc = vp.sc sc = vp.sc ;
qp = vp.qp
} ; } ;
-- This gives "otetaan oluet" instead of "ottakaamme oluet". -- This gives "otetaan oluet" instead of "ottakaamme oluet".
@@ -66,7 +68,7 @@ concrete IdiomFin of Idiom = CatFin **
} ; } ;
oper oper
olla = verbOlla ** {sc = NPCase Nom} ; olla = verbOlla ** {sc = NPCase Nom ; qp = "ko"} ;
noSubj : Polarity -> Str = \_ -> [] ; noSubj : Polarity -> Str = \_ -> [] ;
} }

View File

@@ -683,7 +683,7 @@ resource MorphoFin = ResFin ** open Prelude in {
11 => lienee 11 => lienee
} ; } ;
vforms2V : VForms -> Verb = \vh -> vforms2V : VForms -> Verb ** {qp : Str} = \vh ->
let let
tulla = vh ! 0 ; tulla = vh ! 0 ;
tulen = vh ! 1 ; tulen = vh ! 1 ;
@@ -748,6 +748,7 @@ resource MorphoFin = ResFin ** open Prelude in {
Inf Inf3Abess => tulema + "tt" + a Inf Inf3Abess => tulema + "tt" + a
} ; } ;
sc = NPCase Nom ; sc = NPCase Nom ;
qp = Predef.dp 2 tulko ;
lock_V = <> lock_V = <>
} ; } ;

View File

@@ -473,8 +473,11 @@ oper
huusin,huusi,huusisi,huutanut,huudettu,huutanee : Str) -> V = mk12V ; huusin,huusi,huusisi,huutanut,huudettu,huutanee : Str) -> V = mk12V ;
} ; } ;
mk1V : Str -> V = \s -> vforms2V (vForms1 s) ** {sc = NPCase Nom ; lock_V = <>} ; mk1V : Str -> V = \s ->
mk2V : (_,_ : Str) -> V = \x,y -> vforms2V (vForms2 x y) ** {sc = NPCase Nom ; lock_V = <>} ; let vfs = vforms2V (vForms1 s) in
vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk2V : (_,_ : Str) -> V = \x,y ->
let vfs = vforms2V (vForms2 x y) in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk3V : (huutaa,huudan,huusi : Str) -> V = \x,_,y -> mk2V x y ; ---- mk3V : (huutaa,huudan,huusi : Str) -> V = \x,_,y -> mk2V x y ; ----
mk12V : ( mk12V : (
huutaa,huudan,huutaa,huutavat,huutakaa,huudetaan, huutaa,huudan,huutaa,huutavat,huutakaa,huudetaan,
@@ -543,9 +546,9 @@ oper
caseV c v = {s = v.s ; sc = NPCase c ; lock_V = <>} ; caseV c v = {s = v.s ; sc = NPCase c ; qp = v.qp ; lock_V = <>} ;
vOlla = verbOlla ** {sc = NPCase Nom ; lock_V = <>} ; vOlla = verbOlla ** {sc = NPCase Nom ; qp = "ko" ; lock_V = <>} ; ---- lieneekö
mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ; mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ; caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;

View File

@@ -31,7 +31,7 @@ concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
QuestIComp icomp np = { QuestIComp icomp np = {
s = \\t,a,p => s = \\t,a,p =>
let let
vp = predV (verbOlla ** {sc = NPCase Nom}) ; vp = predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"}) ;
cl = mkClause (subjForm np vp.sc) np.a vp ; cl = mkClause (subjForm np vp.sc) np.a vp ;
in in
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl

View File

@@ -159,10 +159,11 @@ oper
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ; s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
ext : Str ; ext : Str ;
sc : NPForm sc : NPForm ;
qp : Str
} ; } ;
predV : (Verb ** {sc : NPForm}) -> VP = \verb -> { predV : (Verb ** {sc : NPForm ; qp : Str}) -> VP = \verb -> {
s = \\vi,ant,b,agr => s = \\vi,ant,b,agr =>
let let
@@ -220,21 +221,24 @@ oper
s2 = \\_,_,_ => [] ; s2 = \\_,_,_ => [] ;
ext = [] ; ext = [] ;
sc = verb.sc sc = verb.sc ;
qp = verb.qp
} ; } ;
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp -> { insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ; s = vp.s ;
s2 = \\fin,b,a => obj ! fin ! b ! a ++ vp.s2 ! fin ! b ! a ; s2 = \\fin,b,a => obj ! fin ! b ! a ++ vp.s2 ! fin ! b ! a ;
ext = vp.ext ; ext = vp.ext ;
sc = vp.sc sc = vp.sc ;
qp = vp.qp
} ; } ;
insertExtrapos : Str -> VP -> VP = \obj,vp -> { insertExtrapos : Str -> VP -> VP = \obj,vp -> {
s = vp.s ; s = vp.s ;
s2 = vp.s2 ; s2 = vp.s2 ;
ext = vp.ext ++ obj ; ext = vp.ext ++ obj ;
sc = vp.sc sc = vp.sc ;
qp = vp.qp
} ; } ;
-- For $Sentence$. -- For $Sentence$.
@@ -257,7 +261,7 @@ oper
in in
case o of { case o of {
SDecl => subj ++ verb.fin ++ verb.inf ++ compl ; SDecl => subj ++ verb.fin ++ verb.inf ++ compl ;
SQuest => questPart verb.fin ++ subj ++ verb.inf ++ compl SQuest => questPart vp a b verb.fin ++ subj ++ verb.inf ++ compl
} }
} ; } ;
@@ -266,7 +270,14 @@ oper
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b -> subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
appCompl False b {s = [] ; c = sc ; isPre = True} np ; appCompl False b {s = [] ; c = sc ; isPre = True} np ;
questPart : Str -> Str = \on -> on ++ BIND ++ "ko" ; ---- questPart : VP -> Anteriority -> Polarity -> Str -> Str = \vp,a,p,on -> on ++ BIND ++
case p of {
Neg => "kö" ; -- eikö tule
_ => case a of {
Anter => "ko" ; -- onko mennyt
_ => vp.qp -- tuleeko, meneekö
}
} ;
infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str =
\sc,pol,agr,vp,vi -> \sc,pol,agr,vp,vi ->

View File

@@ -23,7 +23,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
sc = case vp.sc of { sc = case vp.sc of {
NPCase Nom => v.sc ; -- minun täytyy pestä auto NPCase Nom => v.sc ; -- minun täytyy pestä auto
c => c -- minulla täytyy olla auto c => c -- minulla täytyy olla auto
} } ;
qp = v.qp
} }
) ; ) ;
@@ -51,7 +52,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
ComplSlash vp np = insertObj (\\fin,b,_ => appCompl fin b vp.c2 np) vp ; ComplSlash vp np = insertObj (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
UseComp comp = UseComp comp =
insertObj (\\_,_ => comp.s) (predV (verbOlla ** {sc = NPCase Nom})) ; insertObj (\\_,_ => comp.s) (predV (verbOlla ** {sc = NPCase Nom ; qp = "ko"})) ;
SlashVV v vp = SlashVV v vp =
insertObj insertObj
@@ -60,7 +61,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
sc = case vp.sc of { sc = case vp.sc of {
NPCase Nom => v.sc ; -- minun täytyy pestä auto NPCase Nom => v.sc ; -- minun täytyy pestä auto
c => c -- minulla täytyy olla auto c => c -- minulla täytyy olla auto
} } ;
qp = v.qp
} }
) ** {c2 = vp.c2} ; ---- correct ?? ) ** {c2 = vp.c2} ; ---- correct ??
@@ -79,6 +81,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
s = \\_ => vp.s ! VIPass ; s = \\_ => vp.s ! VIPass ;
s2 = \\_,_,_ => [] ; s2 = \\_,_,_ => [] ;
ext = [] ; ext = [] ;
qp = v.qp ;
sc = v.c2.c -- minut valitaan ; minua rakastetaan ; minulle kuiskataan sc = v.c2.c -- minut valitaan ; minua rakastetaan ; minulle kuiskataan
} ; ---- talon valitaan: should be marked like inf. } ; ---- talon valitaan: should be marked like inf.

View File

@@ -343,6 +343,7 @@ allCommands pgf = Map.fromList [
exec = \opts -> return . fromString . stringOps opts . toString, exec = \opts -> return . fromString . stringOps opts . toString,
options = [ options = [
("bind","bind tokens separated by Prelude.BIND, i.e. &+"), ("bind","bind tokens separated by Prelude.BIND, i.e. &+"),
("chars","lexer that makes every non-space character a token"),
("from_devanagari","from unicode to GF Devanagari transliteration"), ("from_devanagari","from unicode to GF Devanagari transliteration"),
("from_thai","from unicode to GF Thai transliteration"), ("from_thai","from unicode to GF Thai transliteration"),
("from_utf8","decode from utf8"), ("from_utf8","decode from utf8"),
@@ -355,6 +356,7 @@ allCommands pgf = Map.fromList [
("unlextext","text-like unlexer"), ("unlextext","text-like unlexer"),
("unlexcode","code-like unlexer"), ("unlexcode","code-like unlexer"),
("unlexmixed","mixture of text and code (code between $...$)"), ("unlexmixed","mixture of text and code (code between $...$)"),
("unchars","unlexer that puts no spaces between tokens"),
("unwords","unlexer that puts a single space between tokens (default)"), ("unwords","unlexer that puts a single space between tokens (default)"),
("words","lexer that assumes tokens separated by spaces (default)") ("words","lexer that assumes tokens separated by spaces (default)")
] ]
@@ -499,7 +501,7 @@ allCommands pgf = Map.fromList [
_ | isOpt "treebank" opts -> treebank opts t _ | isOpt "treebank" opts -> treebank opts t
_ -> unlines [linear opts lang t | lang <- optLangs opts] _ -> unlines [linear opts lang t | lang <- optLangs opts]
linear opts lang = case opts of linear opts lang = unlex opts lang . case opts of
_ | isOpt "all" opts -> allLinearize pgf (mkCId lang) _ | isOpt "all" opts -> allLinearize pgf (mkCId lang)
_ | isOpt "table" opts -> tableLinearize pgf (mkCId lang) _ | isOpt "table" opts -> tableLinearize pgf (mkCId lang)
_ | isOpt "term" opts -> termLinearize pgf (mkCId lang) _ | isOpt "term" opts -> termLinearize pgf (mkCId lang)
@@ -510,6 +512,8 @@ allCommands pgf = Map.fromList [
(abstractName pgf ++ ": " ++ showTree t) : (abstractName pgf ++ ": " ++ showTree t) :
[lang ++ ": " ++ linear opts lang t | lang <- optLangs opts] [lang ++ ": " ++ linear opts lang t | lang <- optLangs opts]
unlex opts lang = stringOps opts
optRestricted opts = restrictPGF (hasLin pgf (mkCId (optLang opts))) pgf optRestricted opts = restrictPGF (hasLin pgf (mkCId (optLang opts))) pgf
optLangs opts = case valIdOpts "lang" "" opts of optLangs opts = case valIdOpts "lang" "" opts of

View File

@@ -9,11 +9,13 @@ import Data.Char
stringOp :: String -> Maybe (String -> String) stringOp :: String -> Maybe (String -> String)
stringOp name = case name of stringOp name = case name of
"chars" -> Just $ appLexer (filter (not . all isSpace) . map return)
"lextext" -> Just $ appLexer lexText "lextext" -> Just $ appLexer lexText
"lexcode" -> Just $ appLexer lexText "lexcode" -> Just $ appLexer lexText
"lexmixed" -> Just $ appLexer lexMixed "lexmixed" -> Just $ appLexer lexMixed
"words" -> Just $ appLexer words "words" -> Just $ appLexer words
"bind" -> Just $ appUnlexer bindTok "bind" -> Just $ appUnlexer bindTok
"uncars" -> Just $ appUnlexer concat
"unlextext" -> Just $ appUnlexer unlexText "unlextext" -> Just $ appUnlexer unlexText
"unlexcode" -> Just $ appUnlexer unlexCode "unlexcode" -> Just $ appUnlexer unlexCode
"unlexmixed" -> Just $ appUnlexer unlexMixed "unlexmixed" -> Just $ appUnlexer unlexMixed