mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
tuning resource API
This commit is contained in:
@@ -212,5 +212,10 @@ abstract Basic = Categories ** {
|
||||
put_V2 : V2 ;
|
||||
stop_V : V ;
|
||||
jump_V : V ;
|
||||
|
||||
here_Adv : Adv ;
|
||||
here7to_Adv : Adv ;
|
||||
here7from_Adv : Adv ;
|
||||
there_Adv : Adv ;
|
||||
there7to_Adv : Adv ;
|
||||
there7from_Adv : Adv ;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,8 @@ cat
|
||||
|
||||
PN ; -- proper name, e.g. "John", "New York"
|
||||
NP ; -- noun phrase, e.g. "John", "all cars", "you"
|
||||
Det ; -- determiner, e.g. "every", "all"
|
||||
Det ; -- determiner, e.g. "every", "many"
|
||||
NDet ; -- det that admits a num, e.g. "all (the 5)"
|
||||
Num ; -- numeral, e.g. "three", "879"
|
||||
|
||||
--!
|
||||
@@ -128,10 +129,12 @@ cat
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
IP ; -- interrogative pronoun, e.g. "who", "whose mother", "which yellow car"
|
||||
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||
QCl ; -- question, e.g. "who walks"
|
||||
Imp ; -- imperative, e.g. "walk!"
|
||||
IP ; -- interrogative pronoun, e.g. "who", "whose mother", "which car"
|
||||
IDet ; -- interrog. determiner, e.g. "which", "how many"
|
||||
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||
QCl ; -- question, e.g. "who walks"
|
||||
QS ; -- question w. fixed tense
|
||||
Imp ; -- imperative, e.g. "walk!"
|
||||
|
||||
--!
|
||||
--3 Coordination and subordination
|
||||
@@ -144,6 +147,7 @@ cat
|
||||
ListS ; -- list of sentences
|
||||
ListAP ; -- list of adjectival phrases
|
||||
ListNP ; -- list of noun phrases
|
||||
ListAdv ;-- list of adverbs
|
||||
|
||||
--!
|
||||
--3 Complete utterances
|
||||
@@ -174,7 +178,7 @@ cat
|
||||
|
||||
--- also: John is easy (for you) to please vs. John is eager to please
|
||||
|
||||
QS ; -- question with fixed tense and polarity
|
||||
|
||||
RS ; -- relative clause with fixed tense and polarity
|
||||
|
||||
TP ; -- tense x polarity selector
|
||||
|
||||
25
lib/resource/abstract/Lang.gf
Normal file
25
lib/resource/abstract/Lang.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
abstract Lang =
|
||||
Rules,
|
||||
Clause,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country
|
||||
|
||||
** {
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
@@ -27,6 +27,8 @@ fun
|
||||
DefNumNP : Num -> CN -> NP ; -- "the cars", "the 86 cars"
|
||||
|
||||
DetNP : Det -> CN -> NP ; -- "every car"
|
||||
NDetNP : NDet -> Num -> CN -> NP ; -- "these (5) cars"
|
||||
NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
||||
MassNP : CN -> NP ; -- "wine"
|
||||
|
||||
AppN2 : N2 -> NP -> CN ; -- "successor of zero"
|
||||
@@ -110,6 +112,7 @@ fun
|
||||
|
||||
AdvCN : CN -> PP -> CN ; -- "house in London"
|
||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||
AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
@@ -127,10 +130,8 @@ fun
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
WhoOne, WhoMany : IP ; -- "who (is)", "who (are)"
|
||||
WhatOne, WhatMany : IP ; -- "what (is)", "what (are)"
|
||||
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||
NounIPOne, NounIPMany : CN -> IP ; -- "which car", "which cars"
|
||||
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||
IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||
|
||||
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
@@ -144,7 +145,9 @@ fun
|
||||
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
||||
|
||||
AdvCl : Cl -> Adv -> Cl ; -- "John walks in the park"
|
||||
AdvPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||
AdvVP : VPI -> Adv -> VPI ; -- "walk in the park"
|
||||
AdCPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||
AdvPhr : Adv -> S -> Phr ; -- "In India, there are tigers."
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
@@ -158,13 +161,15 @@ fun
|
||||
-- is linguistically problematic in German because $VP$ is a discontinuous
|
||||
-- category.
|
||||
|
||||
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
||||
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
||||
ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
||||
|
||||
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
||||
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
||||
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
||||
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
||||
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
||||
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
||||
ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
||||
|
||||
TwoS : S -> S -> ListS ;
|
||||
ConsS : ListS -> S -> ListS ;
|
||||
@@ -175,6 +180,9 @@ fun
|
||||
TwoNP : NP -> NP -> ListNP ;
|
||||
ConsNP : ListNP -> NP -> ListNP ;
|
||||
|
||||
TwoAdv : Adv -> Adv -> ListAdv ;
|
||||
ConsAdv : ListAdv -> Adv -> ListAdv ;
|
||||
|
||||
--!
|
||||
--3 Subordination
|
||||
--
|
||||
|
||||
@@ -4,92 +4,100 @@
|
||||
--
|
||||
-- Here we have some words belonging to closed classes and appearing
|
||||
-- in all languages we have considered.
|
||||
-- Sometimes they are not really meaningful, e.g. $TheyNP$ in French
|
||||
-- should really be replaced by masculine and feminine variants.
|
||||
-- Sometimes they are not really meaningful, e.g. $we_NP$ in Spanish
|
||||
-- should be replaced by masculine and feminine variants.
|
||||
|
||||
abstract Structural = Categories, Numerals ** {
|
||||
|
||||
fun
|
||||
fun
|
||||
|
||||
--!
|
||||
--2 Determiners and noun phrases
|
||||
--
|
||||
-- Many plural determiners can take a numeral modifier. So can the plural
|
||||
-- pronouns "we" and "you".
|
||||
-- First mount the numerals.
|
||||
|
||||
EveryDet, WhichDet, AllMassDet, -- every, sg which, sg all
|
||||
HowManyDet, --- should actually be interrogative
|
||||
SomeDet, AnyDet, NoDet, -- sg some, any, no
|
||||
MostDet, MostsDet, ManyDet, MuchDet : Det ; -- sg most, pl most, many, much
|
||||
ThisDet, ThatDet : Det ; -- this, that
|
||||
UseNumeral : Numeral-> Num ;
|
||||
|
||||
AllNumDet, WhichNumDet, -- pl all, which (86)
|
||||
SomeNumDet, AnyNumDet, NoNumDet, -- pl some, any, no
|
||||
TheseNumDet, ThoseNumDet : Num -> Det ; -- these, those (86)
|
||||
-- Then an alphabetical list of structural words
|
||||
|
||||
ThisNP, ThatNP : NP ; -- this, that
|
||||
TheseNumNP, ThoseNumNP : Num -> NP ; -- these, those (86)
|
||||
INP, ThouNP, HeNP, SheNP, ItNP : NP ; -- personal pronouns in singular
|
||||
WeNumNP, YeNumNP : Num -> NP ; -- these pronouns can take numeral
|
||||
TheyNP : NP ; YouNP : NP ; -- they, the polite you
|
||||
TheyFemNP : NP ;
|
||||
above_Prep : Prep ;
|
||||
after_Prep : Prep ;
|
||||
all8mass_Det : Det ;
|
||||
all_NDet : NDet ;
|
||||
almost_Adv : AdA ;
|
||||
although_Subj : Subj ;
|
||||
and_Conj : Conj ;
|
||||
because_Subj : Subj ;
|
||||
before_Prep : Prep ;
|
||||
behind_Prep : Prep ;
|
||||
between_Prep : Prep ;
|
||||
both_AndConjD : ConjD ;
|
||||
by8agent_Prep : Prep ;
|
||||
by8means_Prep : Prep ;
|
||||
can8know_VV : VV ;
|
||||
can_VV : VV ;
|
||||
during_Prep : Prep ;
|
||||
either8or_ConjD : ConjD ;
|
||||
every_Det : Det ;
|
||||
everybody_NP : NP ;
|
||||
everything_NP : NP ;
|
||||
everywhere_Adv : Adv ;
|
||||
from_Prep : Prep ;
|
||||
he_NP : NP ;
|
||||
how_IAdv : IAdv ;
|
||||
how8many_IDet : IDet ;
|
||||
i_NP : NP ;
|
||||
if_Subj : Subj ;
|
||||
in8front_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
it_NP : NP ;
|
||||
many_Det : Det ;
|
||||
most_Det : Det ;
|
||||
most8many_Det : Det ;
|
||||
much_Det : Det ;
|
||||
must_VV : VV ;
|
||||
no_Phr : Phr ;
|
||||
on_Prep : Prep ;
|
||||
or_Conj : Conj ;
|
||||
otherwise_Adv : AdC ;
|
||||
part_Prep : Prep ;
|
||||
possess_Prep : Prep ;
|
||||
quite_Adv : AdA ;
|
||||
she_NP : NP ;
|
||||
so_Adv : AdA ;
|
||||
some_Det : Det ;
|
||||
some_NDet : NDet ;
|
||||
somebody_NP : NP ;
|
||||
something_NP : NP ;
|
||||
somewhere_Adv : Adv ;
|
||||
that_Det : Det ;
|
||||
that_NP : NP ;
|
||||
therefore_Adv : AdC ;
|
||||
these_NDet : NDet ;
|
||||
they8fem_NP : NP ;
|
||||
they_NP : NP ;
|
||||
this_Det : Det ;
|
||||
this_NP : NP ;
|
||||
those_NDet : NDet ;
|
||||
thou_NP : NP ;
|
||||
through_Prep : Prep ;
|
||||
to_Prep : Prep ;
|
||||
too_Adv : AdA ;
|
||||
under_Prep : Prep ;
|
||||
very_Adv : AdA ;
|
||||
want_VV : VV ;
|
||||
we_NP : NP ;
|
||||
what8many_IP : IP ;
|
||||
what8one_IP : IP ;
|
||||
when_IAdv : IAdv ;
|
||||
when_Subj : Subj ;
|
||||
where_IAdv : IAdv ;
|
||||
which8many_IDet : IDet ;
|
||||
which8one_IDet : IDet ;
|
||||
who8many_IP : IP ;
|
||||
who8one_IP : IP ;
|
||||
why_IAdv : IAdv ;
|
||||
with_Prep : Prep ;
|
||||
without_Prep : Prep ;
|
||||
ye_NP : NP ;
|
||||
yes_Phr : Phr ;
|
||||
you_NP : NP ;
|
||||
|
||||
EverybodyNP, SomebodyNP, NobodyNP, -- everybody, somebody, nobody
|
||||
EverythingNP, SomethingNP, NothingNP : NP ; -- everything, something, nothing
|
||||
|
||||
UseNumeral : Numeral -> Num ; -- "thirty-two" --- assumes i > 1
|
||||
|
||||
--!
|
||||
--2 Auxiliary verbs
|
||||
--
|
||||
-- Depending on language, all, some, or none of there verbs belong to
|
||||
-- a separate class of *auxiliary* verbs. The list is incomplete.
|
||||
|
||||
CanVV, CanKnowVV, MustVV : VV ; -- can (pouvoir,savoir), must
|
||||
WantVV : VV ; -- want (to do)
|
||||
|
||||
--!
|
||||
--2 Adverbials
|
||||
--
|
||||
|
||||
WhenIAdv,WhereIAdv,WhyIAdv,HowIAdv : IAdv ; -- when, where, why, how
|
||||
EverywhereNP, SomewhereNP,NowhereNP : Adv ; -- everywhere, somewhere, nowhere
|
||||
VeryAdv, TooAdv : AdA ; -- very, too
|
||||
AlmostAdv, QuiteAdv : AdA ; -- almost, quite
|
||||
OtherwiseAdv, ThereforeAdv : AdC ; -- therefore, otherwise
|
||||
|
||||
--!
|
||||
--2 Conjunctions and subjunctions
|
||||
--
|
||||
|
||||
AndConj, OrConj : Conj ; -- and, or
|
||||
BothAnd, EitherOr, NeitherNor : ConjD ; -- both-and, either-or, neither-nor
|
||||
IfSubj, WhenSubj, AlthoughSubj : Subj ; -- if, when, although
|
||||
|
||||
--!
|
||||
--2 Prepositions
|
||||
--
|
||||
-- We have chosen a set of semantic relations expressible
|
||||
-- by prepositions in some languages, by cases or postpositions in
|
||||
-- others. Complement uses of prepositions are not included, and
|
||||
-- should be treated by the use of many-place verbs, adjectives, and
|
||||
-- functions.
|
||||
|
||||
InPrep, OnPrep, ToPrep, FromPrep, -- spatial relations
|
||||
ThroughPrep, AbovePrep, UnderPrep,
|
||||
InFrontPrep, BehindPrep, BetweenPrep : Prep ;
|
||||
BeforePrep, DuringPrep, AfterPrep : Prep ; -- temporal relations
|
||||
WithPrep, WithoutPrep, ByMeansPrep : Prep ; -- some other relations
|
||||
PossessPrep : Prep ; -- possessive/genitive
|
||||
PartPrep : Prep ; -- partitive "of" ("bottle of wine")
|
||||
AgentPrep : Prep ; -- agent "by" in passive constructions
|
||||
|
||||
|
||||
--!
|
||||
--2 Affirmation and negation
|
||||
--
|
||||
-- The negative-positive (French "si", German "doch") is missing.
|
||||
|
||||
PhrYes, PhrNo : Phr ; -- yes, no
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,39 @@
|
||||
abstract Time = {
|
||||
abstract Time = Numerals ** {
|
||||
|
||||
-- Time grammar Abstract syntax. Modified by AR from Karin Cavallin.
|
||||
|
||||
cat
|
||||
|
||||
Date ;
|
||||
Time ;
|
||||
Hour ;
|
||||
Minute ;
|
||||
Weekday ;
|
||||
|
||||
fun
|
||||
|
||||
-- The variants: "two twenty", "twenty past two", "twenty to two"
|
||||
|
||||
DayDate : Weekday -> Date ;
|
||||
DayTimeDate : Weekday -> Time -> Date ;
|
||||
|
||||
FormalTime : Hour -> Minute -> Time ;
|
||||
PastTime : Hour -> Minute -> Time ;
|
||||
ToTime : Hour -> Minute -> Time ;
|
||||
ExactTime : Hour -> Time ;
|
||||
|
||||
-- These range from 1 to 99 and are thus overgenerating.
|
||||
|
||||
NumHour : Sub100 -> Hour ;
|
||||
NumMinute : Sub100 -> Minute ;
|
||||
|
||||
fun
|
||||
monday : Weekday ;
|
||||
tuesday : Weekday ;
|
||||
wednesday : Weekday ;
|
||||
thursday : Weekday ;
|
||||
friday : Weekday ;
|
||||
saturday : Weekday ;
|
||||
sunday : Weekday ;
|
||||
|
||||
} ;
|
||||
|
||||
Reference in New Issue
Block a user