Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexicon for use case #413

Merged
merged 7 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions lib/haskell/natural4/grammars/CustomSyntax.gf
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
abstract CustomSyntax =
Numeral
, Grammar [
N, N2, CN, UseN, NP, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, A, A2, AP, AdjCN, PositA
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP, UseV
, A, A2, AP, AdjCN, PositA, ComplA2
, Comp, Adv, VP, UseComp, CompNP, CompAP, CompAdv -- is a public agency
, Prep, PrepNP, AdvVP
, AdA, AdAdv
, AdA, AdAdv, Card, CAdv, AdN, AdNum, AdnCAdv
, Dig, Digits, NumDigits, IDig, IIDig, D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9
, ListAdv, BaseAdv, ConsAdv, ConjAdv
, ListAP, BaseAP, ConsAP, ConjAP
, ListNP, BaseNP, ConsNP, ConjNP
, ListS, BaseS, ConsS, ConjS
, S, QS, Conj
, S, QS, Conj, Subj, SubjS
, RS, RP, IdRP, RelCN
]
, Structural [
Prep, to_Prep, for_Prep, from_Prep, on_Prep, before_Prep, after_Prep, possess_Prep
, VV, must_VV
, AdN, CAdv, less_CAdv, more_CAdv, at_least_AdN, at_most_AdN
, Subj, because_Subj
]
, Extend [
VPS, MkVPS, ListVPS, BaseVPS, ConsVPS, ConjVPS
, VPI, MkVPI --, [VPI], BaseVPI, ConsVPI, ConjVPI
, VP, Tense, Ant, Temp, Pol, Conj -- for VPS
-- , GenRP -- nice to have in the future?
, ByVP
, S, PredVPS
, NP, GerundNP
, ByVP, N, CompoundN
, S, PredVPS, RelVPS
, NP, GerundNP, Num, GenModNP
] ** {

-----------------------------------------------------------------------------
Expand Down Expand Up @@ -55,7 +59,9 @@ abstract CustomSyntax =
MayHave : VP -> VPS ; -- getting "may have occurred" with pure RGL is a pain

ReferenceNP : NP -> S ; -- it is NP — reference to a previous NP
WhileDoing : VP -> Adv ; -- while travelling in a public transport
-- ExpletiveVP : VP -> S ; -- it is raining — dummy subject it (TODO: restrict usage of this and above from HS)
CNwhereS : CN -> NP -> VPS -> CN ; -- premise where school activities take place

presAnt, -- has occurred
presSimul, -- occurs
Expand All @@ -68,6 +74,7 @@ abstract CustomSyntax =
theSg : Det ;
thePl : Det ;
aSg : Det ;
aPl : Det ;
your : Det ;

about_Prep : Prep ;
Expand Down
18 changes: 11 additions & 7 deletions lib/haskell/natural4/grammars/CustomSyntaxChi.gf
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
concrete CustomSyntaxChi of CustomSyntax =
NumeralChi
, GrammarChi [
N, N2, CN, UseN, NP, Det, DetCN, MassNP
, V, VV, V2, VS, VP, AdvVP
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP, UseV, AdvVP
, A, A2, AP, PositA
, Comp, Adv, VP, UseComp, CompAP, CompAdv -- is a public agency
, AdA, AdAdv -- only (within the organisation)
, AdA, AdAdv, Card, CAdv, AdN, AdNum, AdnCAdv
, Dig, Digits, NumDigits, IDig, IIDig, D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 -- only (within the organisation)
, ListAdv, BaseAdv, ConsAdv, ConjAdv
, ListAP, BaseAP, ConsAP, ConjAP
, ListNP, BaseNP, ConsNP, ConjNP
, ListS, BaseS, ConsS, ConjS
, S, QS, Conj
, S, QS, Conj, Subj, SubjS
, RS, RP, IdRP, RelCN
]
, StructuralChi [
VV, must_VV
, AdN, CAdv, less_CAdv, more_CAdv, at_least_AdN, at_most_AdN
, Subj, because_Subj
]
, ExtendChi [
VPS, MkVPS, mkVPS, ListVPS, BaseVPS, ConsVPS, ConjVPS, baseVPS
, VPI, MkVPI, mkVPI --, [VPI], BaseVPI, ConsVPI, ConjVPI
, VP, Tense, Ant, Temp, Pol, Conj -- for VPS
, ByVP
, S, PredVPS
, NP, GerundNP -- by performing NDB qualification
, ByVP, N, CompoundN
, S, PredVPS, RelVPS
, NP, GerundNP, Num, GenModNP -- by performing NDB qualification
]
** open
SyntaxChi
Expand Down
23 changes: 15 additions & 8 deletions lib/haskell/natural4/grammars/CustomSyntaxEng.gf
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
concrete CustomSyntaxEng of CustomSyntax =
NumeralEng
, GrammarEng [
N, N2, CN, UseN, NP, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, A, A2, AP, AdjCN, PositA
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP, UseV
, A, A2, AP, AdjCN, PositA, ComplA2
, Comp, Adv, VP, UseComp, CompAP, CompNP, CompAdv -- is a public agency
, Prep, PrepNP, AdvVP
, AdA, AdAdv -- only (within the organisation)
, AdA, AdAdv, Card, CAdv, AdN, AdNum, AdnCAdv
, Dig, Digits, NumDigits, IDig, IIDig, D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 -- only (within the organisation)
, ListAdv, BaseAdv, ConsAdv, ConjAdv
, ListAP, BaseAP, ConsAP, ConjAP
, ListNP, BaseNP, ConsNP, ConjNP
, ListS, BaseS, ConsS, ConjS
, S, QS, Conj
, S, QS, Conj, Subj, SubjS
, RS, RP, IdRP, RelCN
]
, StructuralEng [
Prep, to_Prep, for_Prep, from_Prep, on_Prep, before_Prep, after_Prep, possess_Prep
, VV, must_VV
, AdN, CAdv, less_CAdv, more_CAdv, at_least_AdN, at_most_AdN
, Subj, because_Subj
]
, ExtendEng [
VPS, MkVPS, mkVPS, ListVPS, BaseVPS, ConsVPS, ConjVPS, baseVPS
, VPI, MkVPI, mkVPI --, [VPI], BaseVPI, ConsVPI, ConjVPI
, VP, Tense, Ant, Temp, Pol, Conj -- for VPS
, ByVP
, S, PredVPS
, NP, GerundNP -- by performing NDB qualification
, ByVP, N, CompoundN
, S, PredVPS, RelVPS
, NP, GerundNP, Num, GenModNP -- by performing NDB qualification
]
** open
SyntaxEng
Expand Down Expand Up @@ -94,6 +98,8 @@ concrete CustomSyntaxEng of CustomSyntax =
in vps ** {s = \\_,_ => may_have_occurred} ;
-- : NP -> S ; -- it is NP — reference to a previous NP
ReferenceNP np = mkS (mkCl it_NP <lin NP np : NP>) ;
WhileDoing vp = cc2 (ss "while") (GerundAdv vp) ;
CNwhereS cn np vps = SentCN cn (cc2 (ss "where") (PredVPS np vps)) ;

presSimul = mkTemp presentTense simultaneousAnt ;
presAnt = mkTemp presentTense anteriorAnt ;
Expand All @@ -104,6 +110,7 @@ concrete CustomSyntaxEng of CustomSyntax =
theSg = theSg_Det ;
thePl = thePl_Det ;
aSg = aSg_Det ;
aPl = aPl_Det ;
your = mkDet youSg_Pron ;

about_Prep = ParadigmsEng.mkPrep "about" ;
Expand Down
20 changes: 12 additions & 8 deletions lib/haskell/natural4/grammars/CustomSyntaxMay.gf
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
concrete CustomSyntaxMay of CustomSyntax =
NumeralMay
, GrammarMay [
N, N2, CN, UseN, NP, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, A, A2, AP, AdjCN, PositA
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP, UseV
, A, A2, AP, AdjCN, PositA, ComplA2
-- , ProgrVP -- becoming aware
, Comp, Adv, VP, UseComp, CompAP, CompNP, CompAdv -- is a public agency
, Prep, PrepNP, AdvVP
, AdA, AdAdv -- only (within the organisation)
, AdA, AdAdv, Card, CAdv, AdN, AdNum, AdnCAdv
, Dig, Digits, NumDigits, IDig, IIDig, D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 -- only (within the organisation)
, ListAdv, BaseAdv, ConsAdv, ConjAdv
, ListAP, BaseAP, ConsAP, ConjAP
, ListNP, BaseNP, ConsNP, ConjNP
, ListS, BaseS, ConsS, ConjS
, S, QS, Conj
, S, QS, Conj, Subj, SubjS
, RS, RP, IdRP, RelCN
]
, StructuralMay [
Prep, for_Prep, from_Prep, on_Prep, after_Prep, possess_Prep
, VV, must_VV
, AdN, CAdv, less_CAdv, more_CAdv, at_least_AdN, at_most_AdN
, Subj, because_Subj
]
, ExtendMay [
VPS, MkVPS, mkVPS, ListVPS, BaseVPS, ConsVPS, ConjVPS, baseVPS
, VPI, MkVPI, mkVPI --, [VPI], BaseVPI, ConsVPI, ConjVPI
, VP, Tense, Ant, Temp, Pol, Conj -- for VPS
, ByVP
, S, PredVPS
, NP, GerundNP -- by performing NDB qualification
, ByVP, N, CompoundN
, S, PredVPS, RelVPS
, NP, GerundNP, Num, GenModNP -- by performing NDB qualification
]
** open
SyntaxMay
Expand Down
Loading
Loading