Skip to content

Commit

Permalink
new words + make more cats lexical in generated hs
Browse files Browse the repository at this point in the history
  • Loading branch information
inariksit committed Aug 8, 2023
1 parent 9a76382 commit 08662b0
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 926 deletions.
2 changes: 1 addition & 1 deletion lib/haskell/natural4/grammars/CustomSyntax.gf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ abstract CustomSyntax =
Numeral
, Grammar [
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, 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
Expand Down
2 changes: 1 addition & 1 deletion lib/haskell/natural4/grammars/CustomSyntaxChi.gf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ concrete CustomSyntaxChi of CustomSyntax =
NumeralChi
, GrammarChi [
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP, AdvVP
, V, VV, V2, VS, VP, UseV, AdvVP
, A, A2, AP, PositA
, Comp, Adv, VP, UseComp, CompAP, CompAdv -- is a public agency
, AdA, AdAdv, Card, CAdv, AdN, AdNum, AdnCAdv
Expand Down
2 changes: 1 addition & 1 deletion lib/haskell/natural4/grammars/CustomSyntaxEng.gf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ concrete CustomSyntaxEng of CustomSyntax =
NumeralEng
, GrammarEng [
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, 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
Expand Down
2 changes: 1 addition & 1 deletion lib/haskell/natural4/grammars/CustomSyntaxMay.gf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ concrete CustomSyntaxMay of CustomSyntax =
NumeralMay
, GrammarMay [
N, N2, CN, PN, NP, UseN, ComplN2, UsePN, Num, NumSg, NumPl, Det, DetCN, MassNP
, V, VV, V2, VS, VP
, 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
Expand Down
93 changes: 89 additions & 4 deletions lib/haskell/natural4/grammars/InsLex.gf
Original file line number Diff line number Diff line change
@@ -1,5 +1,92 @@
abstract InsLex = NL4Base ** {
fun
_ignore_consider_V2 : V2 ;
_Number_PN : PN ;
_note_V2 : V2 ;
_thing_N : N ;
_convert_to_V2 : V2 ;
_A_PN : PN ;
_detail_N : N ;
_earn_V2 : V2 ;
_appearance_N : N ;
_concrete_A : A ;
_Pru_PN : PN ;
_administrative_A : A ;
_natural4_N : N ;
_claim_from_V2 : V2 ;
_damage_N : N ;
_base_on_V2 : V2 ;
_overall_A : A ;
_encoding_N : N ;
_OverallPolicySum_PN : PN ;
_database_N : N ;
_Amount_N : N ;
_reinstatement_N : N ;
_A_N : N ;
_life_assured_N : N ;
_like_Prep : Prep ;
_PruAssure_PN : PN ;
_convert_V2 : V2 ;
_long_Adv : Adv ;
_remark_N : N ;
_involve_VS : VS ;
_represent_V2 : V2 ;
_Damage_N : N ;
_relate_to_V2 : V2 ;
_Pru_N : N ;
_cause_V : V ;
_subsection_N : N ;
_text_N : N ;
_cell_N : N ;
_Damage_PN : PN ;
_PruAssure_N : N ;
_end_V : V ;
_end_accord_V2 : V2 ;
_argument_N : N ;
_use_VV : VV ;
_describe_in_V2 : V2 ;
_about_Prep : Prep ;
_arise_V2 : V2 ;
_qualify_for_V2 : V2 ;
_directly_Adv : Adv ;
_OverallPolicySum_N : N ;
_Number_N : N ;
_update_N : N ;
_indirectly_Adv : Adv ;
_ph_PN : PN ;
_natural_A : A ;
_separate_A : A ;
_subsequent_A : A ;
_structure_N : N ;
_accord_to_V2 : V2 ;
_atomicity_N : N ;
_Amount_PN : PN ;
_income_N : N ;
_reward_N : N ;
_more_Adv : Adv ;
_datatype_N : N ;
_Hsi_N : N ;
_consider_V2 : V2 ;
_reach_V2 : V2 ;
_insurer_N : N ;
_whether_Subj : Subj ;
_handle_V2 : V2 ;
_renew_V2 : V2 ;
_ph_N : N ;
_no_Adv : Adv ;
_live_A : A ;
_capacity_N : N ;
_cover_N : N ;
_start_V2 : V2 ;
_so_Adv : Adv ;
_define_based_on_V2 : V2 ;
_exclude_from_V2 : V2 ;
_similar_A : A ;
_here_Adv : Adv ;
_demarcate_V2 : V2 ;
_underlie_V : V ;
_complex_A : A ;
_clause_N : N ;
_leg_N : N ;
_line_N : N ;
_SA_PN : PN ;
Expand Down Expand Up @@ -160,7 +247,6 @@ abstract InsLex = NL4Base ** {
_rule_N : N ;
_pregnancy_N : N ;
_cost_N : N ;
_countqualifye_V2 : V2 ;
_sumassure_V : V ;
_alcohol_N : N ;
_n_N : N ;
Expand Down Expand Up @@ -315,7 +401,6 @@ abstract InsLex = NL4Base ** {
_Insurer_PN : PN ;
_adjustment_N : N ;
_give_V2 : V2 ;
_qualifie_N : N ;
_logical_A : A ;
_triple_A : A ;
_timeyear_N : N ;
Expand Down Expand Up @@ -375,6 +460,7 @@ abstract InsLex = NL4Base ** {
_circ_PN : PN ;
_Benefit_PN : PN ;
_particular_A : A ;
_participate_in_V2 : V2 ;
_planAF_PN : PN ;
_at_Prep : Prep ;
_accepted_A : A ;
Expand All @@ -384,7 +470,7 @@ abstract InsLex = NL4Base ** {
_duty_N : N ;
_finger_N : N ;
_deduce_VS : VS ;
_occur_V : V ;
-- _occur_V : V ;
_accidental_A : A ;
_medical_A : A ;
_cover_V : V ;
Expand Down Expand Up @@ -531,7 +617,6 @@ abstract InsLex = NL4Base ** {
_on_Prep : Prep ;
_as_Subj : Subj ;
_holder_N : N ;
_assured_N : N ;
_alive_A : A ;
_juvenile_A : A ;
_intentional_A : A ;
Expand Down
90 changes: 87 additions & 3 deletions lib/haskell/natural4/grammars/InsLexEng.gf
Original file line number Diff line number Diff line change
@@ -1,6 +1,91 @@
concrete InsLexEng of InsLex = NL4BaseEng **
open ParadigmsEng, Prelude, GrammarEng in {
oper mkSubj : Str -> Subj = \s -> lin Subj (ss s) ;
lin _ignore_consider_V2 = mkV2 (mkV "ignore") (mkPrep "consider") ;
lin _Number_PN = mkPN "Number" ;
lin _note_V2 = mkV2 (mkV "note") ;
lin _thing_N = mkN "thing" ;
lin _convert_to_V2 = mkV2 (mkV "convert") (mkPrep "to") ;
lin _A_PN = mkPN "A" ;
lin _detail_N = mkN "detail" ;
lin _earn_V2 = mkV2 (mkV "earn") ;
lin _appearance_N = mkN "appearance" ;
lin _concrete_A = mkA "concrete" ;
lin _Pru_PN = mkPN "Pru" ;
lin _administrative_A = mkA "administrative" ;
lin _natural4_N = mkN "natural4" ;
lin _claim_from_V2 = mkV2 (mkV "claim") (mkPrep "from") ;
lin _damage_N = mkN "damage" ;
lin _base_on_V2 = mkV2 (mkV "base") (mkPrep "on") ;
lin _overall_A = mkA "overall" ;
lin _encoding_N = mkN "encoding" ;
lin _OverallPolicySum_PN = mkPN "OverallPolicySum" ;
lin _database_N = mkN "database" ;
lin _Amount_N = mkN "Amount" ;
lin _reinstatement_N = mkN "reinstatement" ;
lin _A_N = mkN "A" ;
lin _like_Prep = mkPrep "like" ;
lin _PruAssure_PN = mkPN "PruAssure" ;
lin _convert_V2 = mkV2 (mkV "convert") ;
lin _long_Adv = mkAdv "long" ;
lin _remark_N = mkN "remark" ;
lin _involve_VS = mkVS (mkV "involve") ;
lin _represent_V2 = mkV2 (mkV "represent") ;
lin _Damage_N = mkN "Damage" ;
lin _relate_to_V2 = mkV2 (mkV "relate") (mkPrep "to") ;
lin _Pru_N = mkN "Pru" ;
lin _cause_V = mkV "cause" ;
lin _subsection_N = mkN "subsection" ;
lin _text_N = mkN "text" ;
lin _cell_N = mkN "cell" ;
lin _Damage_PN = mkPN "Damage" ;
lin _PruAssure_N = mkN "PruAssure" ;
lin _end_V = mkV "end" ;
lin _end_accord_V2 = mkV2 (mkV "end") (mkPrep "accord") ;
lin _argument_N = mkN "argument" ;
lin _use_VV = mkVV (mkV "use") ;
lin _describe_in_V2 = mkV2 (mkV "describe") (mkPrep "in") ;
lin _about_Prep = mkPrep "about" ;
lin _arise_V2 = mkV2 (mkV "arise") ;
lin _qualify_for_V2 = mkV2 (mkV "qualify") (mkPrep "for") ;
lin _directly_Adv = mkAdv "directly" ;
lin _OverallPolicySum_N = mkN "OverallPolicySum" ;
lin _Number_N = mkN "Number" ;
lin _update_N = mkN "update" ;
lin _indirectly_Adv = mkAdv "indirectly" ;
lin _ph_PN = mkPN "ph" ;
lin _natural_A = mkA "natural" ;
lin _separate_A = mkA "separate" ;
lin _subsequent_A = mkA "subsequent" ;
lin _structure_N = mkN "structure" ;
lin _accord_to_V2 = mkV2 (mkV "accord") (mkPrep "to") ;
lin _atomicity_N = mkN "atomicity" ;
lin _Amount_PN = mkPN "Amount" ;
lin _income_N = mkN "income" ;
lin _reward_N = mkN "reward" ;
lin _more_Adv = mkAdv "more" ;
lin _datatype_N = mkN "datatype" ;
lin _consider_V2 = mkV2 (mkV "consider") ;
lin _reach_V2 = mkV2 (mkV "reach") ;
lin _insurer_N = mkN "insurer" ;
lin _whether_Subj = mkSubj "whether" ;
lin _handle_V2 = mkV2 (mkV "handle") ;
lin _renew_V2 = mkV2 (mkV "renew") ;
lin _ph_N = mkN "ph" ;
lin _no_Adv = mkAdv "no" ;
lin _live_A = mkA "//,,,live" ;
lin _capacity_N = mkN "capacity" ;
lin _cover_N = mkN "cover" ;
lin _start_V2 = mkV2 (mkV "start") ;
lin _so_Adv = mkAdv "so" ;
lin _define_based_on_V2 = mkV2 (mkV "define") (mkPrep "based on") ;
lin _exclude_from_V2 = mkV2 (mkV "exclude") (mkPrep "from") ;
lin _similar_A = mkA "similar" ;
lin _here_Adv = mkAdv "here" ;
lin _demarcate_V2 = mkV2 (mkV "demarcate") ;
lin _underlie_V = mkV "underlie" ;
lin _complex_A = mkA "complex" ;
lin _clause_N = mkN "clause" ;
lin _practitioner_N = mkN "practitioner" ;
lin _insanity_N = mkN "insanity" ;
lin _plan_N = mkN "plan" ;
Expand Down Expand Up @@ -34,7 +119,6 @@ concrete InsLexEng of InsLex = NL4BaseEng **
lin _b_N = mkN "b" ;
lin _LE_PN = mkPN "LE" ;
lin _Type_PN = mkPN "Type" ;
lin _qualifie_N = mkN "qualifie" ;
lin _medical_A = mkA "medical" ;
lin _suffer_V = us_britishV "suffer" ;
lin _benefit_V = us_britishV "benefit" ;
Expand Down Expand Up @@ -260,7 +344,6 @@ concrete InsLexEng of InsLex = NL4BaseEng **
lin _H5N1_PN = mkPN "H5N1" ;
lin _surgical_A = mkA "surgical" ;
lin _nature_N = mkN "nature" ;
lin _countqualifye_V2 = mkV2 (us_britishV "count(qualifye") ;
lin _transform_into_V2 = mkV2 (us_britishV "transform") (mkPrep "into") ;
lin _only_Adv = mkAdv "only" ;
lin _benefit_V2 = mkV2 (us_britishV "benefit") ;
Expand Down Expand Up @@ -387,6 +470,7 @@ concrete InsLexEng of InsLex = NL4BaseEng **
lin _patella_N = mkN "patella" ;
lin _schedule_N = mkN "schedule" ;
lin _particular_A = mkA "particular" ;
lin _participate_in_V2 = mkV2 (mkV "participate") in_Prep ;
lin _passenger_N = mkN "passenger" ;
lin _where_Subj = mkSubj "where" ;
lin _total_A = mkA "total" ;
Expand Down Expand Up @@ -541,7 +625,7 @@ concrete InsLexEng of InsLex = NL4BaseEng **
lin _death_N = mkN "death" ;
lin _time_N = mkN "time" ;
lin _professional_A = mkA "professional" ;
lin _assured_N = mkN "assured" ;
lin _life_assured_N = mkN "life assured" ;
lin _form_N = mkN "form" ;
lin _dc_N = mkN "dc" ;
lin _sum_list_PN = mkPN "sum_list" ;
Expand Down
Binary file modified lib/haskell/natural4/grammars/NL4.pgf
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/haskell/natural4/grammars/updateHS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

gf -make -f haskell --haskell=gadt --haskell=lexical --lexical=V,N,CN,AP,VP,V2,VS,VV,Dig,Day,Month,YearComponent NL4Eng.gf NL4May.gf NL4Chi.gf
gf -make -f haskell --haskell=gadt --haskell=lexical --lexical=A,V,N,CN,PN,Prep,Conj,Subj,AP,VP,V2,VS,VV,V2V,Dig,Day,Month,YearComponent NL4Eng.gf NL4May.gf NL4Chi.gf
cat NL4.hs |
sed 's/module NL4 where/module LS.NLP.NL4 where/' | \
sed 's/instance Show .*//' | \
Expand Down
Loading

0 comments on commit 08662b0

Please sign in to comment.