1
0
forked from GitHub/gf-rgl

Merge branch 'master' of github.com:GrammaticalFramework/gf-rgl

This commit is contained in:
Krasimir Angelov
2025-08-28 19:36:09 +02:00
24 changed files with 3160 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
concrete AdjectiveGla of Adjective = CatGla ** open ResGla, Prelude in {
flags optimize=all_subs ;
lin
-- : AP -> Adv -> AP ; -- warm by nature
AdvAP ap adv = ap ** {
s = ap.s ++ adv.s ;
} ;
-- : A -> AP ;
PositA a = a ** {
compar = [] ;
} ;
-- : A -> NP -> AP ;
ComparA a np = a ** {
compar = np.s
} ;
-- : A2 -> NP -> AP ; -- married to her
-- ComplA2 a2 np = a2 ** { } ;
-- : A2 -> AP ; -- married to itself
-- ReflA2 a2 = a2 ** { } ;
-- : A2 -> AP ; -- married
UseA2 = PositA ;
-- : A -> AP ; -- warmer
-- UseComparA a = a ** {
-- s = \\af => "???" ++ a.s ! af ;
-- compar = []
-- } ;
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
-- CAdvAP adv ap np = ap ** { } ;
-- The superlative use is covered in $Ord$.
-- : Ord -> AP ; -- warmest
-- AdjOrd ord = ord ** {
-- compar = []
-- } ;
-- AdjOrd : Ord -> AP =
AdjOrd ord = ord ;
-- Sentence and question complements defined for all adjectival
-- phrases, although the semantics is only clear for some adjectives.
-- : AP -> SC -> AP ; -- good that she is here
-- SentAP ap sc = ap ** {
-- s = \\af => ap.s ! af ++ sc.s
-- } ;
-- An adjectival phrase can be modified by an *adadjective*, such as "very".
-- : AdA -> AP -> AP ;
-- AdAP ada ap = ap ** { } ;
-- It can also be postmodified by an adverb, typically a prepositional phrase.
}

59
src/gaelic/AdverbGla.gf Normal file
View File

@@ -0,0 +1,59 @@
concrete AdverbGla of Adverb = CatGla ** open ResGla, ParadigmsGla, Prelude in {
lin
{-
-- : A -> Adv ;
PositAdvAdj adj =
-- : CAdv -> A -> NP -> Adv ; -- more warmly than John
ComparAdvAdj cadv a np =
-- : CAdv -> A -> S -> Adv ; -- more warmly than he runs
ComparAdvAdjS cadv a s =
-}
-- : Prep -> NP -> Adv ;
PrepNP prep np = {
s = prepAndArt ++ noun
} where {
defaultCase : CoreCase = prep.c2 ! getDefi np.a ;
complCase : Case = case <defaultCase, np.a> of {
<Dat NoMutation, NotPron (DPoss _ (Sg1|Sg2|Sg3 Masc))>
=> CC (Dat Lenited) ; -- force lenition if possessive triggers it
<Nom NoMutation, NotPron (DPoss _ (Sg1|Sg2|Sg3 Masc))>
=> CC (Nom Lenited) ; -- force lenition if possessive triggers it
_ => CC defaultCase } ;
prepStr : Str = prep.s ! agr2pagr np.a ; -- can be Prep or Prep+Pron merged
artStr : Str = np.art ! complCase ;
prepAndArt : Str = case np.a of {
NotPron (DDef _ Indefinite) => prepStr ++ artStr ;
_ => prepStr } ;
noun : Str = case <prep.replacesObjPron, np.a> of {
<_, NotPron _> | <False, _>
=> np.s ! complCase ;
_ => np.empty -- empty string to avoid metavariables
}
};
{-
-- Adverbs can be modified by 'adadjectives', just like adjectives.
-- : AdA -> Adv -> Adv ; -- very quickly
AdAdv ada adv = adv **
-- Like adverbs, adadjectives can be produced by adjectives.
-- : A -> AdA ; -- extremely
PositAdAAdj a =
-- Subordinate clauses can function as adverbs.
-- : Subj -> S -> Adv ;
SubjS subj s = {s = subj.s ++ s.s} ;
-- Comparison adverbs also work as numeral adverbs.
-- : CAdv -> AdN ; -- less (than five)
AdnCAdv cadv = ;
-}
}

6
src/gaelic/AllGla.gf Normal file
View File

@@ -0,0 +1,6 @@
--# -path=.:../abstract:../common:../prelude
concrete AllGla of AllGlaAbs =
LangGla,
ExtendGla
;

121
src/gaelic/CatGla.gf Normal file
View File

@@ -0,0 +1,121 @@
concrete CatGla of Cat = CommonX ** open ResGla, Coordination, Prelude in {
flags optimize=all_subs ;
lincat
--2 Sentences and clauses
-- Constructed in SentenceGla, and also in IdiomGla
S = SS ;
QS = SS ;
RS = SS ;
-- relative sentence. Tense and polarity fixed,
-- but agreement may depend on the CN/NP it modifies.
Cl = ResGla.LinCl ;
ClSlash = SS ;
SSlash = SS ; -- sentence missing NP; e.g. "she has looked at"
Imp = SS ; -- imperative e.g. "look at this"
--2 Questions and interrogatives
-- Constructed in QuestionGla.
QCl = SS ;
IComp = SS ; -- interrogative complement of copula e.g. "where"
IDet = SS ; -- interrogative determiner e.g. "how many"
IQuant = SS ; -- interrogative quantifier e.g. "which"
IP = SS ; -- interrogative pronoun e.g. "who"
--2 Subord clauses and pronouns
RCl = SS ;
RP = SS ;
--2 Verb phrases
-- Constructed in VerbGla.
VP = ResGla.LinVP ;
VPSlash = SS ;
Comp = SS ;
--2 Adjectival phrases
-- Constructed in AdjectiveGla.
AP = SS ;
--2 Nouns and noun phrases
-- Constructed in NounGla.
-- Many atomic noun phrases e.g. "everybody"
-- are constructed in StructuralGla.
CN = ResGla.LinCN ;
NP = ResGla.LinNP ;
Pron = LinPron ;
Det = ResGla.LinDet ; -- s : Str , n : Number
Predet = SS ;
Quant = ResGla.LinQuant ; -- s : Number => Str
Num = ResGla.LinNum ;
Card = ResGla.LinNum ;
ACard = SS ;
Ord = SS ;
DAP = SS ;
--2 Numerals
-- Constructed in NumeralGla.
Numeral = ResGla.LinNumeral ;
Digits = ResGla.LinNumeral ;
--2 Structural words
-- Constructed in StructuralGla.
Conj = Coordination.ConjunctionDistr ** {
n : Number -- The number of the NP that results from
-- coordinating a list of NPs with that Conj.
} ; -- "[Ann and Bob] are children" → and_Conj.n = Pl
Subj = SS ;
Prep = ResGla.LinPrep ;
--2 Words of open classes
-- These are constructed in LexiconGla and in
-- additional lexicon modules.
-- TODO: eventually different lincats
VS, -- sentence-complement verb e.g. "claim"
VQ, -- question-complement verb e.g. "wonder"
VA, -- adjective-complement verb e.g. "look"
V = ResGla.LinV ;
VV -- verb-phrase-complement verb e.g. "want"
= SS ;
V2A, -- verb with NP and AP complement e.g. "paint"
V2V, -- verb with NP and V complement e.g. "cause"
V2S, -- verb with NP and S complement e.g. "tell"
V2Q, -- verb with NP and Q complement e.g. "ask"
V2 = SS ;
V3 = SS ;
A = SS ;
A2 = SS ;
N = ResGla.LinN ;
N2 = ResGla.LinN ;
N3 = ResGla.LinN ;
PN = SS ;
-- From the Names module, not in the official API as of 2023-08
GN = SS ; -- Given name, e.g. "George"
SN = SS ; -- Second name, e.g. "Washington"
LN = SS ; -- Location name, e.g. "Sweden"
linref
Cl = linCl ;
}

View File

@@ -0,0 +1,147 @@
concrete ConjunctionGla of Conjunction =
CatGla ** open ResGla, Coordination, Prelude in {
flags optimize=all_subs ;
{- Conjunction for category X needs four things:
lincat [X]
lin BaseX
lin ConsX
lin ConjX
For example, if X is defined as
lincat X = {s : Number => Str ; g : Gender} ;
then [X] will split its s field into two, and retain its other fields as is:
lincat [X] = {s1,s2 : Number => Str ; g : Gender} ;
Let us look at a simple case: Adv is of type {s : Str}
Then [Adv] is {s1,s2 : Str}.
BaseAdv, ConsAdv and ConjAdv can all use functions defined in prelude/Coordination:
BaseAdv = twoSS ;
ConsAdv = consrSS comma ;
ConjAdv = conjunctSS ;
--}
-----------------------------------------------------------------------------
-- Adverb and other simple {s : Str} types.
lincat
[Adv],[AdV],[IAdv] = {s1,s2 : Str} ;
lin
BaseAdv, BaseAdV, BaseIAdv = twoSS ;
ConsAdv, ConsAdV, ConsIAdv = consrSS comma ;
ConjAdv, ConjAdV, ConjIAdv = conjunctDistrSS ;
{-
-----------------------------------------------------------------------------
-- S is sometimes already {s : Str}, sometimes open for mood or word order.
-- Simply take the lincat of S, and split the s field into s1 and s2.
-- Then make sure that all of the other fields are retained.
lincat
[S] = {s1, s2 : …} ;
lin
-- : S -> S -> ListS ; -- John walks, Mary runs
BaseS x y =
-- : S -> ListS -> ListS ; -- John walks, Mary runs, Bill swims
ConsS x xs =
-- : Conj -> ListS -> S ; -- he walks and she runs
ConjS conj xs =
-----------------------------------------------------------------------------
-- RS is variable on … and has inherent …
-- RS can modify CNs, which are open for …, and have inherent …
lincat
[RS] = {s1,s2 : … => Str} ;
lin
-- : RS -> RS -> ListRS ; -- who walks, whom I know
BaseRS x y =
-- : RS -> ListRS -> ListRS ; -- who wals, whom I know, who is here
ConsRS x xs =
-- : Conj -> ListRS -> RS ; -- who walks and whose mother runs
ConjRS conj xs =
-----------------------------------------------------------------------------
-- NP is variable on … and has inherent …
lincat
[NP] = {s1, s2 : …} ;
lin
-- : NP -> NP -> ListNP ; -- John, Mary
BaseNP x y =
-- : NP -> ListNP -> ListNP ; -- John, Mary, Bill
ConsNP x xs =
-- : Conj -> ListNP -> NP ; -- she or we
ConjNP conj xs =
-----------------------------------------------------------------------------
-- AP is variable on … and has an inherent …
lincat
[AP] = {s1, s2 : …} ;
lin
-- : AP -> AP -> ListAP ; -- red, white
BaseAP x y =
-- : AP -> ListAP -> ListAP ; -- red, white, blue
ConsAP x xs =
-- : Conj -> ListAP -> AP ; -- cold and warm
ConjAP conj xs =
-----------------------------------------------------------------------------
-- CN is variable on …
-- CN conjunction is not in the API, so this can be lower prio
lincat
[CN] = {s1, s2 : …} ;
lin
-- : CN -> CN -> ListCN ; -- man, woman
BaseCN x y =
-- : CN -> ListCN -> ListCN ; -- man, woman, child
ConsCN x xs =
-- : Conj -> ListCN -> CN ; -- man and woman
ConjCN conj xs =
-----------------------------------------------------------------------------
-- Det and DAP
-- Note that there is no [Det], the way to coordinate Dets is to make them
-- into DAP first, using Noun.DetDAP : Det -> DAP ;
-- DAP ("three small") isn't used in any API functions, so lower prio.
lincat
[DAP] = {s1, s2 : …} ;
lin
-- : DAP -> DAP -> ListDAP ;
BaseDAP x y =
-- : DAP -> ListDAP -> ListDAP ;
ConsDAP xs x =
-- : Conj -> ListDAP -> Det ; -- his or her
ConjDet conj xs =
-}
}

View File

@@ -0,0 +1,117 @@
concrete ConstructionGla of Construction = CatGla ** open ParadigmsGla in {
lincat
Timeunit = N ;
Weekday = N ;
Monthday = NP ;
Month = N ;
Year = NP ;
{-
lin
timeunitAdv n time =
let n_card : Card = n ;
n_hours_NP : NP = mkNP n_card time ;
in SyntaxGla.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
weekdayLastAdv w = -- last Sunday
monthAdv m = mkAdv in_Prep (mkNP m) ;
yearAdv y = mkAdv in_Prep y ;
dayMonthAdv d m = ; -- on 17 Gla
monthYearAdv m y = ; -- in Gla 2012
dayMonthYearAdv d m y = ; -- on 17 Gla 2013
intYear = symb ;
intMonthday = symb ;
lincat Language = N ;
lin InLanguage l = mkAdv ???_Prep (mkNP l) ;
lin
weekdayN w = w ;
monthN m = m ;
weekdayPN w = mkPN w ;
monthPN m = mkPN m ;
languageCN l = mkCN l ;
languageNP l = mkNP l ;
oper mkLanguage : Str -> N = \s -> mkN s ;
----------------------------------------------
---- lexicon of special names
lin second_Timeunit = mkN "second" ;
lin minute_Timeunit = mkN "minute" ;
lin hour_Timeunit = mkN "hour" ;
lin day_Timeunit = mkN "day" ;
lin week_Timeunit = mkN "week" ;
lin month_Timeunit = mkN "month" ;
lin year_Timeunit = mkN "year" ;
lin monday_Weekday = mkN "Monday" ;
lin tuesday_Weekday = mkN "Tuesday" ;
lin wednesday_Weekday = mkN "Wednesday" ;
lin thursday_Weekday = mkN "Thursday" ;
lin friday_Weekday = mkN "Friday" ;
lin saturday_Weekday = mkN "Saturday" ;
lin sunday_Weekday = mkN "Sunday" ;
lin january_Month = mkN "January" ;
lin february_Month = mkN "February" ;
lin march_Month = mkN "March" ;
lin april_Month = mkN "April" ;
lin may_Month = mkN "May" ;
lin june_Month = mkN "June" ;
lin july_Month = mkN "July" ;
lin august_Month = mkN "August" ;
lin september_Month = mkN "September" ;
lin october_Month = mkN "October" ;
lin november_Month = mkN "November" ;
lin december_Month = mkN "December" ;
lin afrikaans_Language = mkLanguage "Afrikaans" ;
lin amharic_Language = mkLanguage "Amharic" ;
lin arabic_Language = mkLanguage "Arabic" ;
lin bulgarian_Language = mkLanguage "Bulgarian" ;
lin catalan_Language = mkLanguage "Catalan" ;
lin chinese_Language = mkLanguage "Chinese" ;
lin danish_Language = mkLanguage "Danish" ;
lin dutch_Language = mkLanguage "Dutch" ;
lin english_Language = mkLanguage "Euslish" ;
lin estonian_Language = mkLanguage "Estonian" ;
lin finnish_Language = mkLanguage "Finnish" ;
lin french_Language = mkLanguage "French" ;
lin german_Language = mkLanguage "German" ;
lin greek_Language = mkLanguage "Greek" ;
lin hebrew_Language = mkLanguage "Hebrew" ;
lin hindi_Language = mkLanguage "Hindi" ;
lin japanese_Language = mkLanguage "Japanese" ;
lin italian_Language = mkLanguage "Italian" ;
lin latin_Language = mkLanguage "Latin" ;
lin latvian_Language = mkLanguage "Latvian" ;
lin maltese_Language = mkLanguage "Maltese" ;
lin nepali_Language = mkLanguage "Nepali" ;
lin norwegian_Language = mkLanguage "Norwegian" ;
lin persian_Language = mkLanguage "Persian" ;
lin polish_Language = mkLanguage "Polish" ;
lin punjabi_Language = mkLanguage "Punjabi" ;
lin romanian_Language = mkLanguage "Romanian" ;
lin russian_Language = mkLanguage "Russian" ;
lin sindhi_Language = mkLanguage "Sindhi" ;
lin spanish_Language = mkLanguage "Spanish" ;
lin swahili_Language = mkLanguage "Swahili" ;
lin swedish_Language = mkLanguage "Swedish" ;
lin thai_Language = mkLanguage "Thai" ;
lin turkish_Language = mkLanguage "Turkish" ;
lin urdu_Language = mkLanguage "Urdu" ;
-}
}

35
src/gaelic/ExtendGla.gf Normal file
View File

@@ -0,0 +1,35 @@
--# -path=.:../common:../abstract
concrete ExtendGla of Extend = CatGla
** ExtendFunctor - [
VPS -- finite VP's with tense and polarity
, ListVPS
, VPI
, ListVPI -- infinitive VP's (TODO: with anteriority and polarity)
, MkVPS
, PredVPS
-- excluded because RGL funs needed for them not implemented yet
, SlashBareV2S
, PredAPVP
, ComplBareVS
, AdvIsNP, AdvIsNPAP
, CompBareCN
, CompIQuant
, ComplSlashPartLast
, ComplDirectVQ
, ComplDirectVS
, DetNPFem, DetNPMasc
, ExistCN, ExistMassCN, ExistPluralCN, ExistsNP
, ExistIPQS, ExistNPQS, ExistS
, PredIAdvVP
, PrepCN
, ReflPossPron
, UttVP, UttVPShort, UttAccNP, UttDatNP, UttAccIP, UttDatIP
, EmptyRelSlash, StrandQuestSlash, StrandRelSlash
, SubjRelNP
, UseComp_ser, UseComp_estar
, iFem_Pron, weFem_Pron, youFem_Pron, youPlFem_Pron, youPolFem_Pron, youPolPlFem_Pron, youPolPl_Pron, theyFem_Pron, theyNeutr_Pron
, GenModNP
] with (Grammar=GrammarGla) ;

17
src/gaelic/GrammarGla.gf Normal file
View File

@@ -0,0 +1,17 @@
concrete GrammarGla of Grammar =
NounGla
, VerbGla
, AdjectiveGla
, AdverbGla
, NumeralGla
, SentenceGla
, QuestionGla
, RelativeGla
, ConjunctionGla
, PhraseGla
, TextX
, StructuralGla
, IdiomGla
, TenseX
, NamesGla -- Not part of original Grammar, here to trigger compilation
;

56
src/gaelic/IdiomGla.gf Normal file
View File

@@ -0,0 +1,56 @@
--1 Idiom: Idiomatic Expressions
concrete IdiomGla of Idiom = CatGla ** open Prelude, ResGla, VerbGla, QuestionGla, NounGla, StructuralGla in {
-- This module defines constructions that are formed in fixed ways,
-- often different even in closely related languages.
{-
lin
-- ImpersCl : VP -> Cl ; -- it is hot
ImpersCl vp = {
} ;
-- : NP -> Cl ; -- there is a house
ExistNP np =
-- ExistIP : IP -> QCl ; -- which houses are there
ExistIP ip =
-- GenericCl : VP -> Cl ; -- one sleeps
GenericCl vp =
CleftNP : NP -> RS -> Cl ; -- it is I who did it
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
-- : NP -> Cl ; -- there is a house
ExistNP np =
ExistIP : IP -> QCl ; -- which houses are there
-- 7/12/2012 generalizations of these
ExistNPAdv : NP -> Adv -> Cl ; -- there is a house in Paris
ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
-- : VP -> VP ;
ProgrVP vp = vp ** {
} ;
-- : VP -> Utt ; -- let's go
ImpPl1 vp = { } ;
ImpP3 : NP -> VP -> Utt ; -- let John walk
-- 3/12/2013 non-reflexive uses of "self"
SelfAdvVP : VP -> VP ; -- is at home himself
SelfAdVVP : VP -> VP ; -- is himself at home
SelfNP : NP -> NP ; -- the president himself (is at home)
-}
}

5
src/gaelic/LangGla.gf Normal file
View File

@@ -0,0 +1,5 @@
--# -path=.:../abstract:../common:../prelude:../api
concrete LangGla of Lang =
GrammarGla,
LexiconGla,
ConstructionGla ;

420
src/gaelic/LexiconGla.gf Normal file
View File

@@ -0,0 +1,420 @@
concrete LexiconGla of Lexicon = CatGla **
open ParadigmsGla, ResGla in {
----
-- A
{-
lin add_V3 = mkV3 (mkV "") ;
lin airplane_N = mkN "" ;
lin alas_Interj = mkInterj "" ;
lin already_Adv = mkA "" ;
lin animal_N = mkN "" ;
lin answer_V2S = mkV2S (mkV "") ;
lin apartment_N = mkN "" ;
lin apple_N = mkN "" ;
lin art_N = mkN "" ;
lin ashes_N = mkN "" ;
lin ask_V2Q = mkV2Q (mkV "") ;
----
-- B
lin baby_N = mkN "" ;
lin back_N = mkN "" ;
lin bad_A = mkA "" ;
lin bank_N = mkN "" ;
lin bark_N = mkN "" ;
lin beautiful_A = mkA "" ;
lin become_VA = mkVA (mkV "") ;
lin beer_N = mkN "" ;
lin beg_V2V = mkV2V (mkV "") ;
lin belly_N = mkN "" ;
lin big_A = mkA "" ;
lin bike_N = mkN "" ;-}
lin bird_N = smartN "eun" "eòin" "eòin" Masc ;{-
lin bite_V2 = mkV2 "" ;
lin black_A = mkA "" ;
lin blood_N = mkN "" ;
lin blow_V = mkV "" ;
lin blue_A = mkA "" ;
lin boat_N = mkN "" ;
lin bone_N = mkN "" ;
lin boot_N = mkN "" ;
lin boss_N = mkN "" ;
lin book_N = mkN "" ;
lin boy_N = mkN "" ;
lin bread_N = mkN "" ;
lin break_V2 = mkV2 "" ;
lin breast_N = mkN "" ;
lin breathe_V = mkV "" ;
lin broad_A = mkA "" ;
lin brother_N2 = mkN "" ;
lin brown_A = mkA "" ;
lin burn_V = mkV "" ;
lin butter_N = mkN "" ;
lin buy_V2 = mkV2 "" ;
----
-- C
lin camera_N = mkN "" ;
lin cap_N = mkN "" ;
lin car_N = mkN "" ;
lin carpet_N = mkN "" ;
lin cat_N = mkN "" ;
lin ceiling_N = mkN "" ;
lin chair_N = mkN "" ;
lin cheese_N = mkN "" ;
lin child_N = mkN "" ;
lin church_N = mkN "" ;
lin city_N = mkN "" ;
lin clean_A = mkA "" ;
lin clever_A = mkA "" ;
lin close_V2 = mkV2 "" ;
lin cloud_N = mkN "" ;
lin coat_N = mkN "" ;
lin cold_A = mkA "" ;
lin come_V = mkV "" ;
lin computer_N = mkN "" ;
lin correct_A = mkA "" ;
lin count_V2 = mkV2 "" ;
lin country_N = mkN "" ;
lin cousin_N = mkN "" ;
lin cow_N = mkN "" ;
lin cut_V2 = mkV2 "" ;
----
-- D
lin day_N = mkN "" ; -}
lin die_V = mkV "die" ;
{-lin dig_V = mkV "" ;
lin dirty_A = mkA "" ;
lin distance_N3 = mkN3 (mkN "") ;
lin do_V2 = mkV2 "" ;
lin doctor_N = mkN "" ;
lin dog_N = mkN "" ;
lin door_N = mkN "" ;
lin drink_V2 = mkV2 "" ;
lin dry_A = mkA "" ;
lin dull_A = mkA "" ;
lin dust_N = mkN "" ;
----
-- E
lin ear_N = mkN "" ;
lin earth_N = mkN "" ;
lin eat_V2 = mkV "" ;
lin egg_N = mkN "" ;
lin empty_A = mkA "" ;
lin enemy_N = mkN "" ;
lin eye_N = mkN "" ;
----
-- F
lin factory_N = mkN "" ;
lin fall_V = mkV "" ;
lin far_Adv = mkA "" ;
lin fat_N = mkN "" ;
lin father_N2 = mkN2 (mkN "") ;
lin fear_V2 = mkV2 "" ;
lin fear_VS = mkVS (mkV "") ;
lin feather_N = mkN "" ;
lin fight_V2 = mkV2 "" ;
lin find_V2 = mkV2 "" ;
lin fingernail_N = mkN "" ;
lin fire_N = mkN "" ;
lin fish_N = mkN "" ;
lin float_V = mkV "" ;
lin floor_N = mkN "" ;
lin flow_V = mkV "" ;
lin flower_N = mkN "" ;
lin fly_V = mkV "" ;
lin fog_N = mkN "" ;
lin foot_N = mkN "" ;
lin forest_N = mkN "" ;
lin forget_V2 = mkV2 "" ;
lin freeze_V = mkV "" ;
lin fridge_N = mkN "" ;
lin friend_N = mkN "" ;
lin fruit_N = mkN "" ;
lin full_A = mkA "" ;
--lin fun_AV
----
-- G
lin garden_N = mkN "" ;
lin girl_N = mkN "" ;
lin give_V3 = mkV3 (mkV "") ;
lin glove_N = mkN "" ;
lin go_V = mkV "" ;
lin gold_N = mkN "" ;
lin good_A = mkA "" ;
lin grammar_N = mkN "" ;
lin grass_N = mkN "" ;
lin green_A = mkA "" ;
----
-- H
lin hair_N = mkN "" ;-}
lin hand_N = smartN "làmh" Fem ;{-
lin harbour_N = mkN "" ;
lin hat_N = mkN "" ;
lin hate_V2 = mkV2 "" ;
lin head_N = mkN "" ;
lin hear_V2 = mkV2 "" ;
lin heart_N = mkN "" ;
lin heavy_A = mkA "" ;
lin hill_N = mkN "" ;
lin hit_V2 = mkV2 "" ;
lin hold_V2 = mkV2 "" ;
lin hope_VS = mkV "" ;
lin horn_N = mkN "" ;
lin horse_N = mkN "" ;
lin hot_A = mkA "" ;
lin house_N = mkN "" ;
lin hunt_V2 = mkV2 "" ;
lin husband_N = mkN "" ;
--------
-- I - K
lin ice_N = mkN "" ;
lin industry_N = mkN "" ;
lin iron_N = mkN "" ;
lin john_PN = mkPN "" ;
lin jump_V = mkV "" ;
lin kill_V2 = mkV2 "" ;
lin king_N = mkN "" ;
lin knee_N = mkN "" ;
lin know_V2 = mkV2 "" ;
lin know_VQ = mkVQ (mkV "") ;
lin know_VS = mkV "" ;
-}
----
-- L
lin lake_N = smartN "loch" "locha" "lochan" Masc ;
{-
lin lamp_N = mkN "" ;
lin language_N = mkN "" ;
lin laugh_V = mkV "" ;
lin leaf_N = mkN "" ;
lin learn_V2 = mkV2 "" ;
lin leather_N = mkN "" ;
lin leave_V2 = mkV2 "" ;
lin leg_N = mkN "" ;
lin lie_V = mkV "" ;
lin like_V2 = mkV2 "" ;
lin listen_V2 = mkV2 "" ;
lin live_V = mkV "";
lin liver_N = mkN "" ;
lin long_A = mkA "" ;
lin lose_V2 = mkV2 "" ;
lin louse_N = mkN "" ;
lin love_N = mkN "" ;
lin love_V2 = mkV2 "" ;
----
-- M
-}lin man_N = smartN "fear" Masc ;{-
lin married_A2 = mkA2 (mkA "") ;
lin meat_N = mkN "" ;
lin milk_N = mkN "" ;
lin moon_N = mkN "" ;
lin mother_N2 = mkN2 (mkN "") ;
lin mountain_N = mkN "" ;
lin mouth_N = mkN "" ;
lin music_N = mkN "" ;
----
-- N
lin name_N = mkN "" ;
lin narrow_A = mkA "" ;
lin near_A = mkA "" ;
lin neck_N = mkN "" ;
lin new_A = mkA "" ;
lin newspaper_N = mkN "" ;
lin night_N = mkN "" ;
lin nose_N = mkN "" ;
lin now_Adv = mkAdv "" ;
lin number_N = mkN "" ;
--------
-- O - P
lin oil_N = mkN "" ;
lin old_A = mkA "" ;
lin open_V2 = mkV2 "" ;
lin paint_V2A = mkV2A (mkV "") ;
lin paper_N = mkN "" ;
lin paris_PN = mkPN "Paris" ;
lin peace_N = mkN "" ;
lin pen_N = mkN "" ;
lin person_N = mkN "" ;
lin planet_N = mkN "" ;
lin plastic_N = mkN "" ;
lin play_V = mkV "" ;
lin policeman_N = mkN "" ;
lin priest_N = mkN "" ;
lin pull_V2 = mkV2 "" ;
lin push_V2 = mkV2 "" ;
lin put_V2 = mkV2 "" ;
--------
-- Q - R
lin queen_N = mkN "" ;
lin question_N = mkN "" ;
lin radio_N = mkN "" ;
lin rain_N = mkN "" ;
lin rain_V0 = mkV "" ;
lin read_V2 = mkV2 "" ;
lin ready_A = mkA "" ;
lin reason_N = mkN "" ;
lin red_A = mkA "" ;
lin religion_N = mkN "" ;
lin restaurant_N = mkN "" ;
lin river_N = mkN "" ;
lin road_N = mkN "" ;
lin rock_N = mkN "" ;
lin roof_N = mkN "" ;
lin root_N = mkN "" ;
lin rope_N = mkN "" ;
lin rotten_A = mkA "" ;
lin round_A = mkA "" ;
lin rub_V2 = mkV2 "" ;
lin rubber_N = mkN "" ;
lin rule_N = mkN "" ;
lin run_V = mkV "" ;
----
-- S
lin salt_N = mkN "" ;
lin sand_N = mkN "" ;
lin say_VS = mkVS (mkV "") ;
lin school_N = mkN "" ;
lin science_N = mkN "" ;
lin scratch_V2 = mkV2 "" ;
lin sea_N = mkN "" ;
lin see_V2 = mkV2 "" ;
lin seed_N = mkN "" ;
lin seek_V2 = mkV2 "" ;
lin sell_V3 = mkV3 (mkV "" Meng) emptyPrep emptyPrep ; -- TODO
lin send_V3 = mkV3 (mkV "") ;
lin sew_V = mkV "" ;
lin sharp_A = mkA "" ;
lin sheep_N = mkN "" fem ;
lin ship_N = mkN "" ;
lin shirt_N = mkN "" ;
lin shoe_N = mkN "" ;
lin shop_N = mkN "" ;
lin short_A = mkA "" ;
lin silver_N = mkN "" ;
lin sing_V = mkV "" ;
lin sister_N = mkN "" ;
lin sit_V = mkV "" ;
lin skin_N = mkN "" ;
lin sky_N = mkN "" ;
lin sleep_V = mkV "" ;
lin small_A = mkA "" ;
lin smell_V = mkV "" ;
lin smoke_N = mkN "" ;
lin smooth_A = mkA "" ;
lin snake_N = mkN "" ;
lin snow_N = mkN "" ;
lin sock_N = mkN "" ;
lin song_N = mkN "" ;
lin speak_V2 = mkV2 "" ;
lin spit_V = mkV "" ;
lin split_V2 = mkV2 "" ;
lin squeeze_V2 = mkV2 "" ;
lin stab_V2 = mkV2 "" ;
lin stand_V = mkV "" ;
lin star_N = mkN "" ;
lin steel_N = mkN "" ;
lin stick_N = mkN "" ;
lin stone_N = mkN "" ;
lin stop_V = mkV "" ;
lin stove_N = mkN "" ;
lin straight_A = mkA "" ;
lin student_N = mkN "" ;
lin stupid_A = mkA "" ;
lin suck_V2 = mkV2 "" ;
lin sun_N = mkN "" ;
lin swell_V = mkV "" ;
lin swim_V = mkV "" ;
----
-- T
lin table_N = mkN "" ;
lin tail_N = mkN "" ;
lin talk_V3 = mkV3 (mkV "" Ber) (mkPrep "") (mkPrep "") ;
lin teach_V2 = mkV2 "" ;
lin teacher_N = mkN "" ;
lin television_N = mkN "" ;
lin thick_A = mkA "" ;
lin thin_A = mkA "" ;
lin think_V = mkV "" ;
lin throw_V2 = mkV2 "" ;
lin tie_V2 = mkV2 "" ;
lin today_Adv = mkA "" ;
lin tongue_N = mkN "" ;
lin tooth_N = mkN "" ;
lin train_N = mkN "" ;
lin travel_V = mkV "" ;
lin tree_N = mkN "" ;
lin turn_V = mkV "" ;
--------
-- U - V
lin ugly_A = mkA "" ;
lin uncertain_A = mkA "" ;
lin understand_V2 = mkV2 "" ;
lin university_N = mkN "" ;
lin village_N = mkN "" ;
lin vomit_V = mkV2 "" ;
--------
-- W - Y
lin wait_V2 = mkV2 "" ;
lin walk_V = mkV "" ;
lin war_N = mkN "" ;
lin warm_A = mkA "" ;
lin wash_V2 = mkV2 "" ;
lin watch_V2 = mkV2 "" ;
lin water_N = mkNoun "" ;
lin wet_A = mkA "" ;
lin white_A = mkA "" ;
lin wide_A = mkA "" ;
lin wife_N = mkN "" ;
lin win_V2 = mkV2 "" ;
lin wind_N = mkN "" ;
lin window_N = mkN "" ;
lin wine_N = mkN "" ;
lin wing_N = mkN "" ;
lin wipe_V2 = mkV2 "" ;-}
lin woman_N = smartN "boireannach" Masc ;{-
lin wonder_VQ = mkVQ (mkV "") ;
lin wood_N = mkN "" ;
lin worm_N = mkN "" ;
lin write_V2 = mkV2 "" ;
lin year_N = mkN "" ;
lin yellow_A = mkA "" ;
lin young_A = mkA "" ;
-}
}

313
src/gaelic/MissingGla.gf Normal file
View File

@@ -0,0 +1,313 @@
resource MissingGla = open GrammarGla, Prelude in {
-- temporary definitions to enable the compilation of RGL API
oper AdAP : AdA -> AP -> AP = notYet "AdAP" ;
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
oper AdVVPSlash : AdV -> VPSlash -> VPSlash = notYet "AdVVPSlash" ;
oper AddAdvQVP : QVP -> IAdv -> QVP = notYet "AddAdvQVP" ;
oper AdjCN : AP -> CN -> CN = notYet "AdjCN" ;
oper AdjDAP : DAP -> AP -> DAP = notYet "AdjDAP" ;
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ;
oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ;
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
oper AdvImp : Adv -> Imp -> Imp = notYet "AdvImp" ;
oper AdvNP : NP -> Adv -> NP = notYet "AdvNP" ;
oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ;
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ;
oper AdvVP : VP -> Adv -> VP = notYet "AdvVP" ;
oper AdvVPSlash : VPSlash -> Adv -> VPSlash = notYet "AdvVPSlash" ;
oper ApposCN : CN -> NP -> CN = notYet "ApposCN" ;
oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ;
oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ;
oper BaseAdv : Adv -> Adv -> ListAdv = notYet "BaseAdv" ;
oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ;
oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ;
oper BaseNP : NP -> NP -> ListNP = notYet "BaseNP" ;
oper BaseRS : RS -> RS -> ListRS = notYet "BaseRS" ;
oper BaseS : S -> S -> ListS = notYet "BaseS" ;
oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ;
oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ;
oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ;
oper CompAP : AP -> Comp = notYet "CompAP" ;
oper CompAdv : Adv -> Comp = notYet "CompAdv" ;
oper CompCN : CN -> Comp = notYet "CompCN" ;
oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ;
oper CompIP : IP -> IComp = notYet "CompIP" ;
oper CompNP : NP -> Comp = notYet "CompNP" ;
oper ComparA : A -> NP -> AP = notYet "ComparA" ;
oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ;
oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ;
oper ComplA2 : A2 -> NP -> AP = notYet "ComplA2" ;
oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ;
oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ;
oper ComplSlash : VPSlash -> NP -> VP = notYet "ComplSlash" ;
oper ComplSlashIP : VPSlash -> IP -> QVP = notYet "ComplSlashIP" ;
oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ;
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
oper ConjAP : Conj -> ListAP -> AP = notYet "ConjAP" ;
oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ;
oper ConjAdv : Conj -> ListAdv -> Adv = notYet "ConjAdv" ;
oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ;
oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ;
oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ;
oper ConjNP : Conj -> ListNP -> NP = notYet "ConjNP" ;
oper ConjRS : Conj -> ListRS -> RS = notYet "ConjRS" ;
oper ConjS : Conj -> ListS -> S = notYet "ConjS" ;
oper ConsAP : AP -> ListAP -> ListAP = notYet "ConsAP" ;
oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ;
oper ConsAdv : Adv -> ListAdv -> ListAdv = notYet "ConsAdv" ;
oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ;
oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ;
oper ConsNP : NP -> ListNP -> ListNP = notYet "ConsNP" ;
oper ConsRS : RS -> ListRS -> ListRS = notYet "ConsRS" ;
oper ConsS : S -> ListS -> ListS = notYet "ConsS" ;
oper CountNP : Det -> NP -> NP = notYet "CountNP" ;
oper DetCN : Det -> CN -> NP = notYet "DetCN" ;
oper DetDAP : Det -> DAP = notYet "DetDAP" ;
oper DetNP : Det -> NP = notYet "DetNP" ;
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
oper EmbedS : S -> SC = notYet "EmbedS" ;
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ;
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
oper ExistNPAdv : NP -> Adv -> Cl = notYet "ExistNPAdv" ;
oper ExtAdvS : Adv -> S -> S = notYet "ExtAdvS" ;
oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ;
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
oper IdRP : RP = notYet "IdRP" ;
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
oper IdetIP : IDet -> IP = notYet "IdetIP" ;
oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ;
oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ;
oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ;
oper ImpVP : VP -> Imp = notYet "ImpVP" ;
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
oper MassNP : CN -> NP = notYet "MassNP" ;
oper NumCard : Card -> Num = notYet "NumCard" ;
oper NumDigits : Digits -> Card = notYet "NumDigits" ;
oper NumNumeral : Numeral -> Card = notYet "NumNumeral" ;
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ;
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
oper PConjConj : Conj -> PConj = notYet "PConjConj" ;
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
oper PartNP : CN -> NP -> CN = notYet "PartNP" ;
oper PassV2 : V2 -> VP = notYet "PassV2" ;
oper PhrUtt : PConj -> Utt -> Voc -> Phr = notYet "PhrUtt" ;
oper PositA : A -> AP = notYet "PositA" ;
oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ;
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
oper PossNP : CN -> NP -> CN = notYet "PossNP" ;
oper PossPron : Pron -> Quant = notYet "PossPron" ;
oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ;
oper PredVP : NP -> VP -> Cl = notYet "PredVP" ;
oper PredetNP : Predet -> NP -> NP = notYet "PredetNP" ;
oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ;
oper PrepNP : Prep -> NP -> Adv = notYet "PrepNP" ;
oper ProgrVP : VP -> VP = notYet "ProgrVP" ;
oper QuestCl : Cl -> QCl = notYet "QuestCl" ;
oper QuestIAdv : IAdv -> Cl -> QCl = notYet "QuestIAdv" ;
oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ;
oper QuestQVP : IP -> QVP -> QCl = notYet "QuestQVP" ;
oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ;
oper QuestVP : IP -> VP -> QCl = notYet "QuestVP" ;
oper ReflA2 : A2 -> AP = notYet "ReflA2" ;
oper ReflVP : VPSlash -> VP = notYet "ReflVP" ;
oper RelCN : CN -> RS -> CN = notYet "RelCN" ;
oper RelCl : Cl -> RCl = notYet "RelCl" ;
oper RelNP : NP -> RS -> NP = notYet "RelNP" ;
oper RelS : S -> RS -> S = notYet "RelS" ;
oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ;
oper RelVP : RP -> VP -> RCl = notYet "RelVP" ;
oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ;
oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ;
oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ;
oper SelfNP : NP -> NP = notYet "SelfNP" ;
oper SentAP : AP -> SC -> AP = notYet "SentAP" ;
oper SentCN : CN -> SC -> CN = notYet "SentCN" ;
oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ;
oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ;
oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ;
oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ;
oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ;
oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ;
oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ;
oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ;
oper SlashV2a : V2 -> VPSlash = notYet "SlashV2a" ;
oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ;
oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ;
oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
oper TFullStop : Phr -> Text -> Text = notYet "TFullStop" ;
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
oper Use3N3 : N3 -> N2 = notYet "Use3N3" ;
oper UseA2 : A2 -> AP = notYet "UseA2" ;
oper UseCl : Temp -> Pol -> Cl -> S = notYet "UseCl" ;
oper UseComp : Comp -> VP = notYet "UseComp" ;
oper UseComparA : A -> AP = notYet "UseComparA" ;
oper UseCopula : VP = notYet "UseCopula" ;
oper UseN : N -> CN = notYet "UseN" ;
oper UseN2 : N2 -> CN = notYet "UseN2" ;
oper UsePN : PN -> NP = notYet "UsePN" ;
oper UsePron : Pron -> NP = notYet "UsePron" ;
oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ;
oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ;
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
oper UseV : V -> VP = notYet "UseV" ;
oper UttAP : AP -> Utt = notYet "UttAP" ;
oper UttAdv : Adv -> Utt = notYet "UttAdv" ;
oper UttCN : CN -> Utt = notYet "UttCN" ;
oper UttCard : Card -> Utt = notYet "UttCard" ;
oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ;
oper UttIP : IP -> Utt = notYet "UttIP" ;
oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ;
oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ;
oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ;
oper UttInterj : Interj -> Utt = notYet "UttInterj" ;
oper UttNP : NP -> Utt = notYet "UttNP" ;
oper UttQS : QS -> Utt = notYet "UttQS" ;
oper UttS : S -> Utt = notYet "UttS" ;
oper UttVP : VP -> Utt = notYet "UttVP" ;
oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ;
oper VocNP : NP -> Voc = notYet "VocNP" ;
oper above_Prep : Prep = notYet "above_Prep" ;
oper active2passive : Cl -> Cl = notYet "active2passive" ;
oper after_Prep : Prep = notYet "after_Prep" ;
oper alas_Interj : Interj = notYet "alas_Interj" ;
oper all_Predet : Predet = notYet "all_Predet" ;
oper almost_AdA : AdA = notYet "almost_AdA" ;
oper almost_AdN : AdN = notYet "almost_AdN" ;
oper already_Adv : Adv = notYet "already_Adv" ;
oper although_Subj : Subj = notYet "although_Subj" ;
oper always_AdV : AdV = notYet "always_AdV" ;
oper as_CAdv : CAdv = notYet "as_CAdv" ;
oper at_least_AdN : AdN = notYet "at_least_AdN" ;
oper at_most_AdN : AdN = notYet "at_most_AdN" ;
oper because_Subj : Subj = notYet "because_Subj" ;
oper before_Prep : Prep = notYet "before_Prep" ;
oper behind_Prep : Prep = notYet "behind_Prep" ;
oper between_Prep : Prep = notYet "between_Prep" ;
oper both7and_DConj : Conj = notYet "both7and_DConj" ;
oper but_PConj : PConj = notYet "but_PConj" ;
oper by8agent_Prep : Prep = notYet "by8agent_Prep" ;
oper by8means_Prep : Prep = notYet "by8means_Prep" ;
oper dconcat : Digits -> Digits -> Digits = notYet "dconcat" ;
oper digits2num : Digits -> Numeral = notYet "digits2num" ;
oper digits2numeral : Card -> Card = notYet "digits2numeral" ;
oper dn : Dig -> Digit = notYet "dn" ;
oper dn10 : Dig -> Sub10 = notYet "dn10" ;
oper dn100 : Dig -> Dig -> Sub100 = notYet "dn100" ;
oper dn1000 : Dig -> Dig -> Dig -> Sub1000 = notYet "dn1000" ;
oper dn1000000a : Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000a" ;
oper dn1000000b : Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000b" ;
oper dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet "dn1000000c" ;
oper during_Prep : Prep = notYet "during_Prep" ;
oper either7or_DConj : Conj = notYet "either7or_DConj" ;
oper every_Det : Det = notYet "every_Det" ;
oper everybody_NP : NP = notYet "everybody_NP" ;
oper everything_NP : NP = notYet "everything_NP" ;
oper everywhere_Adv : Adv = notYet "everywhere_Adv" ;
oper except_Prep : Prep = notYet "except_Prep" ;
oper few_Det : Det = notYet "few_Det" ;
oper for_Prep : Prep = notYet "for_Prep" ;
oper from_Prep : Prep = notYet "from_Prep" ;
oper he_Pron : Pron = notYet "he_Pron" ;
oper here7from_Adv : Adv = notYet "here7from_Adv" ;
oper here7to_Adv : Adv = notYet "here7to_Adv" ;
oper here_Adv : Adv = notYet "here_Adv" ;
oper how8many_IDet : IDet = notYet "how8many_IDet" ;
oper how8much_IAdv : IAdv = notYet "how8much_IAdv" ;
oper how_IAdv : IAdv = notYet "how_IAdv" ;
oper i_Pron : Pron = notYet "i_Pron" ;
oper if_Subj : Subj = notYet "if_Subj" ;
oper if_then_Conj : Conj = notYet "if_then_Conj" ;
oper in8front_Prep : Prep = notYet "in8front_Prep" ;
oper in_Prep : Prep = notYet "in_Prep" ;
oper it_Pron : Pron = notYet "it_Pron" ;
oper john_PN : PN = notYet "john_PN" ;
oper language_title_Utt : Utt = notYet "language_title_Utt" ;
oper left_Ord : Ord = notYet "left_Ord" ;
oper less_CAdv : CAdv = notYet "less_CAdv" ;
oper many_Det : Det = notYet "many_Det" ;
oper more_CAdv : CAdv = notYet "more_CAdv" ;
oper most_Predet : Predet = notYet "most_Predet" ;
oper much_Det : Det = notYet "much_Det" ;
oper nd : Digit -> Dig = notYet "nd" ;
oper nd10 : Sub10 -> Digits = notYet "nd10" ;
oper nd100 : Sub100 -> Digits = notYet "nd100" ;
oper nd1000 : Sub1000 -> Digits = notYet "nd1000" ;
oper nd1000000 : Sub1000000 -> Digits = notYet "nd1000000" ;
oper no_Quant : Quant = notYet "no_Quant" ;
oper no_Utt : Utt = notYet "no_Utt" ;
oper nobody_NP : NP = notYet "nobody_NP" ;
oper not_Predet : Predet = notYet "not_Predet" ;
oper nothing_NP : NP = notYet "nothing_NP" ;
oper num : Sub1000000 -> Numeral = notYet "num" ;
oper num2digits : Numeral -> Digits = notYet "num2digits" ;
oper on_Prep : Prep = notYet "on_Prep" ;
oper only_Predet : Predet = notYet "only_Predet" ;
oper or_Conj : Conj = notYet "or_Conj" ;
oper otherwise_PConj : PConj = notYet "otherwise_PConj" ;
oper part_Prep : Prep = notYet "part_Prep" ;
oper please_Voc : Voc = notYet "please_Voc" ;
oper possess_Prep : Prep = notYet "possess_Prep" ;
oper pot01 : Sub10 = notYet "pot01" ;
oper pot1 : Digit -> Sub100 = notYet "pot1" ;
oper pot110 : Sub100 = notYet "pot110" ;
oper pot111 : Sub100 = notYet "pot111" ;
oper pot1plus : Digit -> Sub10 -> Sub100 = notYet "pot1plus" ;
oper pot1to19 : Digit -> Sub100 = notYet "pot1to19" ;
oper pot2 : Sub10 -> Sub1000 = notYet "pot2" ;
oper pot2plus : Sub10 -> Sub100 -> Sub1000 = notYet "pot2plus" ;
oper pot3 : Sub1000 -> Sub1000000 = notYet "pot3" ;
oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ;
oper quite_Adv : AdA = notYet "quite_Adv" ;
oper right_Ord : Ord = notYet "right_Ord" ;
oper she_Pron : Pron = notYet "she_Pron" ;
oper so_AdA : AdA = notYet "so_AdA" ;
oper somePl_Det : Det = notYet "somePl_Det" ;
oper someSg_Det : Det = notYet "someSg_Det" ;
oper somebody_NP : NP = notYet "somebody_NP" ;
oper something_NP : NP = notYet "something_NP" ;
oper somewhere_Adv : Adv = notYet "somewhere_Adv" ;
oper that_Quant : Quant = notYet "that_Quant" ;
oper that_Subj : Subj = notYet "that_Subj" ;
oper there7from_Adv : Adv = notYet "there7from_Adv" ;
oper there7to_Adv : Adv = notYet "there7to_Adv" ;
oper there_Adv : Adv = notYet "there_Adv" ;
oper therefore_PConj : PConj = notYet "therefore_PConj" ;
oper they_Pron : Pron = notYet "they_Pron" ;
oper this_Quant : Quant = notYet "this_Quant" ;
oper through_Prep : Prep = notYet "through_Prep" ;
oper to_Prep : Prep = notYet "to_Prep" ;
oper too_AdA : AdA = notYet "too_AdA" ;
oper under_Prep : Prep = notYet "under_Prep" ;
oper very_AdA : AdA = notYet "very_AdA" ;
oper we_Pron : Pron = notYet "we_Pron" ;
oper whatPl_IP : IP = notYet "whatPl_IP" ;
oper whatSg_IP : IP = notYet "whatSg_IP" ;
oper when_IAdv : IAdv = notYet "when_IAdv" ;
oper when_Subj : Subj = notYet "when_Subj" ;
oper where_IAdv : IAdv = notYet "where_IAdv" ;
oper which_IQuant : IQuant = notYet "which_IQuant" ;
oper whoPl_IP : IP = notYet "whoPl_IP" ;
oper whoSg_IP : IP = notYet "whoSg_IP" ;
oper why_IAdv : IAdv = notYet "why_IAdv" ;
oper with_Prep : Prep = notYet "with_Prep" ;
oper without_Prep : Prep = notYet "without_Prep" ;
oper yes_Utt : Utt = notYet "yes_Utt" ;
oper youPl_Pron : Pron = notYet "youPl_Pron" ;
oper youPol_Pron : Pron = notYet "youPol_Pron" ;
oper youSg_Pron : Pron = notYet "youSg_Pron" ;
}

36
src/gaelic/NamesGla.gf Normal file
View File

@@ -0,0 +1,36 @@
concrete NamesGla of Names = CatGla ** open Prelude in {
-- An API layer to deal with names
-- Not part of the RGL API, but used in the AW project
-- So depends on your goals whether this is high or low priority to implement.
{-
lin
-- : GN -> NP ;
GivenName gn =
-- : SN -> NP ;
MaleSurname sn =
-- : SN -> NP ;
FemaleSurname sn =
-- : SN -> NP ;
PlSurname sn =
-- : GN -> SN -> NP ;
FullName gn sn =
lin
-- : LN -> NP ;
UseLN ln =
-- : LN -> NP ;
PlainLN ln =
-- : LN -> Adv ;
InLN ln =
-- : AP -> LN -> LN ;
AdjLN ap ln =
-}
}

215
src/gaelic/NounGla.gf Normal file
View File

@@ -0,0 +1,215 @@
concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
flags optimize=all_subs ;
lin
--2 Noun phrases
-- : Det -> CN -> NP
DetCN det cn = emptyNP ** {
art = det.s ! cn.g ;
s = \\c => cn.s ! getNForm det.dt c ;
a = NotPron det.dt ;
} ;
-- : PN -> NP ;
-- Assuming that lincat PN = lincat NP
-- UsePN pn = pn ;
-- : Pron -> NP ;
-- Assuming that lincat Pron = lincat NP
UsePron pron = emptyNP ** pron ** {
s = \\c => pron.s ! npc2cc c ;
a = IsPron pron.a
} ;
{-
-- : Predet -> NP -> NP ; -- only the man
PredetNP predet np =
-- A noun phrase can also be postmodified by the past participle of a
-- verb, by an adverb, or by a relative clause
-- low prio
-- : NP -> V2 -> NP ; -- the man seen
-- PPartNP np v2 = np ** {
-- s =
-- } ;
-- : NP -> Adv -> NP ; -- Paris today
AdvNP np adv = np ** {
s = np.s ++ "," ++ adv.s
} ;
-- : NP -> Adv -> NP ; -- boys, such as ..
ExtAdvNP np adv = AdvNP np {s = "," ++ adv.s} ;
-- : NP -> RS -> NP ; -- Paris, which is here
RelNP np rs = np ** {
} ;
-- Determiners can form noun phrases directly.
-- : Det -> NP ;
DetNP det = emptyNP ** {
s = \\_ => linDet det ;
} ;
-}
-- MassNP : CN -> NP ;
MassNP cn = emptyNP ** {
s = \\c => cn.s ! getNForm (DDef Sg Indefinite) c -- no article, singular indefinite forms, open for cases+mutations
} ;
--2 Determiners
-- The determiner has a fine-grained structure, in which a 'nucleus'
-- quantifier and an optional numeral can be discerned.
-- : Quant -> Num -> Det ;
DetQuant quant num = quant ** {
s = \\g,c => getArt quant num.n g c ++ num.s ;
s2 = \\g,c => "DUMMY" ; -- "teen" from numbers like seventeen
dt = case quant.qt of {
QDef defi => DDef num.n defi ;
QPoss agr => DPoss num.n agr } ;
} ;
-- : Quant -> Num -> Ord -> Det ;
-- DetQuantOrd quant num ord = quant ** {
-- } ;
-- Whether the resulting determiner is singular or plural depends on the
-- cardinal.
-- All parts of the determiner can be empty, except $Quant$, which is
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
-- the inherent number.
NumSg = {s = [] ; n = Sg} ;
NumPl = {s = [] ; n = Pl} ;
{-
-- : Card -> Num ; -- two
NumCard card = card ;
-- : Digits -> Card ;
NumDigits dig = -- probably like OrdDigits, but choose the NCard form
-- : Numeral -> Card ;
NumNumeral num = {
s = num.s ! NCard ;
n = num.n -- inherits grammatical number (Sg, Pl, …) from the Numeral
} ;
-- : AdN -> Card -> Card ;
AdNum adn card = card ** { s = adn.s ++ card.s } ;
-- : Digits -> Ord ;
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
-- : Numeral -> Ord ;
OrdNumeral num = {
s = num.s ! NOrd
} ;
-- : A -> Ord ;
OrdSuperl a = {
s = "most" ++ a.s ! Superl
} ;
-- One can combine a numeral and a superlative.
-- : Numeral -> A -> Ord ; -- third largest
OrdNumeralSuperl num a = {
s = num.s ! NOrd ++ a.s ! Superl
} ;
-}
-- : Quant
DefArt = ResGla.defArt ;
-- : Quant
IndefArt = mkQuant [] (QDef Indefinite) ;
-- : Pron -> Quant -- my
PossPron pron = mkQuant pron.poss (QPoss pron.a) ;
--2 Common nouns
-- : N -> CN
UseN = useN ;
{-
-- : N2 -> CN ;
UseN2 n2 =
-- : N2 -> NP -> CN ;
ComplN2 n2 np =
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
ComplN3 n3 np =
-- : N3 -> N2 ; -- distance (from this city)
Use2N3 n3 = lin N2 n3 ** { c2 = n3.c3 } ;
-- : N3 -> N2 ; -- distance (to Paris)
Use3N3 n3 = lin N2 n3 ;
-- : AP -> CN -> CN
AdjCN ap cn =
-- : CN -> RS -> CN ;
RelCN cn rs =
-- : CN -> Adv -> CN ;
AdvCN cn adv =
-- Nouns can also be modified by embedded sentences and questions.
-- For some nouns this makes little sense, but we leave this for applications
-- to decide. Sentential complements are defined in VerbGla.
-- : CN -> SC -> CN ; -- question where she sleeps
SentCN cn sc =
--2 Apposition
-- This is certainly overgenerating.
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
ApposCN cn np = cn ** {
s =
} ;
--2 Possessive and partitive constructs
-- NB. Below this, the functions are not in the API, so lower prio to implement
-- : PossNP : CN -> NP -> CN ;
-- in English: book of someone; point is that we can add a determiner to the CN,
-- so it can become "a book of someone" or "the book of someone"
PossNP cn np =
-- : Det -> NP -> NP ; -- three of them, some of the boys
CountNP det np = -- Nonsense for DefArt or IndefArt, but don't worry about that! RGL can contain weird sentences, as long as it contains the non-weird stuff we want
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
PartNP cn np =
--3 Conjoinable determiners and ones with adjectives
-- : DAP -> AP -> DAP ; -- the large (one)
AdjDAP dap ap = dap ** {
} ;
-- : Det -> DAP ; -- this (or that)
DetDAP det = det ;
-}
}

117
src/gaelic/NumeralGla.gf Normal file
View File

@@ -0,0 +1,117 @@
concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
open Prelude, ResGla in {
{-
lincat
Digit = LinNumeral ; -- 2..9
Sub10, -- 1..9
Sub100, -- 1..99
Sub1000, -- 1..999
Sub1000000, -- 1..999999
Sub1000000000, -- 1..999999999
Sub1000000000000 -- 1..999999999999
= LinNumeral ;
-- param CardOrd defined in ResGla
-- type LinNumeral -""-
lin
-- : Sub1000000 -> Numeral ; -- 123456 [coercion to top category]
num x = x ;
-- : Digit ;
n2 = mkNumeral "two" ;
n3 = mkNumeral "three" ;
n4 = mkNumeral "four" ;
n5 = mkNumeral "five" ;
n6 = mkNumeral "six" ;
n7 = mkNumeral "seven" ;
n8 = mkNumeral "eight" ;
n9 = mkNumeral "nine" ;
-- : Sub10 ; -- 1
-- pot01 =
-- : Digit -> Sub10 ; -- d * 1
pot0 d = d ;
-- : Sub100 ; -- 10
-- pot110 = mkNum "ten" ;
-- : Sub100 ; -- 11
-- pot111 = mkNum "eleven" ;
-- : Digit -> Sub100 ; -- 10 + d
-- pot1to19 d =
-- : Sub10 -> Sub100 ; -- coercion of 1..9
pot0as1 n = n ;
-- : Digit -> Sub100 ; -- d * 10
-- pot1 d =
-- : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
-- pot1plus d e =
-- : Sub100 -> Sub1000 ; -- coercion of 1..99
pot1as2 n = n ;
-- : Sub10 -> Sub1000 ; -- m * 100
-- pot2 d =
-- : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
-- pot2plus d e =
-- : Sub1000 -> Sub1000000 ; -- coercion of 1..999
pot2as3 n = n ;
-- : Sub1000 -> Sub1000000 ; -- m * 1000
-- pot3 d =
-- : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
-- pot3plus d e =
--------------------------------------------------------------------------------
-- Numerals as sequences of digits have a separate, simpler grammar
--
lincat
Dig = LinDig ; -- single digit 0..9
lin
-- : Dig -> Digits ; -- 8
IDig d = d ;
-- : Dig -> Digits -> Digits ; -- 876
IIDig d e = {
s = table {
NCard => glue (d.s ! NCard) (e.s ! NCard) ;
NOrd => glue (d.s ! NCard) (e.s ! NOrd)
} ;
n = Pl ;
} ;
-- : Dig ;
D_0 = mkDig "0" ;
D_1 = mkDig "1" ;
D_2 = mkDig "2" ;
D_3 = mkDig "3" ;
D_4 = mkDig "4" ;
D_5 = mkDig "5" ;
D_6 = mkDig "6" ;
D_7 = mkDig "7" ;
D_8 = mkDig "8" ;
D_9 = mkDig "9" ;
oper
LinDig : Type = {s : CardOrd => Str ; n : Number} ;
mkDig : Str -> LinDig = \s -> {
s = table {
NCard => s ;
NOrd => s + "th"
} ;
n = Pl ; -- TODO: handle number 1
} ;
-}
}

213
src/gaelic/ParadigmsGla.gf Normal file
View File

@@ -0,0 +1,213 @@
resource ParadigmsGla = open CatGla, ResGla, NounGla, Prelude in {
oper
--2 Parameters
--
-- To abstract over number, valency and (some) case names,
-- we define the following identifiers. The application programmer
-- should always use these constants instead of the constructors
-- defined in $ResSom$.
Prep : Type ;
noPrep : Prep ;
-- Add more overload instances if needed for all categories!
--2 Nouns
mkN : overload {
mkN : Str -> N ; -- Predictable nouns
} ;
mkPN : overload {
mkPN : Str -> PN ; -- Proper nouns
} ;
--2 Adjectives
mkA : overload {
mkA : Str -> A ; -- Predictable adjective
} ;
mkA2 : overload {
mkA2 : Str -> A2 ; -- Predictable A2, no preposition
mkA2 : A -> Prep -> A2 ; -- A2 made from A and Prep
} ;
--2 Verbs
-- Verbs
mkV : overload {
mkV : Str -> V ; -- Predictable verb
} ;
mkV2 : overload {
mkV2 : Str -> V2 ; -- Predictable transitive verb
mkV2 : V -> Prep -> V2 ; -- V2 made from V and Prep
} ;
mkV3 : overload {
mkV3 : V -> V3 ; -- No prepositions
mkV3 : V -> Prep -> Prep -> V3 ; -- Prepositions for direct and indirect objects given
} ;
mkVV : overload {
mkVV : V -> VV ;
} ;
mkVA : overload {
mkVA : V -> VA ;
} ;
mkVQ : overload {
mkVQ : V -> VQ ;
} ;
mkVS : overload {
mkV : V -> VS ;
} ;
-- Etc. do the same for other V subcats (V2A, V2V, V2S, …)
-----
--2 Structural categories
-- If prepositions take case, add that as argument to mkPrep
-- mkPrep : overload {
-- mkPrep : Str -> Prep ;
-- } ;
-- TODO: should export the whole set of morphologically complex prepositions here and not let users construct them alone
-- but should include funs like "override complement case for existing preps"
mkConj : overload {
mkConj : (and : Str) -> Conj ; -- (coffee) and (tea)
mkConj : (either : Str) -> (or : Str) -> Conj ; -- either (coffee) or (tea)
} ;
mkSubj : overload {
mkSubj : Str -> Subj ;
} ;
mkAdv : overload {
mkAdv : Str -> Adv ;
} ;
mkAdV : overload {
mkAdV : Str -> AdV ;
} ;
mkAdA : overload {
mkAdA : Str -> AdA ;
} ;
--.
-------------------------------------------------------------------------------
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
Prep = CatGla.Prep ;
noPrep = lin Prep ResGla.emptyPrep ;
-- Add more overload instances if needed for all categories!
-- For explanation of `lin N`, see
-- https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields
mkN = overload {
mkN : Str -> N = \s -> lin N (ResGla.smartN s (s+"a") (s+"an") Masc) ;
-- TODO: more overload instances
} ;
{-
mkPN = overload {
mkPN : Str -> PN = …
} ;
--2 Adjectives
mkA = overload {
mkA : Str -> A = \s -> …
} ;
mkA2 = overload {
mkA2 : Str -> A2 = \s -> …
mkA2 : A -> Prep -> A2 = \s -> …
} ;
--2 Verbs
-}
-- Verbs
mkV = overload {
mkV : Str -> V = \s -> lin V (mkVerb s) ;
} ;
{-
mkV2 = overload {
mkV2 : Str -> V2 = \s -> …
mkV2 : V -> Prep -> V2 = \s -> …
} ;
mkV3 = overload {
mkV3 : V -> V3 = \s -> …
mkV3 : V -> Prep -> Prep -> V3 = \s -> …
} ;
mkVV = overload {
mkVV : V -> VV = \s -> …
} ;
mkVA = overload {
mkVA : V -> VA = \s -> …
} ;
mkVQ = overload {
mkVQ : V -> VQ = \s -> …
} ;
mkVS = overload {
mkV : V -> VS = \s -> …
} ;
-- Etc. do the same for other V subcats (V2A, V2V, V2S, …)
-----
-}
{-
-- If prepositions take case, add that as argument to mkPrep
mkPrep = overload {
mkPrep : Str -> Prep = \s -> lin Prep {s = s} ;
} ;
mkConj = overload {
mkConj : (and : Str) -> Conj = \s -> …
mkConj : (either : Str) -> (or : Str) -> Conj = \s -> …
} ;
mkSubj = overload {
mkSubj : Str -> Subj = \s -> …
} ;
mkAdv = overload {
mkAdv : Str -> Adv = \s -> …
} ;
mkAdV = overload {
mkAdV : Str -> AdV = \s -> …
} ;
mkAdA = overload {
mkAdA : Str -> AdA = \s -> …
} ;
-}
--------------------------------------------------------------------------------
}

27
src/gaelic/PhraseGla.gf Normal file
View File

@@ -0,0 +1,27 @@
concrete PhraseGla of Phrase = CatGla ** open Prelude, ResGla in {
lin
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
UttS s = s ;
{-
UttQS qs = qs ;
UttIAdv iadv = iadv ;
UttNP np =
UttIP ip =
UttImpSg pol imp = { s = pol.s ++ imp.s ! Sg ! pol.p } ;
UttImpPl pol imp =
UttImpPol pol imp = {s = pol.s ++ imp.s ! Sg ! pol.p} ;
UttVP vp = {s = linVP vp} ;
UttAP ap = { s = ap.s } ;
UttAdv adv = {s = } ;
UttCN n = {s = } ;
UttCard n = {s = } ;
UttInterj i = i ; -}
NoPConj = {s = []} ;
-- PConjConj conj = {s = conj.s1 ++ conj.s2 ! …} ;
NoVoc = {s = []} ;
-- VocNP np = { s = "," ++ np.s ! … } ;
}

105
src/gaelic/QuestionGla.gf Normal file
View File

@@ -0,0 +1,105 @@
concrete QuestionGla of Question = CatGla ** open
Prelude, ResGla, ParadigmsGla, (V=VerbGla), (Noun=NounGla), (S=StructuralGla) in {
-- A question can be formed from a clause ('yes-no question') or
-- with an interrogative.
-- Interrogative pronouns can be formed with interrogative
-- determiners, with or without a noun.
{-
lin
-- : IDet -> CN -> IP ; -- which five songs
IdetCN idet cn = Noun.DetCN idet cn ** {
} ;
-- : IDet -> IP ; -- which five
IdetIP idet = Noun.DetNP idet ** {sp = idet.sp};
-- : IQuant -> Num -> IDet ; -- which (five)
IdetQuant iquant num = iquant ** {
} ;
-- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls = cls ** {
} ;
-- : Cl -> QCl ;
QuestCl cl = cl ** {
};
-- : IP -> VP -> QCl ;
QuestVP ip cl = cl ** {
} ;
-- : IAdv -> Cl -> QCl ; -- why does John walk
QuestIAdv iadv cls = {
} ;
-- : IP -> IComp ;
CompIP ip = {s = ip.s ! } ; -- who (is it)
-- : IComp -> NP -> QCl ; -- where is John?
QuestIComp icomp np = {
} ;
-- Interrogative pronouns can be formed with interrogative
-- determiners, with or without a noun.
-- : IDet -> CN -> IP ; -- which five songs
IdetCN idet cn =
-- : IDet -> IP ; -- which five
IdetIP idet =
-- They can be modified with adverbs.
-- : IP -> Adv -> IP ; -- who in Paris
AdvIP = Noun.AdvNP ;
-- Interrogative quantifiers have number forms and can take number modifiers.
-- : IQuant -> Num -> IDet ; -- which (five)
IdetQuant = Noun.DetQuant ;
-- Interrogative adverbs can be formed prepositionally.
-- : Prep -> IP -> IAdv ; -- with whom
PrepIP prep ip =
-- They can be modified with other adverbs.
-- : IAdv -> Adv -> IAdv ; -- where in Paris
AdvIAdv iadv adv =
-- Interrogative complements to copulas can be both adverbs and
-- pronouns.
-- : IAdv -> IComp ;
CompIAdv iadv = iadv ; -- where (is it)
-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$.
-- Wh questions with two or more question words require a new, special category.
lincat
-- buy what where
QVP =
lin
-- : VPSlash -> IP -> QVP ; -- buys what
ComplSlashIP vps ip =
-- : VP -> IAdv -> QVP ; -- lives where
AdvQVP vp iadv =
-- : QVP -> IAdv -> QVP ; -- buys what where
AddAdvQVP qvp iadv =
-- : IP -> QVP -> QCl ; -- who buys what where
QuestQVP ip qvp =
-}
}

24
src/gaelic/RelativeGla.gf Normal file
View File

@@ -0,0 +1,24 @@
concrete RelativeGla of Relative = CatGla ** open
ResGla, Prelude in {
{-
lin
-- : Cl -> RCl ; -- such that John loves her
RelCl cl = cl ** {
} ;
-- : RP -> VP -> RCl ;
RelVP rp vp = {
} ;
-- : RP -> ClSlash -> RCl ; -- who I went with
RelSlash rp cls = {
} ;
-- : RP ;
IdRP = {s = "that"} ;
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
FunRP prep np rp =
-}
}

625
src/gaelic/ResGla.gf Normal file
View File

@@ -0,0 +1,625 @@
resource ResGla = open Prelude, Predef in {
--------------------------------------------------------------------------------
-- General notes
-- ** Naming **
{-
I'm using the naming scheme for lincats and opers as explained here:
https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#my-naming-scheme-for-lincats-and-opers
-}
-- ** File structure **
-- The rest of this module is organised as follows:
-----------------------------
-- Grammatical categor(y|ies)
{-
General comments on the cat(s)
params related to the cat(s)
opers related to the cat(s)
-}
--------------------------------------------------------------------------------
-- Nouns
param
Gender = Masc | Fem ;
CoreCase = Nom Mutation | Gen | Dat Mutation ;
Case = CC CoreCase | Voc ;
-- NPCase = NPC CoreCase | NPVoc ;
Mutation = Lenited | NoMutation ;
Number = Sg
| Pl
;
Person = P1 | P2 | P3 ;
Definiteness = Definite | Indefinite ; -- Some prepositions govern different case when definite vs. indefinite
oper
NOM : CoreCase = Nom NoMutation ; -- shorthand
npc2cc : Case -> CoreCase = \npc -> case npc of {
CC c => c ;
_ => NOM
} ;
param
NForm =
Indef Number CoreCase
| Def Number Case
| Dual -- only after number 2, only for a handful of nouns. TODO: does it have different cases?
;
oper
getNForm : DType -> Case -> NForm = \d,c ->
case <d,c> of {
<DDef n Indefinite,Voc> => Def n Voc ;
<DDef n Indefinite,CC c> => Indef n c ;
<DDef n Definite,c> => Def n c ;
<DPoss n _,Voc> => Indef n NOM ; -- as per Michal on Discord https://discord.com/channels/865093807343140874/865094084683366400/1409838154550087711 . TODO: Def or Indef nom ????
<DPoss n _,c> => Def n c -- ????????????????
} ;
LinN : Type = {
base, -- tunnag fuil loch fear litir bròg
dat, -- -"- bròig (1B)
gen, -- tunnaige fala locha fir litreach ("de-palatalised") bròige
pl, -- tunnagan lochan fir litrichean brògan
-- pldat, -- Krasimir's and Katya's automatic extraction suggests there's a difference, but I don't see it
-- add this form if we turn out to need it
-- TODO: for nouns that only use suffixes, should these just show theoretical forms?
lenited, -- thunnag fhuil loch fhear
palatalised, -- tunnaig fuil loch fir
lenited_palatalised, -- thunnaig fhuil loch fhir
lenited_plural
: Str ;
g : Gender
} ;
mk5N : (nom,gen,dat,pl : Str) -> Gender -> LinN = \brog,broige,broig,brogan,g -> {
base = brog ;
gen = broige ;
dat = broig ;
pl = brogan ;
lenited_plural = lenite brogan ;
lenited = bhrog ;
palatalised = broig ;
lenited_palatalised = bhroig ;
g = g
} where {
bhrog : Str = lenite brog ;
bhroig : Str = lenite broig } ;
smartN = overload {
smartN : (nom,gen,pl : Str) -> Gender -> LinN = \loch,locha,lochan,g ->
mk5N loch locha loch lochan g ;
smartN : (base : Str) -> Gender -> LinN = \tunnag,g ->
let fm : Str -> Str -> Str = \fem,masc -> case g of {
Fem => fem ; Masc => masc } ;
tunnaig : Str = palatalise tunnag ;
tunnaige : Str = fm (tunnaig + "e") tunnaig ;
tunnagan : Str = fm (tunnag + "an") tunnaig ;
in mk5N tunnag tunnaige tunnag tunnagan g
} ;
vowel : pattern Str = #("a"|"à"|"e"|"i"|"ì"|"o"|"u") ; -- more accents?
diphthong : pattern Str = #("ea"|"oi") ;
lenitable : pattern Str = #("b"|"c"|"f"|"g"|"m"|"p"|"d"|"t"|"s") ;
labial : pattern Str = #("b"|"f"|"m"|"p") ;
palatalise : Str -> Str = \lamh -> case lamh of {
f@? + "ea" + r => f + "i" + r ; -- TODO is this irregular?
boireann@(_ + (#vowel|#diphthong) + ? + _ + (#vowel|#diphthong) + ? + _)
+ a@#vowel + ch => boireann + a + "i" + ch ;
tunn@(_ + (#vowel|#diphthong) + ? + _)
+ a@#vowel + g => tunn + a + "i" + g ;
l + a@#vowel + mh => l + a + "i" + mh ;
_ => lamh } ;
lenite : Str -> Str = \tunnag -> case tunnag of {
"s" + ("p"|"g"|"m"|"t") + _ => tunnag ; -- sp, sg, sm, st don't lenite
t@#lenitable + "h" + _ => tunnag ; -- don't lenite twice
t@#lenitable + unnag => t + "h" + unnag ;
_ => tunnag } ;
-- For inflection paradigms, see http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html#toc56
mkNoun : (b,g,d,pl,l,p,lp,lpl : Str) -> Gender -> LinN = \b,gen,dat,pl,l,p,lp,lpl,g -> {
base = b ; -- tunnag fuil loch fear litir
gen = gen ; -- tunnaige fala locha fir litreach
dat = dat ; -- tunnaige fala locha fir litreach
pl = pl ; -- tunnagan lochan fir litrichean
lenited = l ; -- thunnag fhuil loch fhear litir ?
palatalised = p ; -- tunnaig fuil loch fir litir ?
lenited_palatalised = lp ; -- thunnaig fhuil loch fhir litir ?
lenited_plural = lpl ; -- thunnagan lochan fhir litrichean ?
g = g ;
} ;
-- TODO: no idea if this is even remotely correct
-- can always replace morphology with Katya's automated tool
useN : LinN -> LinCN = \n -> n ** {
s = table {
Indef Sg (Nom NoMutation) => n.base ;
Indef Sg (Nom Lenited) => n.lenited ;
Indef Sg Gen => n.gen ;
Indef Sg (Dat NoMutation) => n.dat ;
Indef Sg (Dat Lenited) => fm n.lenited_palatalised n.lenited ; ------- FIXME later
Def Sg (CC (Nom NoMutation)) => n.base ;
Def Sg (CC (Nom Lenited)) => n.lenited ;
Def Sg (CC Gen) => fm n.gen n.lenited_palatalised ;
Def Sg (CC (Dat NoMutation)) => fm n.palatalised n.lenited ;
Def Sg (CC (Dat Lenited)) => fm n.lenited_palatalised n.lenited ;
Def Sg Voc => fm n.lenited n.lenited_palatalised ;
Indef Pl (Nom NoMutation) => fm n.pl n.palatalised ;
Indef Pl (Nom Lenited) => fm n.lenited_plural n.lenited_palatalised ;
Indef Pl Gen => n.lenited ;
Indef Pl (Dat NoMutation) => fm n.pl n.palatalised ; -- TODO: is this overfitting based on the 5 nouns i know? probably!
Indef Pl (Dat Lenited) => fm n.lenited_plural n.lenited_palatalised ; -- TODO: see above
Def Pl (CC (Nom NoMutation)) => n.pl ;
Def Pl (CC (Nom Lenited)) => n.lenited_plural ;
Def Pl (CC Gen) => n.base ;
Def Pl (CC (Dat NoMutation)) => n.pl ;
Def Pl (CC (Dat Lenited)) => n.lenited_plural ;
Def Pl Voc => glue n.lenited "a" ;
Dual => fm n.palatalised n.base -- TODO: is this correct? only for 1-syllable feminine nouns?
}
} where {
fm : Str -> Str -> Str = \fem,masc -> case n.g of {
Fem => fem ;
Masc => masc
}
};
LinCN : Type = {
s : NForm =>
Str ;
g : Gender ;
-- ** postmod/premod/… : Str -- if needed? determiners can put stuff after head but it only comes at NP
} ;
linCN : LinCN -> Str = \cn -> cn.s ! Indef Sg NOM
-- ++ cn.postmod -- If there is another field, use here
;
-- some test nouns — TODO: do smart paradigms
tunnag_N : LinN = {
base,dat = "tunnag" ;
gen = "tunnaige" ;
pl = "tunnagan" ;
lenited_plural = "thunnagan" ;
lenited = "thunnag" ;
palatalised = "tunnaig" ;
lenited_palatalised = "thunnaig" ;
g = Fem ;
} ;
boireannach_N : LinN = {
base,dat = "boireannach" ;
pl,gen = "boireannaich" ;
lenited = "bhoireannach" ;
palatalised = "boireannaich" ;
lenited_palatalised,
lenited_plural = "bhoireannaich" ;
g = Masc ;
} ;
---------------------------------------------
-- Proper noun
oper
LinPN : Type = {
s : Str ;
n : Number ; -- Proper nouns often have already an inherent number; you don't usually say "a Paris / many Parises"
g : Gender ; -- inherent gender/noun class, if your language has that
} ;
---------------------------------------------
-- Numeral
-- Used in NumeralGla
param
CardOrd = NCard | NOrd ;
oper
LinNumeral : Type = {s : CardOrd => Str ; n : Number} ;
mkNumeral : (card, ord : Str) -> LinNumeral = \card,ord -> {
s = table {
NCard => card ; -- aon(a) -- TODO: allomorph of this depends on the following word?
NOrd => ord -- a' chiad
} ;
n = Pl ; -- NB. singular for 1, 2, 20 + multiples of 20 and 100 (Lamb, p. 218)
} ;
---------------------------------------------
-- Pronoun
oper
LinPron : Type = {
s : CoreCase => Str ;
a : PronAgr ;
poss : Str ; -- if a case is needed, it comes from the Prep! TODO verify this (do we ever need a dative for poss pron without a prep present? some preps merge, others not, but the pronoun is present in all the preps. why this way—I counted on there being fewer pronouns than prepositions.)
empty : Str ; -- to prevent metavariables
} ;
-- TODO: nicer API where you can give Person, Number, Gender etc.
-- not this weird unintuitive Agr param
mkPron : (subj,poss : Str) -> PronAgr -> LinPron = \subj,poss,agr -> {
s = table {
Nom _ => subj ;
_ => "gam" -- TODO fix this
} ;
poss = poss ;
a = agr ;
empty = []
} ;
---------------------------------------------
-- NP
{-
In the RGL, a NP may come from a common noun, proper noun or pronoun.
Pronouns are the only ones that have an inherent person (nouns are almost always 3rd person! please give me counterexamples if you can think of any.)
So we can often say that NP's lincat is the same as Prons.
NB. for later, when you want to make Pron into possessives, you may need more fields in LinPron than in LinNP.
That's why I'm copying over the definition below, instead of the neater `LinNP : Type = LinPron`.
-}
oper
LinNP : Type = {
art, -- to be replaced with a combo coming from Prep, if argument of PrepNP? see Lamb p. 225
-- TODO: is that an issue when the allomorph has been chosen by an inherent param in CN?
-- does that param need to be kept in LinNP, and Prep need an inflection table from that param?
-- or do we have an exhaustive list of prepositions that merge, and we can make that into a param and put on a LHS here?
s : Case => Str ; -- TODO: is lenition a separate dimension from case?
empty : Str ; -- to avoid metavariables
a : Agr ; -- includes whether it's pron and whether it's definite. TODO: probably can make even leaner (wasn't a prio so far).
} ;
linNP : LinNP -> Str = \np -> np.art ! CC NOM ++ np.s ! CC NOM ;
emptyNP : LinNP = {
s,art = \\_ => [] ;
a = NotPron (DDef Sg Indefinite) ; -- we assume pronouns are definite by default. also it just matters for PrepNP.
empty = [] ;
} ;
--------------------------------------------------------------------------------
-- Det, Quant, Card, Ord
param
QuantForm = QSg Gender CoreCase | QPl CoreCase ;
QType = QDef Definiteness | QPoss PronAgr ;
DType = DDef Number Definiteness | DPoss Number PronAgr ;
-- The minimum forms that preposition merges with
PrepAgr = PrepBase | PrepDefiniteArticle Number | PrepObjectPron PronAgr | PrepPossPron PronAgr ;
oper
agr2pagr : Agr -> PrepAgr = \a -> case a of {
NotPron (DDef n Definite) => PrepDefiniteArticle n ;
NotPron (DPoss n agr) => PrepPossPron agr ;
IsPron agr => PrepObjectPron agr ;
NotPron _ => PrepBase
} ;
getQuantForm : Number -> Gender -> Case -> QuantForm = \n,g,c -> case <n,c> of {
<Sg,CC c> => QSg g c ;
<Sg,_> => QSg g NOM ; --- ??????
<Pl,CC c> => QPl c ;
<Pl,_> => QPl NOM --- ??????
} ;
getArt : LinQuant -> Number -> Gender -> Case -> Str = \quant,n,g,c -> case c of {
Voc => "" ; -- TODO: add empty field to article to not get metavariables
_ => quant.s ! getQuantForm n g c
} ;
LinQuant : Type = {
s -- quantifier in a context, e.g. 'this (cat) (is nice)'
: QuantForm => Str ;
sp : Str ; -- quantifier as standalone, e.g. 'this (is nice)'
qt : QType ; -- Definite, Indefinite or Possessive
} ;
LinDet : Type = {
s,s2 : Gender => Case => Str ;
sp : Str ;
dt : DType ; -- includes number
} ;
LinNum : Type = {
s : Str ;
n : Number ;
} ;
-- Can you reuse your mkNoun? Do nouns and quantifiers inflect the same way?
mkQuant : Str -> QType -> LinQuant = \this,qt -> {
s = \\_ => this ;
sp = this ;
qt = qt ;
} ;
mkDet : (seven, teen : Str) -> Definiteness -> Number -> LinDet = \aon, deug, defi, num -> {
s = \\_,_ => aon ;
s2 = \\_,_ => deug ;
sp = aon ;
dt = DDef num defi
} ;
-- Allomorphs of the definite article
AN, AN_L, NA, NAN : Str ;
AN = pre {
#vowel => "an t-" ++ BIND ;
#labial => "am" ;
_ => "an" } ;
-- N.B. lenition comes from a different param, this is just a shorthand
AN_L = pre {
"b"|"m"|"p"|"c"|"g" => "a'" ;
"f" => "an" ;
"sl"|"sn"|"sr"|
"sa"|"sà"|"si"|"sì"|
"se"|"so"|"su" => "an t-" ++ BIND ;
_ => "an" } ;
NA = pre {
#vowel => "na h-" ++ BIND ;
_ => "na" } ;
NAN = pre {
#labial => "nam" ;
_ => "nan" } ;
defArt : LinQuant = {
s = table {
QSg Masc (Nom _) => AN ;
QSg Masc _ => AN_L ;
QSg Fem Gen => NA ;
QSg Fem _ => AN_L ;
QPl Gen => NAN ;
QPl _ => NA
} ;
sp = "an" ; --- meaningless for DefArt
qt = QDef Definite ;
} ;
--------------------------------------------------------------------------------
-- Adpositions
{- The main use of Prep is in the fun
PrepNP : Prep -> NP -> Adv
Despite the name of the RGL category, a 'Prep' can be a preposition, postposition,
or just an instruction to choose a particular case from the NP.
A language may use one, two or all these strategies.
-}
-- TODO: prepositions can merge with articles
-- Lamb, page 210: obair _sa_ cheàrdaich 'working _in+the_ forge'
-- more on preps: Lamb, p.224
param
PronAgr = Sg1 | Sg2 | Sg3 Gender | Pl1 | Pl2 | Pl3 ;
-- PronType = Object | Possessive ;
Agr = NotPron DType | IsPron PronAgr ;
oper
getDefi : Agr -> Definiteness = \a -> case a of {
NotPron (DDef n d) => d ;
_ => Definite
} ;
LinPrep : Type = {
s : PrepAgr => Str ; -- bare: aig 'on', inflected: agam 'on me', agad 'on you', …
c2 : Definiteness => CoreCase ; -- most often dative
replacesObjPron : Bool ; -- NP has to keep track of if it comes from a Pron
-- If your language has both pre- and postpositions, you need an inherent parameter in Prep to record which one a given Prep is.
-- position : PreOrPost ;
-- Some cause lenition—is that separate from case?
} ;
PrepForms : Type = {base, sg1, sg2, sg3M, sg3F, pl1, pl2, pl3 : Str} ;
H, N, LENITION_DEBUG : Str ;
H = pre {#vowel => "h" ++ BIND ; _ => []} ;
N = pre {#vowel => "n-" ++ BIND ; _ => []} ;
LENITION_DEBUG = "^L" ; -- Only for debugging purposes—replace with empty string for production
invarPrepForms : Str -> PrepForms = \str ->
{base=str ; sg1=str++"mo" + LENITION_DEBUG; sg2=str++"do" + LENITION_DEBUG; sg3M=str++"a" + LENITION_DEBUG;
sg3F=str++"a"++H; pl1=str++"àr"++N; pl2=str++"ùr"++N; pl3=str++AN} ; -- AN is defined as an allomorph to def art, TODO does the possessive add t- before vowel?
mkLinPrep : (replacesObjPron : Bool)
-> (indef,defi : CoreCase)
-> (objForms, possForms : PrepForms)
-> LinPrep =
\replaces,casIndef,casDef,objForms,possForms -> {
s = table {
PrepBase => aig ;
PrepDefiniteArticle Sg => aig + "✨" ++ BIND ++ AN ; -- TODO: merge with article!!!!!!
PrepDefiniteArticle Pl => aig + "✨" ++ BIND ++ NA ; -- TODO: merge with article!!!!!!
PrepObjectPron Sg1 => agam ;
PrepObjectPron Sg2 => agad ;
PrepObjectPron (Sg3 Masc) => aige ;
PrepObjectPron (Sg3 Fem) => aice ;
PrepObjectPron Pl1 => againn ;
PrepObjectPron Pl2 => agaibh ;
PrepObjectPron Pl3 => aca ;
PrepPossPron Sg1 => gam ;
PrepPossPron Sg2 => gad ;
PrepPossPron (Sg3 Masc) => ga_L ;
PrepPossPron (Sg3 Fem) => ga_H ;
PrepPossPron Pl1 => gar ;
PrepPossPron Pl2 => gur ;
PrepPossPron Pl3 => gan } ;
c2 = table {Indefinite => casIndef ; Definite => casDef} ;
replacesObjPron = replaces
} where {
aig = objForms.base ; agam = objForms.sg1 ; agad = objForms.sg2 ;
aige = objForms.sg3M ; aice = objForms.sg3F ;
againn = objForms.pl1 ; agaibh = objForms.pl2 ; aca = objForms.pl3 ;
gam = possForms.sg1 ; gad = possForms.sg2 ;
ga_L = possForms.sg3M ; ga_H = possForms.sg3F ;
gar = possForms.pl1 ; gur = possForms.pl2 ; gan = possForms.pl3 ;
} ;
smartPrep : (objForms, possForms : PrepForms) -> LinPrep =
mkLinPrep True (Dat Lenited) (Dat Lenited) ;
mkPrep = overload {
mkPrep : (objForms, possForms : PrepForms) -> LinPrep = smartPrep ;
mkPrep : (objForms, possForms : PrepForms) -> Mutation -> LinPrep =
\obj,poss,mutation -> mkLinPrep True (Dat mutation) (Dat mutation) obj poss ;
mkPrep : (replacesObjPron : Bool) -> (indef,defi : CoreCase)
-> (objForms, possForms : PrepForms) -> LinPrep = mkLinPrep
} ;
emptyPrep : LinPrep = {
s = \\_ => [] ;
poss = \\_ => [] ;
c2 = \\_ => Dat Lenited ;
replacesObjPron = False
} ;
aigPrep : LinPrep =
mkPrep
{base="aig"; sg1="agam"; sg2="agad"; sg3M="aige"; sg3F="aice"; pl1="againn"; pl2="agaibh"; pl3="aca"}
{base="aig"; sg1="'gam" + LENITION_DEBUG; sg2="'gad" + LENITION_DEBUG; sg3M="'ga" + LENITION_DEBUG; sg3F="'ga"++H; pl1="'gar"++N; pl2="'gur"++N; pl3="'gan"}
NoMutation ;
airPrep : LinPrep =
mkPrep
{base="air"; sg1="orm"; sg2="ort"; sg3M="air"; sg3F="oirre"; pl1="oirrn"; pl2="oirbh"; pl3="orra"}
(invarPrepForms "air")
NoMutation ;
annPrep : LinPrep =
mkPrep
{base="ann"; sg1="annam"; sg2="annad"; sg3M="ann"; sg3F="innte"; pl1="annainn"; pl2="annaibh"; pl3="annta"}
{base="ann"; sg1="'nam" + LENITION_DEBUG; sg2="'nad" + LENITION_DEBUG; sg3M="'na" + LENITION_DEBUG; sg3F="'na"++H; pl1="'nar"++N; pl2="'nur"++N; pl3="'nan"}
NoMutation ;
àsPrep : LinPrep =
mkPrep
{base="às"; sg1="asam"; sg2="asad"; sg3M="às"; sg3F="aiste"; pl1="asainn"; pl2="asaibh"; pl3="asda"}
(invarPrepForms "às")
NoMutation ;
bhoPrep : LinPrep =
mkPrep
{base="bho"; sg1="bhuam"; sg2="bhuat"; sg3M="bhuaithe"; sg3F="bhuaipe"; pl1="bhuainn"; pl2="buaibh"; pl3="bhuapa"}
{base="bho"; sg1="bhom" + LENITION_DEBUG; sg2="bhod" + LENITION_DEBUG; sg3M="bho a" + LENITION_DEBUG; sg3F="bho a"++H; pl1="bhor"++N; pl2="bhu"++N; pl3="bhon"}
Lenited ;
{- dePrep : LinPrep = …-}
doPrep : LinPrep =
mkPrep
{base="do"; sg1="dhomh"; sg2="dhut"; sg3M="dha"; sg3F="dhi"; pl1="dhuinn"; pl2="dhuibh"; pl3="dhiubh"}
{base="bho"; sg1="dom" + LENITION_DEBUG; sg2="dod" + LENITION_DEBUG; sg3M="dha" + LENITION_DEBUG; sg3F="dha"++H; pl1="dor"++N; pl2="dhur"++N; pl3="don"}
Lenited ;
{- eadarPrep : LinPrep = …-}
{- foPrep : LinPrep = …-}
guPrep : LinPrep =
mkPrep
True {-replaces object pronoun-}
(Dat NoMutation) {-governs dative when indefinite, no mutation-}
Gen {-governs genitive when definite-}
{base="gu"; sg1="ugam"; sg2="ugad"; sg3M="uige"; sg3F="uice"; pl1="ugainn"; pl2="ugaibh"; pl3="uca"}
{base="gu"; sg1="gum" + LENITION_DEBUG; sg2="gud" + LENITION_DEBUG; sg3M="gu a" + LENITION_DEBUG; sg3F="gu a"++H; pl1="gar"++N; pl2="gur"++N; pl3="gun"}
;
--------------------------------------------------------------------------------
-- Adjectives
-- Lamb p. 220 basic morphology, degree
-- Lamb p. 246: predicative adjectives
LinA : Type = SS ;
LinA2 : Type = LinA ;
mkAdj : Str -> LinA = \str -> {s = str} ;
AdjPhrase : Type = LinA ; -- ** {compar : Str} ;
--------------------------------------------------------------------------------
-- Verbs
param
VAgr = VSg1 | VSg2 | VSg3 | VPl1 | VPl2 | VPl3 ;
VForm = VInf | VPres VAgr | VPast VAgr ; -- TODO
oper
nagr2vagr : Agr -> VAgr = \a -> case a of {
NotPron (DDef Sg _) => VSg3 ;
NotPron (DDef Pl _) => VPl3 ;
-- this is the number of the possessee—number of possessor only matters for PrepNP!
NotPron (DPoss Sg _) => VSg3 ;
NotPron (DPoss Pl _) => VPl3 ;
-- this is subject pronoun, which agrees with verb
IsPron Sg1 => VSg1 ;
IsPron Sg2 => VSg2 ;
IsPron (Sg3 _) => VSg3 ;
IsPron Pl1 => VPl1 ;
IsPron Pl2 => VPl2 ;
IsPron Pl3 => VPl3
} ;
LinV : Type = {
s : VForm => Str
} ;
LinV2 : Type = LinV ** {
c2 : LinPrep ;
} ;
mkVerb : Str -> LinV = \str -> {
s = table {
_ => str
}
} ;
copula : LinV = {s = \\_ => "TODO: copula"} ; -- often useful
------------------
-- VP
-- Lamb p. 229
-- "tense, aspect, modality, voice, person and number. There are contrasts to be seen, as above, between inflected and periphrastic forms and, as a whole, periphrasis is more productive."
LinVP : Type = {
s : VForm => Str ;
} ;
LinVPSlash : Type = LinVP ** {
c2 : LinPrep ;
} ;
linVP : LinVP -> Str = \vp -> vp.s ! VInf ;
--------------------------------------------------------------------------------
-- Cl, S
-- Operations for clauses, sentences
LinCl : Type = {
subj : Str ;
pred : Str ; -- TODO: depend on Temp and Pol
} ;
linCl : LinCl -> Str = \cl -> cl.subj ++ cl.pred ;
}

76
src/gaelic/SentenceGla.gf Normal file
View File

@@ -0,0 +1,76 @@
concrete SentenceGla of Sentence = CatGla ** open
TenseX, ResGla, (AM=AdverbGla), Prelude in {
flags optimize=all_subs ;
lin
--2 Clauses
-- : NP -> VP -> Cl
PredVP np vp = {
subj = linNP np ; -- article and CN are discontinuous in NP! linNP just picks nominative unmutated.
pred =
-- table {something with tense+polarity =>
vp.s ! VPres (nagr2vagr np.a)
-- TODO: all of the VP's tense and polarity should be open here!
-- PredVP only decides the subject.
-- }
} ;
{-
-- : SC -> VP -> Cl ; -- that she goes is good
PredSCVP sc vp = ;
--2 Clauses missing object noun phrases
-- : NP -> VPSlash -> ClSlash ;
SlashVP =
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
AdvSlash cls adv =
-- : Cl -> Prep -> ClSlash ; -- (with whom) he walks
SlashPrep cl prep = cl ** {c2 = prep} ;
-- Imperatives
-- : VP -> Imp ;
ImpVP vp =
--2 Embedded sentences
-- : S -> SC ;
EmbedS s =
-- : QS -> SC ;
EmbedQS qs =
-- : VP -> SC ;
EmbedVP vp =
-}
--2 Sentences
-- : Temp -> Pol -> Cl -> S ;
UseCl t p cl = {
s = cl.subj ++ t.s ++ p.s ++ cl.pred -- ! t.t ! p.p -- eventually
} ;
{-
-- : Temp -> Pol -> QCl -> QS ;
UseQCl t p cl =
-- : Temp -> Pol -> RCl -> RS ;
UseRCl t p cl =
-- AdvS : Adv -> S -> S ; -- then I will go home
AdvS adv s =
-- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
ExtAdvS adv s =
-- : S -> Subj -> S -> S ;
SSubjS s1 subj s2 =
-- : S -> RS -> S ; -- she sleeps, which is good
RelS sent rs =
-}
}

171
src/gaelic/StructuralGla.gf Normal file
View File

@@ -0,0 +1,171 @@
concrete StructuralGla of Structural = CatGla **
open Prelude, ResGla, (Noun=NounGla), ParadigmsGla in {
-------
-- Ad*
{-
lin almost_AdA =
lin almost_AdN =
lin at_least_AdN =
lin at_most_AdN =
lin so_AdA =
lin too_AdA =
lin very_AdA =
lin as_CAdv =
lin less_CAdv =
lin more_CAdv =
lin how8much_IAdv =
lin when_IAdv =
lin how_IAdv =
lin where_IAdv =
lin why_IAdv =
lin always_AdV = ss "" ;
lin everywhere_Adv = ss "" ;
lin here7from_Adv = ss "" ;
lin here7to_Adv = ss "" ;
lin here_Adv = ss "" ;
lin quite_Adv = ss "" ;
lin somewhere_Adv = ss "" ;
lin there7from_Adv = ss "" ;
lin there7to_Adv = ss "" ;
lin there_Adv = ss "" ;
-}
-------
-- Conj
-- The lincat of Conj is Coordination.ConjunctionDistr ** {n:Number}
-- which means that there are two fields for the strings, and
-- n:Number which specifies the number of the resulting NP.
lin and_Conj = {s1 = [] ; s2 = "and" ; n = Pl} ;
-- lin or_Conj =
-- lin if_then_Conj =
lin both7and_DConj = {s1 = "both" ; s2 = "and" ; n = Pl} ;
-- lin either7or_DConj =
-- lin but_PConj =
-- lin otherwise_PConj =
-- lin therefore_PConj =
-----------------
-- *Det and Quant
{-
lin how8many_IDet =
lin every_Det =
lin all_Predet = {s = ""} ;
lin not_Predet = { s = "" } ;
lin only_Predet = { s = "" } ;
lin most_Predet = {s = ""} ;
lin few_Det = R.indefDet "" pl ;
lin many_Det = R.indefDet "" pl ;
lin much_Det = R.indefDet "" sg ;
lin somePl_Det =
lin someSg_Det =
lin no_Quant =
lin that_Quant = mkQuant "" ;
lin this_Quant = mkQuant "" ;
lin which_IQuant = mkQuant "" ;
-----
-- NP
lin somebody_NP =
lin everybody_NP =
lin everything_NP =
lin nobody_NP =
lin nothing_NP =
lin somebody_NP =
lin something_NP =
-------}
-- Prep
-- lin above_Prep = mkPrep "" ;
-- lin after_Prep = mkPrep "" ;
-- lin before_Prep = mkPrep "" ;
-- lin behind_Prep = mkPrep "" ;
-- lin between_Prep = = mkPrep "" ;
-- lin by8agent_Prep = mkPrep "" ;
-- lin by8means_Prep = mkPrep "" ;
-- lin during_Prep = mkPrep "" ;
-- lin except_Prep = mkPrep "" ;
lin for_Prep = ResGla.doPrep ;
lin from_Prep = ResGla.bhoPrep ;
-- lin in8front_Prep = mkPrep "" ;
lin in_Prep = ResGla.annPrep ;
lin on_Prep = ResGla.airPrep ;
-- lin part_Prep = mkPrep "" ;
-- lin possess_Prep = mkPrep "" ;
-- lin through_Prep = mkPrep "" ;
lin to_Prep = ResGla.guPrep ;
-- lin under_Prep = mkPrep "" ;
-- lin with_Prep = mkPrep "" ;
-- lin without_Prep = mkPrep "" ;
-------
-- Pron
-- Pronouns are closed class, no constructor in ParadigmsGla.
--lin it_Pron =
lin i_Pron = mkPron "mi" "mo^L" Sg1 ;
lin youPol_Pron = youPl_Pron ;
lin youSg_Pron = mkPron "tu" "do^L" Sg2 ;
lin he_Pron = mkPron "e" "a^L" (Sg3 Masc) ;
lin she_Pron = mkPron "i" "a^H" (Sg3 Fem) ;
lin we_Pron = mkPron "sinn" "àr^N" Pl1 ;
lin youPl_Pron = mkPron"sibh" "ùr^N" Pl2 ;
lin they_Pron = mkPron "iad" AN Pl3 ;
{-
lin whatPl_IP =
lin whatSg_IP =
lin whoPl_IP =
lin whoSg_IP =
-------
-- Subj
lin although_Subj =
lin because_Subj =
lin if_Subj =
lin that_Subj =
lin when_Subj =
------
-- Utt
lin language_title_Utt = ss "" ;
lin no_Utt = ss "" ;
lin yes_Utt = ss "" ;
-------
-- Verb
lin have_V2 =
lin can8know_VV = -- can (capacity)
lin can_VV = -- can (possibility)
lin must_VV =
lin want_VV =
------
-- Voc
lin please_Voc = ss "" ;
-}
}

73
src/gaelic/SymbolGla.gf Normal file
View File

@@ -0,0 +1,73 @@
--# -path=.:../abstract:../common:../prelude
concrete SymbolGla of Symbol = CatGla **
open Prelude, ParadigmsGla, ResGla, (Noun=NounGla) in {
lin
-- : Symb -> PN ; -- x
SymbPN i = mkPN_onRuntimeToken i.s ;
-- : Int -> PN ; -- 27
IntPN i = mkPN_onRuntimeToken i.s ;
-- : Float -> PN ; -- 3.14159
FloatPN i = mkPN_onRuntimeToken i.s ;
-- : Card -> PN ; -- twelve [as proper name]
NumPN i = mkPN_onRuntimeToken (i.s ! NCard) ;
lin
-- CNIntNP cn i = {} ;
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
CNSymbNP det cn xs =
let cnSymb : CN = cn ** {postmod = cn.postmod ++ xs.s}
in Noun.DetCN det cnSymb ;
-- : CN -> Card -> NP ; -- level five ; level 5
CNNumNP cn i =
let cnSymb : CN = cn ** {postmod = cn.postmod ++ i.s}
in Noun.MassNP cnSymb ;
-- : Symb -> S ;
SymbS sy = sy ;
-- : Symb -> Card ;
SymbNum sy = mkNumeral_onRuntimeToken sy.s ;
-- : Symb -> Ord ;
SymbOrd sy = sy ; ---- TODO: nothing added to it. Lincat of Ord is just SS from the beginning.
oper
-- To make Card or PN from a runtime argument, cannot use the single + operation.
-- See https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#unsupported-token-gluing
mkNumeral_onRuntimeToken : Str -> LinNumeral = \str -> {
s = table {
NCard => str ;
NOrd => str ++ BIND ++ "th"
} ;
n = Pl ; -- NB. probably singular for number 1
} ;
mkPN_onRuntimeToken : Str -> LinPN = \str -> {
s =
-- table {_ => -- If lincat of PN changes so that it's an inflection table, uncomment this
str
-- }
;
n = Sg ;
} ;
lincat
Symb, [Symb] = SS ;
lin
MkSymb s = s ;
BaseSymb = infixSS "and" ; -- this comes between the last two ones
ConsSymb = infixSS "," ;
}

114
src/gaelic/VerbGla.gf Normal file
View File

@@ -0,0 +1,114 @@
concrete VerbGla of Verb = CatGla ** open ResGla, AdverbGla, Prelude in {
lin
-----
-- VP
-- : V -> VP
-- NB. assumes that lincat V = lincat VP
-- This will most likely change when you start working with VPs
UseV v = v ;
{-
-- : V2 -> VP ;
PassV2 v2 =
-- : VPSlash -> VP ;
ReflVP vps =
-- : VV -> VP -> VP ;
ComplVV vv vp =
-- : VS -> S -> VP ;
ComplVS vs s =
-- : VQ -> QS -> VP ;
ComplVQ vq qs =
-- : VA -> AP -> VP ;
ComplVA va ap =
-- : Comp -> VP ;
UseComp comp =
-}
--------
-- Slash
{-
-- : V2 -> VPSlash
SlashV2a v2 =
-- : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 dobj =
-- : V3 -> NP -> VPSlash ; -- give (it) to her
Slash3V3 v3 iobj =
SlashV2A v2 adj =
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
SlashV2S v2s s =
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = ;
-- : V2Q -> QS -> VPSlash ; -- ask (him) who came
SlashV2Q v2q qs = ;
-- : V2A -> AP -> VPSlash ; -- paint (it) red
SlashV2A v2a ap = ;
-- : VPSlash -> NP -> VP
-- Often VPSlash has a field called c2, which is used to pick right form of np complement
ComplSlash vps np = vps ** {
compl = np.s ! vps.c2
} ;
-- : VV -> VPSlash -> VPSlash ;
SlashVV vv vps = ComplVV vv vps ** {
} ;
-- : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy
SlashV2VNP v2v np vps =
-- : VP -> Adv -> VP ; -- sleep here
AdvVP vp adv =
-- : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp =
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
AdvVPSlash = insertAdv ;
-- : VP -> Adv -> VP ; -- sleep , even though ...
ExtAdvVP vp adv = ;
-- : AdV -> VPSlash -> VPSlash ; -- always use (it)
AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ;
-- : VP -> Prep -> VPSlash ; -- live in (it)
VPSlashPrep vp prep = vp ** {c2 = prep} ;
--2 Complements to copula
-- Adjectival phrases, noun phrases, and adverbs can be used.
-- : AP -> Comp ;
CompAP ap =
-- : CN -> Comp ;
CompCN cn =
-- NP -> Comp ;
CompNP np =
-- : Adv -> Comp ;
CompAdv adv =
-- : VP -- Copula alone;
UseCopula =
-}
}