Latvian: 1) added some extra things that are used by the Attempto grammar; 2) added notpresent tags; 3) compiles with Setup.hs and lib/src/Make.hs

This commit is contained in:
normundsg
2012-02-20 02:42:07 +00:00
parent 30d3fc8b4d
commit 1966ce5eb6
13 changed files with 157 additions and 106 deletions

View File

@@ -206,6 +206,7 @@ langsCoding = [
(("interlingua","Ina"),""), (("interlingua","Ina"),""),
(("italian", "Ita"),""), (("italian", "Ita"),""),
(("latin", "Lat"),""), (("latin", "Lat"),""),
(("latvian", "Lav"),""),
(("norwegian","Nor"),""), (("norwegian","Nor"),""),
(("polish", "Pol"),""), (("polish", "Pol"),""),
(("punjabi", "Pnb"),""), (("punjabi", "Pnb"),""),
@@ -234,7 +235,7 @@ langsAPI = langsLang `except` ["Hin","Ina","Tha"]
langsSymbolic = langsAPI -- `except` ["Rus"] langsSymbolic = langsAPI -- `except` ["Rus"]
-- languages for which to run demo test -- languages for which to run demo test
langsDemo = langsLang `except` ["Ara","Hin","Ina","Tha"] langsDemo = langsLang `except` ["Ara","Hin","Ina","Lav","Tha"]
-- languages for which to compile parsing grammars -- languages for which to compile parsing grammars
langsParse = langs `only` ["Eng"] langsParse = langs `only` ["Eng"]
@@ -243,7 +244,7 @@ langsParse = langs `only` ["Eng"]
langsPGF = langsLang `except` ["Ara","Hin","Ron","Tha"] langsPGF = langsLang `except` ["Ara","Hin","Ron","Tha"]
-- languages for which Compatibility exists (to be extended) -- languages for which Compatibility exists (to be extended)
langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Spa","Swe"] langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Lav","Spa","Swe"]
gfc modes pkg lbi file = sequence_ [gfc1 mode pkg lbi file | mode<-modes] gfc modes pkg lbi file = sequence_ [gfc1 mode pkg lbi file | mode<-modes]
gfc1 mode pkg lbi file = do gfc1 mode pkg lbi file = do

View File

@@ -21,7 +21,7 @@ import System.Exit
default_gf = "../../dist/build/gf/gf" default_gf = "../../dist/build/gf/gf"
presApiPath = "-path=api:present" presApiPath = "-path=api:present:../present"
presSymbolPath = "" -- "-path=.:abstract:present:common:romance:scandinavian" ---- presSymbolPath = "" -- "-path=.:abstract:present:common:romance:scandinavian" ----
-- the languages have long directory names and short ISO codes (3 letters) -- the languages have long directory names and short ISO codes (3 letters)
@@ -70,7 +70,7 @@ langsLangAll = langs
langsLang = langs `except` langsIncomplete langsLang = langs `except` langsIncomplete
-- languagues that have notpresent marked -- languagues that have notpresent marked
langsPresent = langsLang `except` ["Lav","Nep","Pes","Tha"] langsPresent = langsLang `except` ["Nep","Pes","Tha"]
-- languages for which Lang can be compiled but which are incomplete -- languages for which Lang can be compiled but which are incomplete
langsIncomplete = ["Amh","Ara","Hin","Lat","Tur"] langsIncomplete = ["Amh","Ara","Hin","Lat","Tur"]
@@ -79,16 +79,16 @@ langsIncomplete = ["Amh","Ara","Hin","Lat","Tur"]
langsAPI = langsLang `except` langsIncomplete langsAPI = langsLang `except` langsIncomplete
-- languages for which to compile Symbolic -- languages for which to compile Symbolic
langsSymbolic = langsLang `except` (langsIncomplete ++ ["Afr","Ina","Lav","Nep","Pes","Pnb","Rus"]) langsSymbolic = langsLang `except` (langsIncomplete ++ ["Afr","Ina","Nep","Pes","Pnb","Rus"])
-- languages for which to compile minimal Syntax -- languages for which to compile minimal Syntax
langsMinimal = langs `only` ["Ara","Eng","Bul","Rus"] langsMinimal = langs `only` ["Ara","Eng","Bul","Rus"]
-- languages for which to run treebank test -- languages for which to run treebank test
langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Rus","Spa","Tha"] langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Lav","Rus","Spa","Tha"]
-- languages for which to run demo test -- languages for which to run demo test
langsDemo = langsLang `except` ["Ara","Hin","Ina","Lat","Tha"] langsDemo = langsLang `except` ["Ara","Hin","Ina","Lat","Lav","Tha"]
-- languages for which to compile parsing grammars -- languages for which to compile parsing grammars
langsParse = langs `only` ["Eng"] langsParse = langs `only` ["Eng"]
@@ -97,7 +97,7 @@ langsParse = langs `only` ["Eng"]
langsPGF = langsTest `only` ["Eng","Fre","Swe"] langsPGF = langsTest `only` ["Eng","Fre","Swe"]
-- languages for which Compatibility exists (to be extended) -- languages for which Compatibility exists (to be extended)
langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Spa","Swe"] langsCompat = langsLang `only` ["Cat","Eng","Fin","Fre","Ita","Lav","Spa","Swe"]
treebankExx = "exx-resource.gft" treebankExx = "exx-resource.gft"
treebankResults = "exx-resource.gftb" treebankResults = "exx-resource.gftb"

View File

@@ -0,0 +1,5 @@
--# -path=.:present:mathematical:prelude:../latvian
resource SymbolicLav = Symbolic with
(Symbol = SymbolLav),
(Grammar = GrammarLav) ;

View File

@@ -1,8 +1,11 @@
--# -path=.:../abstract:../common:../prelude --# -path=.:../abstract:../common:../prelude
concrete ExtraLav of ExtraLavAbs = CatLav ** { concrete ExtraLav of ExtraLavAbs = CatLav ** open ResLav in {
flags flags
coding = utf8 ; coding = utf8 ;
lin
GenNP np = {s = \\_,_,_ => np.s ! Gen ; d = Def} ;
} }

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:../prelude --# -path=.:../abstract:../common:../prelude
abstract ExtraLavAbs = {} abstract ExtraLavAbs = Extra ** {}

View File

@@ -58,11 +58,9 @@ lin
s = s =
vp.v.s ! Pos ! (Indicative P1 Pl Pres) ++ -- Verb vp.v.s ! Pos ! (Indicative P1 Pl Pres) ++ -- Verb
vp.s2 ! a -- Object(s), complements, adverbial modifiers vp.s2 ! a -- Object(s), complements, adverbial modifiers
} | { }
s = | { s = vp.v.s ! Pos ! (Indicative P1 Pl Fut) ++ vp.s2 ! a } --# notpresent
vp.v.s ! Pos ! (Indicative P1 Pl Fut) ++ ;
vp.s2 ! a
} ;
ImpP3 np vp = { ImpP3 np vp = {
s = "lai" ++ np.s ! Nom ++ buildVerb vp.v (Ind Simul Pres) Pos np.a ++ vp.s2 ! np.a ; s = "lai" ++ np.s ! Nom ++ buildVerb vp.v (Ind Simul Pres) Pos np.a ++ vp.s2 ! np.a ;

View File

@@ -0,0 +1,15 @@
--# -path=.:../common:../abstract
resource MakeStructuralLav = open CatLav, ParadigmsLav, ResLav, Prelude in {
flags
coding = utf8 ;
oper
mkSubj : Str -> Subj = \x ->
lin Subj {s = x} ;
mkIDet : Str -> ParadigmsLav.Number -> IDet = \s,n ->
lin IDet {s = \\_ => s ; n = n} ;
}

View File

@@ -32,6 +32,14 @@ flags
coding = utf8 ; coding = utf8 ;
oper oper
Number : Type ;
singular : Number ;
plural : Number ;
Number = ResLav.Number ;
singular = Sg ;
plural = Pl ;
second_conjugation : VerbConj = C2 ; second_conjugation : VerbConj = C2 ;
third_conjugation : VerbConj = C3 ; third_conjugation : VerbConj = C3 ;

View File

@@ -32,11 +32,24 @@ param
-- Deb = Debitive (Latvian specific: http://www.isocat.org/rest/dc/3835) -- Deb = Debitive (Latvian specific: http://www.isocat.org/rest/dc/3835)
-- Condit = Conditional -- Condit = Conditional
-- DebitiveRelative = the relative subtype of debitive -- DebitiveRelative = the relative subtype of debitive
VerbForm = Infinitive | Indicative Person Number Tense | Relative Tense | Debitive | VerbForm =
Imperative Number | DebitiveRelative | Participle Gender Number Case ; Infinitive
| Indicative Person Number Tense
| Relative Tense
| Debitive
| Imperative Number
| DebitiveRelative
| Participle Gender Number Case
;
-- TODO: divdabim noteiktā forma un arī pārākā / vispārākā pakāpe -- TODO: divdabim noteiktā forma un arī pārākā / vispārākā pakāpe
VerbMood = Ind Anteriority Tense | Rel Anteriority Tense | Deb Anteriority Tense | Condit Anteriority ; VerbMood =
Ind Anteriority Tense
| Rel Anteriority Tense --# notpresent
| Deb Anteriority Tense --# notpresent
| Condit Anteriority --# notpresent
;
VerbConj = C2 | C3 ; VerbConj = C2 | C3 ;
--Agr = Ag Gender Number ; --Agr = Ag Gender Number ;

View File

@@ -42,8 +42,9 @@ lin
UseQCl t p cl = { s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p } ; UseQCl t p cl = { s = t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p } ;
UseRCl t p cl = UseRCl t p cl =
{ s = \\ag => t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p ! ag } | { s = \\ag => t.s ++ p.s ++ cl.s ! (Ind t.a t.t) ! p.p ! ag }
{ s = \\ag => t.s ++ p.s ++ cl.s ! (Rel t.a t.t) ! p.p ! ag } ; | { s = \\ag => t.s ++ p.s ++ cl.s ! (Rel t.a t.t) ! p.p ! ag } --# notpresent
;
UseSlash t p slash = { s = t.s ++ p.s ++ slash.s ! (Ind t.a t.t) ! p.p ; p = slash.p } ; UseSlash t p slash = { s = t.s ++ p.s ++ slash.s ! (Ind t.a t.t) ! p.p ; p = slash.p } ;
@@ -55,7 +56,7 @@ oper
s = \\mood,pol => s = \\mood,pol =>
case mood of { -- Subject case mood of { -- Subject
-- FIXME: jāčeko valences, reizēm arī īstenības izteiksmē - 'man patīk kaut kas' -- FIXME: jāčeko valences, reizēm arī īstenības izteiksmē - 'man patīk kaut kas'
Deb _ _ => np.s ! Dat ; Deb _ _ => np.s ! Dat ; --# notpresent
_ => np.s ! Nom _ => np.s ! Nom
} ++ } ++
buildVerb vp.v mood pol np.a ++ -- Verb buildVerb vp.v mood pol np.a ++ -- Verb

View File

@@ -450,37 +450,4 @@ oper
no_Utt = ss "nē" ; no_Utt = ss "nē" ;
{-
can8know_VV, can_VV = {
s = table {
VVF VInf => ["be able to"] ;
VVF VPres => "can" ;
VVF VPPart => ["been able to"] ;
VVF VPresPart => ["being able to"] ;
VVF VPast => "could" ; --# notpresent
VVPastNeg => "couldn't" ; --# notpresent
VVPresNeg => "can't"
} ;
isAux = True
} ;
must_VV = {
s = table {
VVF VInf => ["have to"] ;
VVF VPres => "must" ;
VVF VPPart => ["had to"] ;
VVF VPresPart => ["having to"] ;
VVF VPast => ["had to"] ; --# notpresent
VVPastNeg => ["hadn't to"] ; --# notpresent
VVPresNeg => "mustn't"
} ;
isAux = True
} ;
not_Predet = {s = "not" ; lock_Predet = <>} ;
no_Quant = mkQuant "no" "no" "none" "none" ;
have_V2 = dirV2 (mk5V "have" "has" "had" "had" "having") ;
-}
} }

View File

@@ -8,4 +8,38 @@ concrete SymbolLav of Symbol = CatLav ** open
flags flags
coding = utf8 ; coding = utf8 ;
lin
SymbPN i = {s = \\_ => i.s ; g = Masc ; n = Sg} ;
IntPN i = {s = \\_ => i.s ; g = Masc ; n = Pl} ;
FloatPN i = {s = \\_ => i.s ; g = Masc ; n = Pl} ;
NumPN i = {s = \\_ => i.s ! Masc ! Nom ; g = Masc ; n = Pl} ;
CNIntNP cn i = {
s = \\_ => cn.s ! Indef ! Sg ! Nom ++ i.s ;
a = agrgP3 Sg cn.g
} ;
CNSymbNP det cn xs = {
s = \\_ => det.s ! cn.g ! Nom ++ cn.s ! det.d ! det.n ! Nom ++ xs.s ;
a = agrgP3 det.n cn.g
} ;
CNNumNP cn i = {
s = \\_ => cn.s ! Indef ! Sg ! Nom ++ i.s ! Masc ! Nom ;
a = agrgP3 Sg cn.g
} ;
SymbS sy = sy ;
SymbNum sy = { s = \\_,_ => sy.s ; n = Pl } ;
SymbOrd sy = { s = \\_,_ => sy.s ++ "."} ;
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "un" ;
ConsSymb = infixSS "," ;
} }

View File

@@ -6,6 +6,7 @@
-- Not so simple since morphology itself needs ResLav & friends. -- Not so simple since morphology itself needs ResLav & friends.
concrete VerbLav of Verb = CatLav ** open concrete VerbLav of Verb = CatLav ** open
ParamX,
ResLav, ResLav,
ParadigmsVerbsLav, ParadigmsVerbsLav,
StructuralLav StructuralLav
@@ -74,22 +75,27 @@ oper
buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Str = \v,mood,pol,ag -> buildVerb : Verb -> VerbMood -> Polarity -> Agr -> Str = \v,mood,pol,ag ->
let let
ag = fromAgr ag ; ag = fromAgr ag
part = v.s ! ResLav.Pos ! (Participle ag.g ag.n Nom) ; --# notpresent
part = v.s ! ResLav.Pos ! (Participle ag.g ag.n Nom) --# notpresent
in case mood of { in case mood of {
Ind Simul tense => v.s ! pol ! (Indicative ag.p ag.n tense) ; Ind Simul tense => v.s ! pol ! (Indicative ag.p ag.n tense)
Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n tense) ++ part ; ; --# notpresent
Ind Anter tense => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n tense) ++ part ; --# notpresent
Rel _ Past => ResLav.NON_EXISTENT ; -- FIXME (?) -- FIXME(?): Rel _ Past => ...
Rel Simul tense => v.s ! pol ! (Relative tense) ; Rel _ Past => ResLav.NON_EXISTENT ; --# notpresent
Rel Anter tense => mkVerb_toBe.s ! pol ! (Relative tense) ++ part ; Rel Simul tense => v.s ! pol ! (Relative tense) ; --# notpresent
Rel Anter tense => mkVerb_toBe.s ! pol ! (Relative tense) ++ part ; --# notpresent
Deb Simul tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++ v.s ! ResLav.Pos ! Debitive ; Deb Simul tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++ --# notpresent
Deb Anter tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++ v.s ! ResLav.Pos ! Debitive ; --# notpresent
mkVerb_toBe.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ v.s ! ResLav.Pos ! Debitive ; Deb Anter tense => mkVerb_toBe.s ! pol ! (Indicative P3 Sg tense) ++ --# notpresent
mkVerb_toBe.s ! ResLav.Pos ! (Participle Masc Sg Nom) ++ --# notpresent
v.s ! ResLav.Pos ! Debitive ; --# notpresent
Condit Simul => v.s ! pol ! (Indicative ag.p ag.n Cond) ; Condit Simul => v.s ! pol ! (Indicative ag.p ag.n ParamX.Cond) ; --# notpresent
Condit Anter => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n Cond) ++ part Condit Anter => mkVerb_toBe.s ! pol ! (Indicative ag.p ag.n ParamX.Cond) ++ part --# notpresent
} ; } ;
-- TODO: nav testēts -- TODO: nav testēts