forked from GitHub/gf-rgl
Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl
This commit is contained in:
32
.github/workflows/test.yml
vendored
Normal file
32
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Check that the RGL can successfully build
|
||||
|
||||
on:
|
||||
push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
GF_VERSION: 3.11
|
||||
DEST: gf-rgl
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Download GF
|
||||
uses: dsaltares/fetch-gh-release-asset@1.1.1
|
||||
with:
|
||||
repo: 'GrammaticalFramework/gf-core'
|
||||
version: 'tags/${{ env.GF_VERSION }}'
|
||||
file: 'gf-${{ env.GF_VERSION }}-ubuntu-20.04.deb'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install GF
|
||||
run: |
|
||||
sudo dpkg -i gf-${GF_VERSION}-ubuntu-20.04.deb
|
||||
|
||||
- name: Build RGL
|
||||
run: |
|
||||
mkdir -p ${DEST}
|
||||
bash Setup.sh --dest=${DEST} --gf=gf --verbose
|
||||
@@ -30,7 +30,7 @@ resource ResFin = ParamX ** open Prelude in {
|
||||
|
||||
--- These cases are possible for subjects.
|
||||
|
||||
SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat ;
|
||||
SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat | SCAcc ;
|
||||
|
||||
oper
|
||||
appSubjCase : SubjCase -> ResFin.NP -> Str = \sc,np -> np.s ! subjcase2npform sc ;
|
||||
@@ -42,7 +42,8 @@ oper
|
||||
SCIness => NPCase Iness ;
|
||||
SCElat => NPCase Elat ;
|
||||
SCAdess => NPCase Adess ;
|
||||
SCAblat => NPCase Ablat
|
||||
SCAblat => NPCase Ablat ;
|
||||
SCAcc => NPAcc
|
||||
} ;
|
||||
|
||||
npform2subjcase : NPForm -> SubjCase = \sc -> case sc of {
|
||||
@@ -52,6 +53,7 @@ oper
|
||||
NPCase Elat => SCElat ;
|
||||
NPCase Adess => SCAdess ;
|
||||
NPCase Ablat => SCAblat ;
|
||||
NPAcc => SCAcc ;
|
||||
_ => SCNom
|
||||
} ;
|
||||
|
||||
|
||||
@@ -378,7 +378,8 @@ oper
|
||||
s = \\t,a,b =>
|
||||
let
|
||||
agrfin = case vp.sc of {
|
||||
SCNom => <agr,True> ;
|
||||
SCNom => <agr, True> ;
|
||||
SCAcc => <agrP3 Sg, True> ;
|
||||
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
||||
} ;
|
||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||
|
||||
@@ -79,7 +79,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
|
||||
) ** {c2 = vp.c2} ; ---- correct ??
|
||||
-}
|
||||
|
||||
SlashV2VNP = StemFin.slashV2VNP ; ---- compilation to pgf takes too long 6/8/2013 hence a simplified version in stemmed/
|
||||
----
|
||||
SlashV2VNP = StemFin.slashV2VNP ; ---- compilation to pgf takes too long 6/8/2013 hence a simplified version in stemmed/
|
||||
|
||||
AdvVP vp adv = insertAdv (\\_ => adv.s) vp ;
|
||||
ExtAdvVP vp adv = insertAdv (\\_ => embedInCommas adv.s) vp ;
|
||||
|
||||
59
src/finnish/infinitives/Infinitive.gf
Normal file
59
src/finnish/infinitives/Infinitive.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
abstract Infinitive =
|
||||
|
||||
Grammar - [VPSlashPrep], ---- to avoid certain spurious ambiguities, to be fixed
|
||||
Lexicon
|
||||
** {
|
||||
|
||||
flags startcat = Utt ;
|
||||
|
||||
data
|
||||
PresPartPassSubjVP : VP -> VP ; -- (minun) on mentävä
|
||||
PresPartPassObjVP : VPSlash -> VP ; -- (oluesta) on pidettävä
|
||||
|
||||
PastPartPassAdv : NP -> VP -> Adv ; -- junan mentyä
|
||||
|
||||
PresPartActAP : VP -> AP ; -- (lihaa) syövä
|
||||
PastPartActAP : VP -> AP ; -- (lihaa) syönyt
|
||||
PresPartPassAP : VPSlash -> AP ; -- (tänään) syötävä
|
||||
PastPartPassAP : VPSlash -> AP ; -- (tänään) syöty
|
||||
|
||||
AgentPartAP : NP -> VPSlash -> AP ; -- koiran syömä
|
||||
|
||||
|
||||
Inf2InessAdv : NP -> VP -> Adv ; -- junan mennessä
|
||||
|
||||
Inf2InessPassAdv : VP -> Adv ; -- odotettaessa (junaa), touhuttaessa (junan kanssa)
|
||||
Inf2InessPassInvAdv : NP -> VPSlash -> Adv ; -- junaa odotettaessa, junan kanssa touhutessa
|
||||
Inf2InstrAdv : VP -> Adv ; -- odottaen (junaa)
|
||||
Inf2InstrInvAdv : NP -> VPSlash -> Adv ; -- junaa odottaen
|
||||
|
||||
Inf2InstrAdv : VP -> Adv ; -- odottaen (junaa)
|
||||
Inf2InstrInvAdv : NP -> VPSlash -> Adv ; -- junaa odottaen
|
||||
|
||||
Inf3InessAdv : VP -> Adv ; -- odottamassa (junaa)
|
||||
Inf3InessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamassa
|
||||
|
||||
Inf3ElatAdv : VP -> Adv ; -- odottamasta (junaa)
|
||||
Inf3ElatInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamasta
|
||||
|
||||
Inf3IllatAdv : VP -> Adv ; -- odottamaan (junaa)
|
||||
Inf3IllatInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamaan
|
||||
|
||||
Inf3AdessAdv : VP -> Adv ; -- odottamalla (junaa)
|
||||
Inf3AdessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamalla
|
||||
|
||||
Inf3AbessAdv : VP -> Adv ; -- odottamatta (junaa)
|
||||
Inf3AbessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamatta
|
||||
|
||||
ComplPresPartActVS : VS -> NP -> VP -> VP ; -- sanoa junan menevän
|
||||
ComplPastPartActVS : VS -> NP -> VP -> VP ; -- sanoa junan menneen
|
||||
|
||||
ComplPresPartActAgrVS : VS -> VP -> VP ; -- sanoa menevänsä
|
||||
ComplPastPartActAgrVS : VS -> VP -> VP ; -- sanoa menneensä
|
||||
|
||||
ComplPresPartPassVS : VS -> NP -> VPSlash -> VP ; -- sanoa junaa odotettavan
|
||||
ComplPastPartPassVS : VS -> NP -> VPSlash -> VP ; -- sanoa junaa odotetun
|
||||
|
||||
|
||||
|
||||
}
|
||||
185
src/finnish/infinitives/InfinitiveFin.gf
Normal file
185
src/finnish/infinitives/InfinitiveFin.gf
Normal file
@@ -0,0 +1,185 @@
|
||||
--# -path=..:alltenses
|
||||
|
||||
concrete InfinitiveFin of Infinitive =
|
||||
GrammarFin - [VPSlashPrep],
|
||||
LexiconFin
|
||||
** open
|
||||
ResFin,
|
||||
StemFin,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
lin
|
||||
PresPartPassSubjVP vp = vp ** {
|
||||
s = vpVerbOlla ** {sc = SCGen} ;
|
||||
s2 = \\b,p,a => vp.s.s ! PresPartPass (AN (NCase Sg Nom)) ++ vp.s2 ! b ! p ! a ;
|
||||
} ;
|
||||
|
||||
PresPartPassObjVP vpslash = vpslash ** {
|
||||
s = vpVerbOlla ** {sc = npform2subjcase vpslash.c2.c} ;
|
||||
s2 = \\b,p,a => vpslash.c2.s.p2 ++ vpslash.s.s ! PresPartPass (AN (NCase Sg Nom)) ++ vpslash.s2 ! b ! p ! a ;
|
||||
} ;
|
||||
|
||||
PastPartPassAdv np vp = {
|
||||
s = np.s ! NPCase Gen ++
|
||||
vp.s.s ! PastPartPass (AN (NCase Sg Part)) ++
|
||||
vp.s2 ! True ! Pos ! np.a ++
|
||||
vp.adv ! Pos ++
|
||||
vp.ext
|
||||
} ;
|
||||
|
||||
PresPartActAP vp = {
|
||||
s = \\_, nf => preCompVP vp (PresPartAct (AN nf)) ;
|
||||
hasPrefix = False ;
|
||||
p = []
|
||||
} ;
|
||||
|
||||
PastPartActAP vp = {
|
||||
s = \\_, nf => preCompVP vp (PastPartAct (AN nf)) ;
|
||||
hasPrefix = False ;
|
||||
p = []
|
||||
} ;
|
||||
|
||||
PresPartPassAP vp = {
|
||||
s = \\_, nf => preCompVP <vp : VP> (PresPartPass (AN nf)) ;
|
||||
hasPrefix = False ;
|
||||
p = []
|
||||
} ;
|
||||
|
||||
PastPartPassAP vp = {
|
||||
s = \\_, nf => preCompVP <vp : VP> (PastPartPass (AN nf)) ;
|
||||
hasPrefix = False ;
|
||||
p = []
|
||||
} ;
|
||||
|
||||
AgentPartAP np vp = {
|
||||
s = \\_, nf =>
|
||||
np.s ! NPCase Gen ++
|
||||
vp.s2 ! True ! Pos ! np.a ++
|
||||
vp.adv ! Pos ++
|
||||
vp.c2.s.p2 ++
|
||||
vp.s.s ! AgentPart (AN nf) ++
|
||||
vp.ext ;
|
||||
hasPrefix = False ;
|
||||
p = []
|
||||
} ;
|
||||
|
||||
Inf2InessAdv np vp = {
|
||||
s = np.s ! NPCase Gen ++
|
||||
infVP SCNom Pos np.a vp Inf2Iness
|
||||
} ;
|
||||
|
||||
Inf2InessPassAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf2InessPass
|
||||
} ;
|
||||
|
||||
Inf2InessPassInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf2InessPass
|
||||
} ;
|
||||
|
||||
Inf2InstrAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf2Instr
|
||||
} ;
|
||||
|
||||
Inf2InstrInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf2Instr
|
||||
} ;
|
||||
|
||||
Inf3InessAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf3Iness
|
||||
} ;
|
||||
|
||||
Inf3InessInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf3Iness
|
||||
} ;
|
||||
|
||||
Inf3ElatAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf3Elat
|
||||
} ;
|
||||
|
||||
Inf3ElatInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf3Elat
|
||||
} ;
|
||||
|
||||
Inf3IllatAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf3Illat
|
||||
} ;
|
||||
|
||||
Inf3IllatInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf3Illat
|
||||
} ;
|
||||
|
||||
|
||||
Inf3AdessAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf3Adess
|
||||
} ;
|
||||
|
||||
Inf3AdessInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf3Adess
|
||||
} ;
|
||||
|
||||
|
||||
Inf3AbessAdv vp = {
|
||||
s = infVP SCNom Pos infAdvAgr vp Inf3Abess
|
||||
} ;
|
||||
|
||||
Inf3AbessInvAdv np vps = {
|
||||
s = infAppCompl vps.c2 np ++
|
||||
infVP SCNom Pos np.a <vps : VP> Inf3Abess
|
||||
} ;
|
||||
|
||||
ComplPresPartActVS vs np vp =
|
||||
insertExtrapos (subjPartVP np vp (NPCase Gen) (PresPartAct (AN (NCase Sg Gen)))) (predSV vs) ;
|
||||
ComplPastPartActVS vs np vp =
|
||||
insertExtrapos (subjPartVP np vp (NPCase Gen) (PastPartAct (AN (NCase Sg Gen)))) (predSV vs) ;
|
||||
|
||||
ComplPresPartActAgrVS vs vp =
|
||||
insertObj (\\_,_,agr => subjPartAgrVP vp (PresPartAct (AN (NPossGen Sg))) agr) (predSV vs) ;
|
||||
ComplPastPartActAgrVS vs vp =
|
||||
insertObj (\\_,_,agr => subjPartAgrVP vp (PastPartAct (AN (NPossGen Sg))) agr) (predSV vs) ;
|
||||
|
||||
ComplPresPartPassVS vs np vps =
|
||||
insertExtrapos (subjPartVP np <vps : VP> (NPCase Part) (PresPartPass (AN (NCase Sg Gen)))) (predSV vs) ;
|
||||
ComplPastPartPassVS vs np vps =
|
||||
insertExtrapos (subjPartVP np <vps : VP> (NPCase Part) (PastPartPass (AN (NCase Sg Gen)))) (predSV vs) ;
|
||||
|
||||
|
||||
|
||||
oper
|
||||
infAppCompl : Compl -> ResFin.NP -> Str = \co, np ->
|
||||
appCompl False Neg co np ; -- not fin, Acc becomes Part
|
||||
|
||||
infAdvAgr : Agr = agrP3 Sg ; --- ?
|
||||
|
||||
-- hänen syövän, häntä syödyn, häntä syötävän
|
||||
subjPartVP : ResFin.NP -> StemFin.VP -> NPForm -> VForm -> Str = \np, vp, npform, vform ->
|
||||
np.s ! NPCase Gen ++
|
||||
vp.s.s ! vform ++
|
||||
vp.s2 ! True ! Pos ! np.a ++
|
||||
vp.adv ! Pos ++
|
||||
vp.ext ;
|
||||
|
||||
-- tiedän syöväni, tiedän syöneeni
|
||||
subjPartAgrVP : StemFin.VP -> VForm -> Agr -> Str = \vp, vform, agr ->
|
||||
vp.s.s ! vform ++ BIND ++
|
||||
case vp.s.h of {Back => possSuffix agr ; Front => possSuffixFront agr} ++
|
||||
vp.s2 ! True ! Pos ! agr ++
|
||||
vp.adv ! Pos ++
|
||||
vp.ext ;
|
||||
|
||||
|
||||
-- ruohoa syövä, Ranskassa valmistettu
|
||||
preCompVP : StemFin.VP -> VForm -> Str = \vp, vform ->
|
||||
vp.s2 ! True ! Pos ! infAdvAgr ++
|
||||
vp.adv ! Pos ++
|
||||
vp.s.s ! vform ++
|
||||
vp.ext ;
|
||||
|
||||
|
||||
}
|
||||
@@ -266,7 +266,7 @@ lin
|
||||
can8know_VV = mkVV (mkV "varēt" third_conjugation) ;
|
||||
must_VV = mkVV (mkV "vajadzēt" third_conjugation Dat) ;
|
||||
|
||||
please_Voc = ss "lūdzu" ;
|
||||
please_Voc = ss ", lūdzu" ;
|
||||
|
||||
oper
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete ConstructionMay of Construction = CatMay ** open ParadigmsMay, (L=LexiconMay), SyntaxMay in {
|
||||
concrete ConstructionMay of Construction = CatMay ** open ParadigmsMay, (L=LexiconMay), (G=GrammarMay) in {
|
||||
|
||||
lincat
|
||||
Timeunit = N ;
|
||||
@@ -9,18 +9,13 @@ lincat
|
||||
|
||||
lin
|
||||
|
||||
has_age_VP card = mkVP umur_V2 (mkNP <lin Card card : Card> L.year_N) ;
|
||||
has_age_VP card = G.ComplSlash (G.SlashV2a umur_V2) (G.DetCN (G.DetQuant G.IndefArt (G.NumCard card)) (G.UseN L.year_N)) ;
|
||||
|
||||
oper
|
||||
umur_V2 : V2 = mkV2 (mkV "umur") noPrep ;
|
||||
|
||||
{-
|
||||
|
||||
timeunitAdv n time =
|
||||
let n_card : Card = n ;
|
||||
n_hours_NP : NP = mkNP n_card time ;
|
||||
in SyntaxMay.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ;
|
||||
|
||||
weekdayPunctualAdv w = ; -- on Sunday
|
||||
weekdayHabitualAdv w = ; -- on Sundays
|
||||
weekdayNextAdv w = -- next Sunday
|
||||
|
||||
Reference in New Issue
Block a user