mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 01:22:51 -06:00
tuning resource API
This commit is contained in:
@@ -35,3 +35,38 @@ mkLin s =
|
|||||||
'V':_ -> "mk" ++ cat ++ " (regV" ++ " \"" ++ w ++ "\")"
|
'V':_ -> "mk" ++ cat ++ " (regV" ++ " \"" ++ w ++ "\")"
|
||||||
_ -> "reg" ++ cat ++ " \"" ++ w ++ "\""
|
_ -> "reg" ++ cat ++ " \"" ++ w ++ "\""
|
||||||
|
|
||||||
|
-- normalize identifiers in Structural
|
||||||
|
|
||||||
|
mkIdent s = case words s of
|
||||||
|
w:ws -> if obsolete w then ""
|
||||||
|
else " " ++ (unwords $ mkId (update w) : ws)
|
||||||
|
_ -> s
|
||||||
|
where
|
||||||
|
mkId name@(c:cs) =
|
||||||
|
let
|
||||||
|
(x,y) = span isCat cs
|
||||||
|
in
|
||||||
|
toLower c : clean x ++ "_" ++ new y
|
||||||
|
isCat = flip notElem "PDNVCAIS"
|
||||||
|
clean x = case span isLower x of
|
||||||
|
(_,[]) -> x
|
||||||
|
(u,v) -> u ++ "8" ++ map toLower v
|
||||||
|
new y = case y of
|
||||||
|
"NumDet" -> "NDet"
|
||||||
|
_ -> y
|
||||||
|
obsolete w = elem w $ words "TheseNumNP ThoseNumNP NobodyNP NeitherNor NoDet AnyDet"
|
||||||
|
update w = case w of
|
||||||
|
"EitherOr" -> "EitherOrConjD"
|
||||||
|
"BothAnd" -> "BothAndConjD"
|
||||||
|
"PhrYes" -> "YesPhr"
|
||||||
|
"PhrNo" -> "NoPhr"
|
||||||
|
"WeNumNP" -> "WeNP"
|
||||||
|
"YeNumNP" -> "YeNP"
|
||||||
|
"HowManyDet" -> "HowManyIDet"
|
||||||
|
"MostsDet" -> "MostManyDet"
|
||||||
|
"WhichDet" -> "WhichOneIDet"
|
||||||
|
"WhichNDet" -> "WhichManyIDet"
|
||||||
|
"EverywhereNP" -> "EverywhereAdv"
|
||||||
|
"SomewhereNP" -> "SomewhereAdv"
|
||||||
|
"AgentPrep" -> "By8agentPrep"
|
||||||
|
_ -> w
|
||||||
|
|||||||
@@ -212,5 +212,10 @@ abstract Basic = Categories ** {
|
|||||||
put_V2 : V2 ;
|
put_V2 : V2 ;
|
||||||
stop_V : V ;
|
stop_V : V ;
|
||||||
jump_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"
|
PN ; -- proper name, e.g. "John", "New York"
|
||||||
NP ; -- noun phrase, e.g. "John", "all cars", "you"
|
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"
|
Num ; -- numeral, e.g. "three", "879"
|
||||||
|
|
||||||
--!
|
--!
|
||||||
@@ -128,9 +129,11 @@ cat
|
|||||||
--
|
--
|
||||||
-- This group has no lexical categories.
|
-- This group has no lexical categories.
|
||||||
|
|
||||||
IP ; -- interrogative pronoun, e.g. "who", "whose mother", "which yellow car"
|
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"
|
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||||
QCl ; -- question, e.g. "who walks"
|
QCl ; -- question, e.g. "who walks"
|
||||||
|
QS ; -- question w. fixed tense
|
||||||
Imp ; -- imperative, e.g. "walk!"
|
Imp ; -- imperative, e.g. "walk!"
|
||||||
|
|
||||||
--!
|
--!
|
||||||
@@ -144,6 +147,7 @@ cat
|
|||||||
ListS ; -- list of sentences
|
ListS ; -- list of sentences
|
||||||
ListAP ; -- list of adjectival phrases
|
ListAP ; -- list of adjectival phrases
|
||||||
ListNP ; -- list of noun phrases
|
ListNP ; -- list of noun phrases
|
||||||
|
ListAdv ;-- list of adverbs
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--3 Complete utterances
|
--3 Complete utterances
|
||||||
@@ -174,7 +178,7 @@ cat
|
|||||||
|
|
||||||
--- also: John is easy (for you) to please vs. John is eager to please
|
--- 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
|
RS ; -- relative clause with fixed tense and polarity
|
||||||
|
|
||||||
TP ; -- tense x polarity selector
|
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"
|
DefNumNP : Num -> CN -> NP ; -- "the cars", "the 86 cars"
|
||||||
|
|
||||||
DetNP : Det -> CN -> NP ; -- "every car"
|
DetNP : Det -> CN -> NP ; -- "every car"
|
||||||
|
NDetNP : NDet -> Num -> CN -> NP ; -- "these (5) cars"
|
||||||
|
NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
||||||
MassNP : CN -> NP ; -- "wine"
|
MassNP : CN -> NP ; -- "wine"
|
||||||
|
|
||||||
AppN2 : N2 -> NP -> CN ; -- "successor of zero"
|
AppN2 : N2 -> NP -> CN ; -- "successor of zero"
|
||||||
@@ -110,6 +112,7 @@ fun
|
|||||||
|
|
||||||
AdvCN : CN -> PP -> CN ; -- "house in London"
|
AdvCN : CN -> PP -> CN ; -- "house in London"
|
||||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||||
|
AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--3 Sentences and relative clauses
|
--3 Sentences and relative clauses
|
||||||
@@ -127,10 +130,8 @@ fun
|
|||||||
--3 Questions and imperatives
|
--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"
|
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||||
NounIPOne, NounIPMany : CN -> IP ; -- "which car", "which cars"
|
IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||||
|
|
||||||
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||||
@@ -144,7 +145,9 @@ fun
|
|||||||
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
||||||
|
|
||||||
AdvCl : Cl -> Adv -> Cl ; -- "John walks in the park"
|
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
|
--3 Coordination
|
||||||
@@ -161,10 +164,12 @@ fun
|
|||||||
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
||||||
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
||||||
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
||||||
|
ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
||||||
|
|
||||||
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
||||||
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
||||||
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
||||||
|
ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
||||||
|
|
||||||
TwoS : S -> S -> ListS ;
|
TwoS : S -> S -> ListS ;
|
||||||
ConsS : ListS -> S -> ListS ;
|
ConsS : ListS -> S -> ListS ;
|
||||||
@@ -175,6 +180,9 @@ fun
|
|||||||
TwoNP : NP -> NP -> ListNP ;
|
TwoNP : NP -> NP -> ListNP ;
|
||||||
ConsNP : ListNP -> NP -> ListNP ;
|
ConsNP : ListNP -> NP -> ListNP ;
|
||||||
|
|
||||||
|
TwoAdv : Adv -> Adv -> ListAdv ;
|
||||||
|
ConsAdv : ListAdv -> Adv -> ListAdv ;
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--3 Subordination
|
--3 Subordination
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -4,92 +4,100 @@
|
|||||||
--
|
--
|
||||||
-- Here we have some words belonging to closed classes and appearing
|
-- Here we have some words belonging to closed classes and appearing
|
||||||
-- in all languages we have considered.
|
-- in all languages we have considered.
|
||||||
-- Sometimes they are not really meaningful, e.g. $TheyNP$ in French
|
-- Sometimes they are not really meaningful, e.g. $we_NP$ in Spanish
|
||||||
-- should really be replaced by masculine and feminine variants.
|
-- should be replaced by masculine and feminine variants.
|
||||||
|
|
||||||
abstract Structural = Categories, Numerals ** {
|
abstract Structural = Categories, Numerals ** {
|
||||||
|
|
||||||
fun
|
fun
|
||||||
|
|
||||||
--!
|
-- First mount the numerals.
|
||||||
--2 Determiners and noun phrases
|
|
||||||
--
|
|
||||||
-- Many plural determiners can take a numeral modifier. So can the plural
|
|
||||||
-- pronouns "we" and "you".
|
|
||||||
|
|
||||||
EveryDet, WhichDet, AllMassDet, -- every, sg which, sg all
|
UseNumeral : Numeral-> Num ;
|
||||||
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
|
|
||||||
|
|
||||||
AllNumDet, WhichNumDet, -- pl all, which (86)
|
-- Then an alphabetical list of structural words
|
||||||
SomeNumDet, AnyNumDet, NoNumDet, -- pl some, any, no
|
|
||||||
TheseNumDet, ThoseNumDet : Num -> Det ; -- these, those (86)
|
|
||||||
|
|
||||||
ThisNP, ThatNP : NP ; -- this, that
|
above_Prep : Prep ;
|
||||||
TheseNumNP, ThoseNumNP : Num -> NP ; -- these, those (86)
|
after_Prep : Prep ;
|
||||||
INP, ThouNP, HeNP, SheNP, ItNP : NP ; -- personal pronouns in singular
|
all8mass_Det : Det ;
|
||||||
WeNumNP, YeNumNP : Num -> NP ; -- these pronouns can take numeral
|
all_NDet : NDet ;
|
||||||
TheyNP : NP ; YouNP : NP ; -- they, the polite you
|
almost_Adv : AdA ;
|
||||||
TheyFemNP : NP ;
|
although_Subj : Subj ;
|
||||||
|
and_Conj : Conj ;
|
||||||
EverybodyNP, SomebodyNP, NobodyNP, -- everybody, somebody, nobody
|
because_Subj : Subj ;
|
||||||
EverythingNP, SomethingNP, NothingNP : NP ; -- everything, something, nothing
|
before_Prep : Prep ;
|
||||||
|
behind_Prep : Prep ;
|
||||||
UseNumeral : Numeral -> Num ; -- "thirty-two" --- assumes i > 1
|
between_Prep : Prep ;
|
||||||
|
both_AndConjD : ConjD ;
|
||||||
--!
|
by8agent_Prep : Prep ;
|
||||||
--2 Auxiliary verbs
|
by8means_Prep : Prep ;
|
||||||
--
|
can8know_VV : VV ;
|
||||||
-- Depending on language, all, some, or none of there verbs belong to
|
can_VV : VV ;
|
||||||
-- a separate class of *auxiliary* verbs. The list is incomplete.
|
during_Prep : Prep ;
|
||||||
|
either8or_ConjD : ConjD ;
|
||||||
CanVV, CanKnowVV, MustVV : VV ; -- can (pouvoir,savoir), must
|
every_Det : Det ;
|
||||||
WantVV : VV ; -- want (to do)
|
everybody_NP : NP ;
|
||||||
|
everything_NP : NP ;
|
||||||
--!
|
everywhere_Adv : Adv ;
|
||||||
--2 Adverbials
|
from_Prep : Prep ;
|
||||||
--
|
he_NP : NP ;
|
||||||
|
how_IAdv : IAdv ;
|
||||||
WhenIAdv,WhereIAdv,WhyIAdv,HowIAdv : IAdv ; -- when, where, why, how
|
how8many_IDet : IDet ;
|
||||||
EverywhereNP, SomewhereNP,NowhereNP : Adv ; -- everywhere, somewhere, nowhere
|
i_NP : NP ;
|
||||||
VeryAdv, TooAdv : AdA ; -- very, too
|
if_Subj : Subj ;
|
||||||
AlmostAdv, QuiteAdv : AdA ; -- almost, quite
|
in8front_Prep : Prep ;
|
||||||
OtherwiseAdv, ThereforeAdv : AdC ; -- therefore, otherwise
|
in_Prep : Prep ;
|
||||||
|
it_NP : NP ;
|
||||||
--!
|
many_Det : Det ;
|
||||||
--2 Conjunctions and subjunctions
|
most_Det : Det ;
|
||||||
--
|
most8many_Det : Det ;
|
||||||
|
much_Det : Det ;
|
||||||
AndConj, OrConj : Conj ; -- and, or
|
must_VV : VV ;
|
||||||
BothAnd, EitherOr, NeitherNor : ConjD ; -- both-and, either-or, neither-nor
|
no_Phr : Phr ;
|
||||||
IfSubj, WhenSubj, AlthoughSubj : Subj ; -- if, when, although
|
on_Prep : Prep ;
|
||||||
|
or_Conj : Conj ;
|
||||||
--!
|
otherwise_Adv : AdC ;
|
||||||
--2 Prepositions
|
part_Prep : Prep ;
|
||||||
--
|
possess_Prep : Prep ;
|
||||||
-- We have chosen a set of semantic relations expressible
|
quite_Adv : AdA ;
|
||||||
-- by prepositions in some languages, by cases or postpositions in
|
she_NP : NP ;
|
||||||
-- others. Complement uses of prepositions are not included, and
|
so_Adv : AdA ;
|
||||||
-- should be treated by the use of many-place verbs, adjectives, and
|
some_Det : Det ;
|
||||||
-- functions.
|
some_NDet : NDet ;
|
||||||
|
somebody_NP : NP ;
|
||||||
InPrep, OnPrep, ToPrep, FromPrep, -- spatial relations
|
something_NP : NP ;
|
||||||
ThroughPrep, AbovePrep, UnderPrep,
|
somewhere_Adv : Adv ;
|
||||||
InFrontPrep, BehindPrep, BetweenPrep : Prep ;
|
that_Det : Det ;
|
||||||
BeforePrep, DuringPrep, AfterPrep : Prep ; -- temporal relations
|
that_NP : NP ;
|
||||||
WithPrep, WithoutPrep, ByMeansPrep : Prep ; -- some other relations
|
therefore_Adv : AdC ;
|
||||||
PossessPrep : Prep ; -- possessive/genitive
|
these_NDet : NDet ;
|
||||||
PartPrep : Prep ; -- partitive "of" ("bottle of wine")
|
they8fem_NP : NP ;
|
||||||
AgentPrep : Prep ; -- agent "by" in passive constructions
|
they_NP : NP ;
|
||||||
|
this_Det : Det ;
|
||||||
|
this_NP : NP ;
|
||||||
--!
|
those_NDet : NDet ;
|
||||||
--2 Affirmation and negation
|
thou_NP : NP ;
|
||||||
--
|
through_Prep : Prep ;
|
||||||
-- The negative-positive (French "si", German "doch") is missing.
|
to_Prep : Prep ;
|
||||||
|
too_Adv : AdA ;
|
||||||
PhrYes, PhrNo : Phr ; -- yes, no
|
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 ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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 ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -6,8 +6,99 @@
|
|||||||
--
|
--
|
||||||
concrete StructuralDan of Structural =
|
concrete StructuralDan of Structural =
|
||||||
CategoriesDan, NumeralsDan ** open Prelude, MorphoDan, SyntaxDan in {
|
CategoriesDan, NumeralsDan ** open Prelude, MorphoDan, SyntaxDan in {
|
||||||
|
|
||||||
|
flags optimize=values ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
|
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||||
|
|
||||||
|
above_Prep = ss "ovenfor" ;
|
||||||
|
after_Prep = ss "efter" ;
|
||||||
|
by8agent_Prep = ss "af" ;
|
||||||
|
all8mass_Det = mkDeterminerSgGender2 "all" "alt" IndefP ;
|
||||||
|
all_NDet = mkDeterminerPl "alle" IndefP ;
|
||||||
|
almost_Adv = ss "næsten" ;
|
||||||
|
although_Subj = ss ["selv om"] ;
|
||||||
|
and_Conj = ss "og" ** {n = Pl} ;
|
||||||
|
because_Subj = ss ["fordi"] ;
|
||||||
|
before_Prep = ss "før" ;
|
||||||
|
behind_Prep = ss "bag" ;
|
||||||
|
between_Prep = ss "mellem" ;
|
||||||
|
both_AndConjD = sd2 "både" "og" ** {n = Pl} ;
|
||||||
|
by8means_Prep = ss "med" ;
|
||||||
|
can8know_VV = mkVerb "kunne" "kan" nonExist "kunne" "kunnet" nonExist ** {s1 = [] ; s3 = []} ;
|
||||||
|
can_VV = mkVerb "kunne" "kan" nonExist "kunne" "kunnet" nonExist ** {s1 = [] ; s3 = []} ;
|
||||||
|
during_Prep = ss "under" ;
|
||||||
|
either8or_ConjD = sd2 "enten" "eller" ** {n = Sg} ;
|
||||||
|
everybody_NP = let alla = table {Nom => "alle" ; Gen => "alles"} in
|
||||||
|
{s = \\c => alla ! npCase c ; g = Utr ; n = Pl ; p = P3} ;
|
||||||
|
every_Det = varjeDet ;
|
||||||
|
everything_NP = nameNounPhrase (mkProperName "alt" NNeutr) ;
|
||||||
|
everywhere_Adv = advPost "overalt" ;
|
||||||
|
from_Prep = ss "fra" ;
|
||||||
|
he_NP = pronNounPhrase han_34 ;
|
||||||
|
how_IAdv = ss "hvor" ;
|
||||||
|
how8many_IDet = mkDeterminerPl ["hvor mange"] IndefP ;
|
||||||
|
if_Subj = ss "hvis" ;
|
||||||
|
in8front_Prep = ss "fremfor" ; ---- ?
|
||||||
|
i_NP = pronNounPhrase jag_32 ;
|
||||||
|
in_Prep = ss "i" ;
|
||||||
|
it_NP = pronNounPhrase det_40 ; ----
|
||||||
|
many_Det = mkDeterminerPl "mange" IndefP ;
|
||||||
|
most_Det = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
||||||
|
most8many_Det = flestaDet ;
|
||||||
|
much_Det = mkDeterminerSg (detSgInvar "meget") IndefP ;
|
||||||
|
must_VV = mkVerb "måtte" "må" "mås" "måtte" "måttet" "må" ** {s1 = [] ; s3 = []} ; ---- ?
|
||||||
|
on_Prep = ss "på" ;
|
||||||
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
|
otherwise_Adv = ss "anderledes" ; ---- ?
|
||||||
|
part_Prep = ss "af" ;
|
||||||
|
no_Phr = ss ["Nej ."] ;
|
||||||
|
yes_Phr = ss ["Ja ."] ;
|
||||||
|
possess_Prep = ss "af" ;
|
||||||
|
quite_Adv = ss "temmelig" ;
|
||||||
|
she_NP = pronNounPhrase hon_35 ;
|
||||||
|
so_Adv = ss "så" ;
|
||||||
|
somebody_NP = nameNounPhrase (mkProperName "nogen" NUtr) ;
|
||||||
|
some_Det = mkDeterminerSgGender2 "nogen" "noget" IndefP ;
|
||||||
|
some_NDet = mkDeterminerPlNum "nogle" IndefP ;
|
||||||
|
something_NP = nameNounPhrase (mkProperName "noget" NNeutr) ;
|
||||||
|
somewhere_Adv = advPost ["et eller andet sted"] ; ---- ?
|
||||||
|
that_Det = mkDeterminerSgGender2 ["den der"] ["det der"] (DefP Indef) ;
|
||||||
|
that_NP = regNameNounPhrase ["det der"] NNeutr ;
|
||||||
|
therefore_Adv = ss "derfor" ;
|
||||||
|
these_NDet = mkDeterminerPlNum ["de her"] (DefP Indef) ;
|
||||||
|
they8fem_NP = pronNounPhrase de_38 ;
|
||||||
|
they_NP = pronNounPhrase de_38 ;
|
||||||
|
this_Det = mkDeterminerSgGender2 ["den her"] ["det her"] (DefP Indef) ;
|
||||||
|
this_NP = regNameNounPhrase ["det her"] NNeutr ;
|
||||||
|
those_NDet = mkDeterminerPlNum ["de der"] (DefP Indef) ;
|
||||||
|
thou_NP = pronNounPhrase du_33 ;
|
||||||
|
through_Prep = ss "igennem" ;
|
||||||
|
too_Adv = ss "for" ; ---- ?
|
||||||
|
to_Prep = ss "til" ;
|
||||||
|
under_Prep = ss "under" ;
|
||||||
|
very_Adv = ss "meget" ;
|
||||||
|
want_VV = mkVerb "ville" "vil" nonExist "ville" "villet" nonExist ** {s1 = [] ; s3 = []} ; ---
|
||||||
|
we_NP = pronNounPhrase (vi_36) ;
|
||||||
|
what8many_IP = intPronWhat plural ;
|
||||||
|
what8one_IP = intPronWhat singular ;
|
||||||
|
when_IAdv = ss "hvornår" ;
|
||||||
|
when_Subj = ss "når" ;
|
||||||
|
where_IAdv = ss "hver" ;
|
||||||
|
which8one_IDet = vilkenDet ;
|
||||||
|
which8many_IDet = mkDeterminerPl "hvilke" IndefP ;
|
||||||
|
who8many_IP = intPronWho plural ;
|
||||||
|
who8one_IP = intPronWho singular ;
|
||||||
|
why_IAdv = ss "hvorfor" ;
|
||||||
|
without_Prep = ss "uden" ;
|
||||||
|
with_Prep = ss "med" ;
|
||||||
|
ye_NP = pronNounPhrase (ni_37) ;
|
||||||
|
you_NP = pronNounPhrase De_38 ;
|
||||||
|
|
||||||
|
|
||||||
|
{-
|
||||||
INP = pronNounPhrase jag_32 ;
|
INP = pronNounPhrase jag_32 ;
|
||||||
ThouNP = pronNounPhrase du_33 ;
|
ThouNP = pronNounPhrase du_33 ;
|
||||||
HeNP = pronNounPhrase han_34 ;
|
HeNP = pronNounPhrase han_34 ;
|
||||||
@@ -42,7 +133,6 @@ concrete StructuralDan of Structural =
|
|||||||
NoNumDet = mkDeterminerPlNum "ingen" IndefP ;
|
NoNumDet = mkDeterminerPlNum "ingen" IndefP ;
|
||||||
WhichNumDet = mkDeterminerPlNum "hvilke" IndefP ;
|
WhichNumDet = mkDeterminerPlNum "hvilke" IndefP ;
|
||||||
|
|
||||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
|
||||||
|
|
||||||
WhichDet = vilkenDet ;
|
WhichDet = vilkenDet ;
|
||||||
MostDet = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
MostDet = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
||||||
@@ -116,5 +206,5 @@ concrete StructuralDan of Structural =
|
|||||||
PossessPrep = ss "af" ;
|
PossessPrep = ss "af" ;
|
||||||
PartPrep = ss "af" ;
|
PartPrep = ss "af" ;
|
||||||
AgentPrep = ss "af" ;
|
AgentPrep = ss "af" ;
|
||||||
|
-}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ concrete TestResourceDan of TestResource = RulesDan, ClauseDan, StructuralDan **
|
|||||||
|
|
||||||
flags startcat=Phr ; lexer=text ; unlexer=text ;
|
flags startcat=Phr ; lexer=text ; unlexer=text ;
|
||||||
|
|
||||||
|
optimize=values ;
|
||||||
|
|
||||||
-- a random sample from the lexicon
|
-- a random sample from the lexicon
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--# -path=.:../abstract:../../prelude
|
--# -path=.:../abstract:../../prelude
|
||||||
--# -val
|
--# -val
|
||||||
|
|
||||||
concrete BasicEng of Basic = CategoriesEng ** open NewParadigmsEng in {
|
concrete BasicEng of Basic = CategoriesEng ** open ParadigmsEng in {
|
||||||
|
|
||||||
flags
|
flags
|
||||||
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||||
@@ -220,4 +220,10 @@ lin
|
|||||||
put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ;
|
put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ;
|
||||||
stop_V = regV "stop" ;
|
stop_V = regV "stop" ;
|
||||||
jump_V = regV "jump" ;
|
jump_V = regV "jump" ;
|
||||||
|
here_Adv = mkAdv "here" ;
|
||||||
|
here7to_Adv = mkAdv "here" ;
|
||||||
|
here7from_Adv = mkAdv ["from here"] ;
|
||||||
|
there_Adv = mkAdv "there" ;
|
||||||
|
there7to_Adv = mkAdv "there" ;
|
||||||
|
there7from_Adv = mkAdv ["from there"] ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ lincat
|
|||||||
NP = {s : NPForm => Str ; a : Agr} ;
|
NP = {s : NPForm => Str ; a : Agr} ;
|
||||||
PN = {s : Case => Str ; g : Gender} ;
|
PN = {s : Case => Str ; g : Gender} ;
|
||||||
Det = {s : Str ; n : Number} ;
|
Det = {s : Str ; n : Number} ;
|
||||||
|
NDet = {s : Str} ;
|
||||||
N2 = Function ;
|
N2 = Function ;
|
||||||
-- = CommNounPhrase ** {s2 : Preposition} ;
|
-- = CommNounPhrase ** {s2 : Preposition} ;
|
||||||
N3 = Function ** {s3 : Preposition} ;
|
N3 = Function ** {s3 : Preposition} ;
|
||||||
@@ -88,6 +89,7 @@ lincat
|
|||||||
RS = {s : Agr => Str} ;
|
RS = {s : Agr => Str} ;
|
||||||
|
|
||||||
IP = {s : NPForm => Str ; n : Number ; g : Gender} ;
|
IP = {s : NPForm => Str ; n : Number ; g : Gender} ;
|
||||||
|
IDet = {s : Str ; n : Number} ;
|
||||||
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
||||||
QS = {s : QuestForm => Str} ;
|
QS = {s : QuestForm => Str} ;
|
||||||
Imp = {s : Number => Str} ;
|
Imp = {s : Number => Str} ;
|
||||||
@@ -100,5 +102,6 @@ lincat
|
|||||||
ListS = {s1 : Str ; s2 : Str} ;
|
ListS = {s1 : Str ; s2 : Str} ;
|
||||||
ListAP = {s1,s2 : AForm => Str ; p : Bool} ;
|
ListAP = {s1,s2 : AForm => Str ; p : Bool} ;
|
||||||
ListNP = {s1,s2 : NPForm => Str ; a : Agr} ;
|
ListNP = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||||
|
ListAdv = {s1 : Str ; s2 : Str} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete CountryEng of Country = open ResourceEng, NewParadigmsEng in {
|
concrete CountryEng of Country = open ResourceEng, ParadigmsEng in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Country = PN ;
|
Country = PN ;
|
||||||
|
|||||||
22
lib/resource/english/LangEng.gf
Normal file
22
lib/resource/english/LangEng.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete LangEng of Lang =
|
||||||
|
RulesEng,
|
||||||
|
ClauseEng,
|
||||||
|
StructuralEng,
|
||||||
|
BasicEng,
|
||||||
|
TimeEng,
|
||||||
|
CountryEng
|
||||||
|
|
||||||
|
** open Prelude, ResourceEng, ParadigmsEng in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
AdvDate d = prefixSS "on" d ;
|
||||||
|
AdvTime t = prefixSS "at" t ;
|
||||||
|
NWeekday w = w ;
|
||||||
|
PNWeekday w = nounPN w ;
|
||||||
|
|
||||||
|
PNCountry x = x ;
|
||||||
|
ANationality x = x ;
|
||||||
|
NLanguage x = x ;
|
||||||
|
}
|
||||||
@@ -1,413 +0,0 @@
|
|||||||
--# -path=.:../abstract:../../prelude
|
|
||||||
|
|
||||||
--1 English Lexical Paradigms UNDER RECONSTRUCTION!
|
|
||||||
--
|
|
||||||
-- Aarne Ranta 2003
|
|
||||||
--
|
|
||||||
-- This is an API to the user of the resource grammar
|
|
||||||
-- for adding lexical items. It gives functions for forming
|
|
||||||
-- expressions of open categories: nouns, adjectives, verbs.
|
|
||||||
--
|
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
|
||||||
--
|
|
||||||
-- The main difference with $MorphoEng.gf$ is that the types
|
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
|
||||||
-- had the design principle of always having existing forms, rather
|
|
||||||
-- than stems, as string arguments of the paradigms.
|
|
||||||
--
|
|
||||||
-- The structure of functions for each word class $C$ is the following:
|
|
||||||
-- first we give a handful of patterns that aim to cover all
|
|
||||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
|
||||||
-- escape to construct the most irregular words of type $C$.
|
|
||||||
-- However, this function should only seldom be needed: we have a
|
|
||||||
-- separate module $IrregularEng$, which covers all irregularly inflected
|
|
||||||
-- words.
|
|
||||||
--
|
|
||||||
-- The following modules are presupposed:
|
|
||||||
|
|
||||||
resource NewParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in {
|
|
||||||
|
|
||||||
--2 Parameters
|
|
||||||
--
|
|
||||||
-- To abstract over gender names, we define the following identifiers.
|
|
||||||
|
|
||||||
oper
|
|
||||||
Gender : Type ;
|
|
||||||
|
|
||||||
human : Gender ;
|
|
||||||
nonhuman : Gender ;
|
|
||||||
masculine : Gender ;
|
|
||||||
feminite : Gender ;
|
|
||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
|
||||||
|
|
||||||
Number : Type ;
|
|
||||||
|
|
||||||
singular : Number ;
|
|
||||||
plural : Number ;
|
|
||||||
|
|
||||||
-- To abstract over case names, we define the following.
|
|
||||||
|
|
||||||
Case : Type ;
|
|
||||||
|
|
||||||
nominative : Case ;
|
|
||||||
genitive : Case ;
|
|
||||||
|
|
||||||
-- Prepositions used in many-argument functions are just strings.
|
|
||||||
|
|
||||||
Preposition : Type = Str ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Nouns
|
|
||||||
|
|
||||||
-- Worst case: give all four forms and the semantic gender.
|
|
||||||
|
|
||||||
mkN : (man,men,man's,men's : Str) -> N ;
|
|
||||||
|
|
||||||
-- The regular function captures the variants for nouns ending with
|
|
||||||
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
|
||||||
-- "fly - flies" (but "toy - toys"),
|
|
||||||
|
|
||||||
regN : Str -> N ;
|
|
||||||
|
|
||||||
-- In practice the worst case is just: give singular and plural nominative.
|
|
||||||
|
|
||||||
mk2N : (man,men : Str) -> N ;
|
|
||||||
|
|
||||||
-- All nouns created by the previous functions are marked as
|
|
||||||
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
|
|
||||||
-- function:
|
|
||||||
|
|
||||||
genderN : Gender -> N -> N ;
|
|
||||||
|
|
||||||
--3 Compound nouns
|
|
||||||
--
|
|
||||||
-- All the functions above work quite as well to form compound nouns,
|
|
||||||
-- such as "baby boom".
|
|
||||||
|
|
||||||
|
|
||||||
--3 Relational nouns
|
|
||||||
--
|
|
||||||
-- Relational nouns ("daughter of x") need a preposition.
|
|
||||||
|
|
||||||
mkN2 : N -> Preposition -> N2 ;
|
|
||||||
|
|
||||||
-- The most common preposition is "of", and the following is a
|
|
||||||
-- shortcut for regular, $nonhuman$ relational nouns with "of".
|
|
||||||
|
|
||||||
regN2 : Str -> N2 ;
|
|
||||||
|
|
||||||
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
|
||||||
-- form other prepositions.
|
|
||||||
--
|
|
||||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
|
||||||
|
|
||||||
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
|
||||||
|
|
||||||
|
|
||||||
--3 Relational common noun phrases
|
|
||||||
--
|
|
||||||
-- In some cases, you may want to make a complex $CN$ into a
|
|
||||||
-- relational noun (e.g. "the old town hall of").
|
|
||||||
|
|
||||||
cnN2 : CN -> Preposition -> N2 ;
|
|
||||||
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
|
||||||
|
|
||||||
--
|
|
||||||
--3 Proper names and noun phrases
|
|
||||||
--
|
|
||||||
-- Proper names, with a regular genitive, are formed as follows
|
|
||||||
|
|
||||||
regPN : Str -> Gender -> PN ; -- John, John's
|
|
||||||
|
|
||||||
-- To form a noun phrase that can also be plural and have an irregular
|
|
||||||
-- genitive, you can use the worst-case function.
|
|
||||||
|
|
||||||
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
|
||||||
|
|
||||||
--2 Adjectives
|
|
||||||
|
|
||||||
-- Non-comparison one-place adjectives need two forms: one for
|
|
||||||
-- the adjectival and one for the adverbial form ("free - freely")
|
|
||||||
|
|
||||||
mkA : (free,freely : Str) -> A ;
|
|
||||||
|
|
||||||
-- For regular adjectives, the adverbial form is derived. This holds
|
|
||||||
-- even for cases with the variation "happy - happily".
|
|
||||||
|
|
||||||
regA : Str -> A ;
|
|
||||||
|
|
||||||
--3 Two-place adjectives
|
|
||||||
--
|
|
||||||
-- Two-place adjectives need a preposition for their second argument.
|
|
||||||
|
|
||||||
mkA2 : A -> Preposition -> A2 ;
|
|
||||||
|
|
||||||
-- Comparison adjectives may two more forms.
|
|
||||||
|
|
||||||
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
|
||||||
|
|
||||||
-- The regular pattern recognizes two common variations:
|
|
||||||
-- "-e" ("rude" - "ruder" - "rudest") and
|
|
||||||
-- "-y" ("happy - happier - happiest - happily")
|
|
||||||
|
|
||||||
regADeg : Str -> ADeg ; -- long, longer, longest
|
|
||||||
|
|
||||||
-- However, the duplication of the final consonant is nor predicted,
|
|
||||||
-- but a separate pattern is used:
|
|
||||||
|
|
||||||
duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
|
||||||
|
|
||||||
-- If comparison is formed by "more, "most", as in general for
|
|
||||||
-- long adjective, the following pattern is used:
|
|
||||||
|
|
||||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
|
||||||
|
|
||||||
-- From a given $ADeg$, it is possible to get back to $A$.
|
|
||||||
|
|
||||||
adegA : ADeg -> A ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbs
|
|
||||||
|
|
||||||
-- Adverbs are not inflected. Most lexical ones have position
|
|
||||||
-- after the verb. Some can be preverbal (e.g. "always").
|
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
|
||||||
mkAdV : Str -> AdV ;
|
|
||||||
|
|
||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
|
||||||
|
|
||||||
--2 Prepositions
|
|
||||||
--
|
|
||||||
-- A preposition is just a string.
|
|
||||||
|
|
||||||
mkPreposition : Str -> Preposition ;
|
|
||||||
|
|
||||||
--2 Verbs
|
|
||||||
--
|
|
||||||
-- Except for "be", the worst case needs five forms: the infinitive and
|
|
||||||
-- the third person singular present, the past indicative, and the
|
|
||||||
-- past and present participles.
|
|
||||||
|
|
||||||
mkV : (go, goes, went, gone, going : Str) -> V ;
|
|
||||||
|
|
||||||
-- The regular verb function recognizes the special cases where the last
|
|
||||||
-- character is "y" ("cry - cries" but "buy - buys") or "s", "sh", "x", "z"
|
|
||||||
-- ("fix - fixes", etc).
|
|
||||||
|
|
||||||
regV : Str -> V ;
|
|
||||||
|
|
||||||
-- The following variant duplicates the last letter in the forms like
|
|
||||||
-- "rip - ripped - ripping".
|
|
||||||
|
|
||||||
regDuplV : Str -> V ;
|
|
||||||
|
|
||||||
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
|
||||||
-- In practice, it is enough to give three forms,
|
|
||||||
-- e.g. "drink - drank - drunk", with a variant indicating consonant
|
|
||||||
-- duplication in the present participle.
|
|
||||||
|
|
||||||
irregV : (drink, drank, drunk : Str) -> V ;
|
|
||||||
irregDuplV : (get, got, gotten : Str) -> V ;
|
|
||||||
|
|
||||||
|
|
||||||
--3 Verbs with a particle.
|
|
||||||
--
|
|
||||||
-- The particle, such as in "switch on", is given as a string.
|
|
||||||
|
|
||||||
partV : V -> Str -> V ;
|
|
||||||
|
|
||||||
--3 Two-place verbs
|
|
||||||
--
|
|
||||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
|
||||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
|
||||||
|
|
||||||
mkV2 : V -> Preposition -> V2 ;
|
|
||||||
|
|
||||||
dirV2 : V -> V2 ;
|
|
||||||
|
|
||||||
--3 Three-place verbs
|
|
||||||
--
|
|
||||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
|
||||||
-- the first one or both can be absent.
|
|
||||||
|
|
||||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
|
||||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
|
||||||
dirdirV3 : V -> V3 ; -- give,_,_
|
|
||||||
|
|
||||||
--3 Other complement patterns
|
|
||||||
--
|
|
||||||
-- Verbs and adjectives can take complements such as sentences,
|
|
||||||
-- questions, verb phrases, and adjectives.
|
|
||||||
|
|
||||||
mkV0 : V -> V0 ;
|
|
||||||
mkVS : V -> VS ;
|
|
||||||
mkV2S : V -> Str -> V2S ;
|
|
||||||
mkVV : V -> VV ;
|
|
||||||
mkV2V : V -> Str -> Str -> V2V ;
|
|
||||||
mkVA : V -> VA ;
|
|
||||||
mkV2A : V -> Str -> V2A ;
|
|
||||||
mkVQ : V -> VQ ;
|
|
||||||
mkV2Q : V -> Str -> V2Q ;
|
|
||||||
|
|
||||||
mkAS : A -> AS ;
|
|
||||||
mkA2S : A -> Str -> A2S ;
|
|
||||||
mkAV : A -> AV ;
|
|
||||||
mkA2V : A -> Str -> A2V ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Definitions of paradigms
|
|
||||||
--
|
|
||||||
-- The definitions should not bother the user of the API. So they are
|
|
||||||
-- hidden from the document.
|
|
||||||
--.
|
|
||||||
|
|
||||||
Gender = SyntaxEng.Gender ;
|
|
||||||
Number = SyntaxEng.Number ;
|
|
||||||
Case = SyntaxEng.Case ;
|
|
||||||
human = Masc ;
|
|
||||||
nonhuman = Neutr ;
|
|
||||||
masculine = Masc ;
|
|
||||||
feminine = Fem ;
|
|
||||||
singular = Sg ;
|
|
||||||
plural = Pl ;
|
|
||||||
nominative = Nom ;
|
|
||||||
genitive = Gen ;
|
|
||||||
|
|
||||||
regN = \ray ->
|
|
||||||
let
|
|
||||||
ra = Predef.tk 1 ray ;
|
|
||||||
y = Predef.dp 1 ray ;
|
|
||||||
r = Predef.tk 2 ray ;
|
|
||||||
ay = Predef.dp 2 ray ;
|
|
||||||
rays =
|
|
||||||
case y of {
|
|
||||||
"y" => y2ie ray "s" ;
|
|
||||||
"s" => ray + "es" ;
|
|
||||||
"z" => ray + "es" ;
|
|
||||||
"x" => ray + "es" ;
|
|
||||||
_ => case ay of {
|
|
||||||
"sh" => ray + "es" ;
|
|
||||||
"ch" => ray + "es" ;
|
|
||||||
_ => ray + "s"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
in
|
|
||||||
mk2N ray rays ;
|
|
||||||
|
|
||||||
mk2N = \man,men ->
|
|
||||||
let mens = case last men of {
|
|
||||||
"s" => men + "'" ;
|
|
||||||
_ => men + "'s"
|
|
||||||
}
|
|
||||||
in
|
|
||||||
mkN man men (man + "'s") mens ;
|
|
||||||
|
|
||||||
mkN = \man,men,man's,men's ->
|
|
||||||
mkNoun man men man's men's ** {g = Neutr ; lock_N = <>} ;
|
|
||||||
|
|
||||||
genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
|
||||||
|
|
||||||
mkN2 = \n,p -> UseN n ** {lock_N2 = <> ; s2 = p} ;
|
|
||||||
regN2 n = mkN2 (regN n) (mkPreposition "of") ;
|
|
||||||
mkN3 = \n,p,q -> UseN n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
|
||||||
cnN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
|
||||||
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
|
||||||
|
|
||||||
regPN n g = nameReg n g ** {lock_PN = <>} ;
|
|
||||||
mkNP x y n g = {s = table {GenP => x ; _ => y} ; a = toAgr n P3 g ;
|
|
||||||
lock_NP = <>} ;
|
|
||||||
|
|
||||||
mkA a b = mkAdjective a b ** {lock_A = <>} ;
|
|
||||||
regA a = regAdjective a ** {lock_A = <>} ;
|
|
||||||
|
|
||||||
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
|
||||||
|
|
||||||
mkADeg a b c d = mkAdjDegrWorst a b c c d d ** {lock_ADeg = <>} ;
|
|
||||||
|
|
||||||
regADeg happy =
|
|
||||||
let
|
|
||||||
happ = init happy ;
|
|
||||||
y = last happy ;
|
|
||||||
happie = case y of {
|
|
||||||
"y" => happ + "ie" ;
|
|
||||||
"e" => happy ;
|
|
||||||
_ => happy + "e"
|
|
||||||
} ;
|
|
||||||
happily = case y of {
|
|
||||||
"y" => happ + "ily" ;
|
|
||||||
_ => happy + "ly"
|
|
||||||
} ;
|
|
||||||
in mkADeg happy happily (happie + "r") (happie + "st") ;
|
|
||||||
|
|
||||||
duplADeg fat = mkADeg fat
|
|
||||||
(fat + "ly") (fat + last fat + "er") (fat + last fat + "est") ;
|
|
||||||
compoundADeg a = let ad = (a.s ! AAdj) in
|
|
||||||
mkADeg ad (a.s ! AAdv) ("more" ++ ad) ("most" ++ ad) ;
|
|
||||||
adegA a = {s = a.s ! Pos ; lock_A = <>} ;
|
|
||||||
|
|
||||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
|
||||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
|
||||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
|
||||||
|
|
||||||
mkPreposition p = p ;
|
|
||||||
|
|
||||||
mkV a b c d e = mkVerbP3worst a b c d e ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
|
|
||||||
regV cry =
|
|
||||||
let
|
|
||||||
cr = init cry ;
|
|
||||||
y = last cry ;
|
|
||||||
cries = (regN cry).s ! Pl ! Nom ; -- !
|
|
||||||
crie = init cries ;
|
|
||||||
cried = case last crie of {
|
|
||||||
"e" => crie + "d" ;
|
|
||||||
_ => crie + "ed"
|
|
||||||
} ;
|
|
||||||
crying = case y of {
|
|
||||||
"e" => cr + "ing" ;
|
|
||||||
_ => cry + "ing"
|
|
||||||
}
|
|
||||||
in mkV cry cries cried cried crying ;
|
|
||||||
|
|
||||||
regDuplV fit =
|
|
||||||
let fitt = fit + last fit in
|
|
||||||
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
|
||||||
|
|
||||||
irregV x y z = mkVerbIrreg x y z ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
|
|
||||||
irregDuplV fit y z =
|
|
||||||
let
|
|
||||||
fitting = (regDuplV fit).s ! PresPart
|
|
||||||
in
|
|
||||||
mkV fit (fit + "s") y z fitting ;
|
|
||||||
|
|
||||||
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
|
||||||
|
|
||||||
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; lock_V2 = <>} ;
|
|
||||||
dirV2 v = mkV2 v [] ;
|
|
||||||
|
|
||||||
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; s4 = q ; lock_V3 = <>} ;
|
|
||||||
dirV3 v p = mkV3 v [] p ;
|
|
||||||
dirdirV3 v = dirV3 v [] ;
|
|
||||||
|
|
||||||
mkV0 v = v ** {lock_V0 = <>} ;
|
|
||||||
mkVS v = v ** {lock_VS = <>} ;
|
|
||||||
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
|
||||||
mkVV v = v ** {isAux = False ; lock_VV = <>} ;
|
|
||||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
|
||||||
mkVA v = v ** {lock_VA = <>} ;
|
|
||||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
|
||||||
mkVQ v = v ** {lock_VQ = <>} ;
|
|
||||||
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
|
||||||
|
|
||||||
mkAS v = v ** {lock_AS = <>} ;
|
|
||||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
|
||||||
mkAV v = v ** {lock_AV = <>} ;
|
|
||||||
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
|
||||||
|
|
||||||
} ;
|
|
||||||
301
lib/resource/english/OldParadigmsEng.gf
Normal file
301
lib/resource/english/OldParadigmsEng.gf
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
--1 English Lexical Paradigms
|
||||||
|
--
|
||||||
|
-- Aarne Ranta 2003
|
||||||
|
--
|
||||||
|
-- This is an API to the user of the resource grammar
|
||||||
|
-- for adding lexical items. It give shortcuts for forming
|
||||||
|
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||||
|
--
|
||||||
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
|
-- accessed through the resource syntax API, $Structural.gf$.
|
||||||
|
--
|
||||||
|
-- The main difference with $MorphoEng.gf$ is that the types
|
||||||
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
|
-- had the design principle of always having existing forms, rather
|
||||||
|
-- than stems, as string
|
||||||
|
-- arguments of the paradigms.
|
||||||
|
--
|
||||||
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
|
resource OldParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in {
|
||||||
|
|
||||||
|
--2 Parameters
|
||||||
|
--
|
||||||
|
-- To abstract over gender names, we define the following identifiers.
|
||||||
|
|
||||||
|
oper
|
||||||
|
Gender : Type ;
|
||||||
|
|
||||||
|
human : Gender ;
|
||||||
|
nonhuman : Gender ;
|
||||||
|
|
||||||
|
-- To abstract over number names, we define the following.
|
||||||
|
Number : Type ;
|
||||||
|
|
||||||
|
singular : Number ;
|
||||||
|
plural : Number ;
|
||||||
|
|
||||||
|
-- To abstract over case names, we define the following.
|
||||||
|
Case : Type ;
|
||||||
|
|
||||||
|
nominative : Case ;
|
||||||
|
genitive : Case ;
|
||||||
|
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
|
||||||
|
-- Worst case: give all four forms and the semantic gender.
|
||||||
|
-- In practice the worst case is just: give singular and plural nominative.
|
||||||
|
|
||||||
|
oper
|
||||||
|
mkN : (man,men,man's,men's : Str) -> Gender -> N ;
|
||||||
|
nMan : (man,men : Str) -> Gender -> N ;
|
||||||
|
|
||||||
|
-- Regular nouns, nouns ending with "s", "y", or "o", and nouns with the same
|
||||||
|
-- plural form as the singular.
|
||||||
|
|
||||||
|
nReg : Str -> Gender -> N ; -- dog, dogs
|
||||||
|
nKiss : Str -> Gender -> N ; -- kiss, kisses
|
||||||
|
nFly : Str -> Gender -> N ; -- fly, flies
|
||||||
|
nHero : Str -> Gender -> N ; -- hero, heroes (= nKiss !)
|
||||||
|
nSheep : Str -> Gender -> N ; -- sheep, sheep
|
||||||
|
|
||||||
|
-- These use general heuristics, that recognizes the last letter. *N.B* it
|
||||||
|
-- does not get right with "boy", "rush", since it only looks at one letter.
|
||||||
|
|
||||||
|
nHuman : Str -> N ; -- gambler/actress/nanny
|
||||||
|
nNonhuman : Str -> N ; -- dog/kiss/fly
|
||||||
|
|
||||||
|
-- Nouns used as functions need a preposition. The most common is "of".
|
||||||
|
|
||||||
|
mkN2 : N -> Preposition -> N2 ;
|
||||||
|
|
||||||
|
funHuman : Str -> N2 ; -- the father/mistress/daddy of
|
||||||
|
funNonhuman : Str -> N2 ; -- the successor/address/copy of
|
||||||
|
|
||||||
|
-- Proper names, with their regular genitive.
|
||||||
|
|
||||||
|
pnReg : (John : Str) -> PN ; -- John, John's
|
||||||
|
|
||||||
|
-- The most common cases on the higher-level category $CN$ have shortcuts.
|
||||||
|
-- The regular "y"/"s" variation is taken into account.
|
||||||
|
|
||||||
|
cnNonhuman : Str -> CN ;
|
||||||
|
cnHuman : Str -> CN ;
|
||||||
|
npReg : Str -> NP ;
|
||||||
|
|
||||||
|
-- In some cases, you may want to make a complex $CN$ into a function.
|
||||||
|
|
||||||
|
mkN2CN : CN -> Preposition -> N2 ;
|
||||||
|
funOfCN : CN -> N2 ;
|
||||||
|
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
|
||||||
|
-- Non-comparison one-place adjectives just have one form.
|
||||||
|
|
||||||
|
mkA : (even : Str) -> A ;
|
||||||
|
|
||||||
|
-- Two-place adjectives need a preposition as second argument.
|
||||||
|
|
||||||
|
mkA2 : (divisible, by : Str) -> A2 ;
|
||||||
|
|
||||||
|
-- Comparison adjectives have three forms. The common irregular
|
||||||
|
-- cases are ones ending with "y" and a consonant that is duplicated;
|
||||||
|
-- the "y" ending is recognized by the function $aReg$.
|
||||||
|
|
||||||
|
mkADeg : (good,better,best : Str) -> ADeg ;
|
||||||
|
|
||||||
|
aReg : (long : Str) -> ADeg ; -- long, longer, longest
|
||||||
|
aFat : (fat : Str) -> ADeg ; -- fat, fatter, fattest
|
||||||
|
aRidiculous : (ridiculous : Str) -> ADeg ; -- -/more/most ridiculous
|
||||||
|
|
||||||
|
-- On higher level, there are adjectival phrases. The most common case is
|
||||||
|
-- just to use a one-place adjective.
|
||||||
|
|
||||||
|
apReg : Str -> AP ;
|
||||||
|
|
||||||
|
--2 Adverbs
|
||||||
|
|
||||||
|
-- Adverbs are not inflected. Most lexical ones have position not
|
||||||
|
-- before the verb. Some can be preverbal (e.g. "always").
|
||||||
|
|
||||||
|
mkAdv : Str -> Adv ;
|
||||||
|
mkAdvPre : Str -> Adv ;
|
||||||
|
|
||||||
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
|
mkAdA : Str -> AdA ;
|
||||||
|
mkAdC : Str -> AdC ;
|
||||||
|
|
||||||
|
-- Prepositional phrases are another productive form of adverbials.
|
||||||
|
|
||||||
|
mkPP : Str -> NP -> Adv ;
|
||||||
|
|
||||||
|
--2 Verbs
|
||||||
|
--
|
||||||
|
-- The fragment now has all verb forms, except the gerund/present participle.
|
||||||
|
-- Except for "be", the worst case needs four forms: the infinitive and
|
||||||
|
-- the third person singular present, the past indicative, and the past participle.
|
||||||
|
|
||||||
|
mkV : (go, goes, went, gone : Str) -> V ;
|
||||||
|
|
||||||
|
vReg : (walk : Str) -> V ; -- walk, walks
|
||||||
|
vKiss : (kiss : Str) -> V ; -- kiss, kisses
|
||||||
|
vFly : (fly : Str) -> V ; -- fly, flies
|
||||||
|
vGo : (go : Str) -> V ; -- go, goes (= vKiss !)
|
||||||
|
|
||||||
|
-- This generic function recognizes the special cases where the last
|
||||||
|
-- character is "y", "s", or "z". It is not right for "finish" and "convey".
|
||||||
|
|
||||||
|
vGen : Str -> V ; -- walk/kiss/fly
|
||||||
|
|
||||||
|
-- The verbs "be" and "have" are special.
|
||||||
|
|
||||||
|
vBe : V ;
|
||||||
|
vHave : V ;
|
||||||
|
|
||||||
|
-- Verbs with a particle.
|
||||||
|
|
||||||
|
vPart : (go, goes, went, gone, up : Str) -> V ;
|
||||||
|
vPartReg : (get, up : Str) -> V ;
|
||||||
|
|
||||||
|
-- Two-place verbs, and the special case with direct object.
|
||||||
|
-- Notice that a particle can already be included in $V$.
|
||||||
|
|
||||||
|
mkV2 : V -> Str -> V2 ; -- look for, kill
|
||||||
|
|
||||||
|
tvGen : (look, for : Str) -> V2 ; -- look for, talk about
|
||||||
|
tvDir : V -> V2 ; -- switch off
|
||||||
|
tvGenDir : (kill : Str) -> V2 ; -- kill
|
||||||
|
|
||||||
|
-- Regular two-place verbs with a particle.
|
||||||
|
|
||||||
|
tvPartReg : Str -> Str -> Str -> V2 ; -- get, along, with
|
||||||
|
|
||||||
|
-- Ditransitive verbs.
|
||||||
|
|
||||||
|
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||||
|
v3Dir : V -> Str -> V3 ; -- give,_,to
|
||||||
|
v3DirDir : V -> V3 ; -- give,_,_
|
||||||
|
|
||||||
|
-- The definitions should not bother the user of the API. So they are
|
||||||
|
-- hidden from the document.
|
||||||
|
--.
|
||||||
|
|
||||||
|
Gender = SyntaxEng.Gender ;
|
||||||
|
Number = SyntaxEng.Number ;
|
||||||
|
Case = SyntaxEng.Case ;
|
||||||
|
human = Masc ;
|
||||||
|
nonhuman = Neutr ;
|
||||||
|
singular = Sg ;
|
||||||
|
plural = Pl ;
|
||||||
|
|
||||||
|
nominative = Nom ;
|
||||||
|
genitive = Nom ;
|
||||||
|
|
||||||
|
mkN = \man,men,man's,men's,g ->
|
||||||
|
mkNoun man men man's men's ** {g = g ; lock_N = <>} ;
|
||||||
|
nReg a g = addGenN nounReg a g ;
|
||||||
|
nKiss n g = addGenN nounS n g ;
|
||||||
|
nFly = \fly -> addGenN nounY (Predef.tk 1 fly) ;
|
||||||
|
nMan = \man,men -> mkN man men (man + "'s") (men + "'s") ;
|
||||||
|
nHero = nKiss ;
|
||||||
|
nSheep = \sheep -> nMan sheep sheep ;
|
||||||
|
|
||||||
|
nHuman = \s -> nGen s human ;
|
||||||
|
nNonhuman = \s -> nGen s nonhuman ;
|
||||||
|
|
||||||
|
nGen : Str -> Gender -> N = \fly,g -> let {
|
||||||
|
fl = Predef.tk 1 fly ;
|
||||||
|
y = Predef.dp 1 fly ;
|
||||||
|
eqy = ifTok (Str -> Gender -> N) y
|
||||||
|
} in
|
||||||
|
eqy "y" nFly (
|
||||||
|
eqy "s" nKiss (
|
||||||
|
eqy "z" nKiss (
|
||||||
|
nReg))) fly g ;
|
||||||
|
|
||||||
|
mkN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
funNonhuman = \s -> mkN2 (nNonhuman s) "of" ;
|
||||||
|
funHuman = \s -> mkN2 (nHuman s) "of" ;
|
||||||
|
|
||||||
|
pnReg n = nameReg n human ** {lock_PN = <>} ;
|
||||||
|
|
||||||
|
cnNonhuman = \s -> UseN (nGen s nonhuman) ;
|
||||||
|
cnHuman = \s -> UseN (nGen s human) ;
|
||||||
|
npReg = \s -> UsePN (pnReg s) ;
|
||||||
|
|
||||||
|
mkN2CN = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
funOfCN = \n -> mkN2CN n "of" ;
|
||||||
|
|
||||||
|
addGenN : (Str -> CommonNoun) -> Str -> Gender -> N = \f ->
|
||||||
|
\s,g -> f s ** {g = g ; lock_N = <>} ;
|
||||||
|
|
||||||
|
mkA a = regAdjective a ** {lock_A = <>} ;
|
||||||
|
mkA2 = \s,p -> regAdjective s ** {s2 = p} ** {lock_A2 = <>} ;
|
||||||
|
mkADeg a b c = adjDegrIrreg a b c ** {lock_ADeg = <>} ;
|
||||||
|
aReg a = adjDegrReg a ** {lock_ADeg = <>} ;
|
||||||
|
aFat = \fat -> let {fatt = fat + Predef.dp 1 fat} in
|
||||||
|
mkADeg fat (fatt + "er") (fatt + "est") ;
|
||||||
|
aRidiculous a = adjDegrLong a ** {lock_ADeg = <>} ;
|
||||||
|
apReg = \s -> UseA (mkA s) ;
|
||||||
|
|
||||||
|
aGen : Str -> ADeg = \s -> case last s of {
|
||||||
|
"y" => mkADeg s (init s + "ier") (init s + "iest") ;
|
||||||
|
"e" => mkADeg s (s + "r") (s + "st") ;
|
||||||
|
_ => aReg s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdv a = ss a ** {lock_Adv = <>} ;
|
||||||
|
mkAdvPre a = ss a ** {lock_Adv = <>} ;
|
||||||
|
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
||||||
|
mkAdA a = ss a ** {lock_AdA = <>} ;
|
||||||
|
mkAdC a = ss a ** {lock_AdC = <>} ;
|
||||||
|
|
||||||
|
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
||||||
|
{lock_V = <>} ;
|
||||||
|
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
|
||||||
|
vKiss = \kiss -> mkV kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
||||||
|
vFly = \cry -> let {cr = Predef.tk 1 cry} in
|
||||||
|
mkV cry (cr + "ies") (cr + "ied") (cr + "ied") ;
|
||||||
|
vGo = vKiss ;
|
||||||
|
|
||||||
|
vGen = \fly -> let {
|
||||||
|
fl = Predef.tk 1 fly ;
|
||||||
|
y = Predef.dp 1 fly ;
|
||||||
|
eqy = ifTok (Str -> V) y
|
||||||
|
} in
|
||||||
|
eqy "y" vFly (
|
||||||
|
eqy "s" vKiss (
|
||||||
|
eqy "z" vKiss (
|
||||||
|
vReg))) fly ;
|
||||||
|
|
||||||
|
vPart = \go, goes, went, gone, up ->
|
||||||
|
verbPart (mkVerbP3 go goes went gone) up ** {lock_V = <>} ;
|
||||||
|
vPartReg = \get, up ->
|
||||||
|
verbPart (vGen get) up ** {lock_V = <>} ;
|
||||||
|
|
||||||
|
mkV2 = \v,p -> v ** {lock_V2 = <> ; s3 = p} ;
|
||||||
|
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
||||||
|
|
||||||
|
vBe = verbBe ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
|
||||||
|
tvGen = \s,p -> mkV2 (vGen s) p ;
|
||||||
|
tvDir = \v -> mkV2 v [] ;
|
||||||
|
tvGenDir = \s -> tvDir (vGen s) ;
|
||||||
|
|
||||||
|
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
||||||
|
v3Dir x y = mkV3 x [] y ;
|
||||||
|
v3DirDir x = v3Dir x [] ;
|
||||||
|
|
||||||
|
-- these are used in the generated lexicon
|
||||||
|
noun : Str -> N = nNonhuman ;
|
||||||
|
|
||||||
|
verb2 : Str -> Str -> V2 = \v -> mkV2 (vGen v) ;
|
||||||
|
verb3 : Str -> Str -> Str -> V3 = \v -> mkV3 (vGen v) ;
|
||||||
|
|
||||||
|
} ;
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
--# -path=.:../abstract:../../prelude
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
--1 English Lexical Paradigms
|
--1 English Lexical Paradigms UNDER RECONSTRUCTION!
|
||||||
--
|
--
|
||||||
-- Aarne Ranta 2003
|
-- Aarne Ranta 2003
|
||||||
--
|
--
|
||||||
-- This is an API to the user of the resource grammar
|
-- This is an API to the user of the resource grammar
|
||||||
-- for adding lexical items. It give shortcuts for forming
|
-- for adding lexical items. It gives functions for forming
|
||||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
-- expressions of open categories: nouns, adjectives, verbs.
|
||||||
--
|
--
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
-- accessed through the resource syntax API, $Structural.gf$.
|
||||||
@@ -14,8 +14,15 @@
|
|||||||
-- The main difference with $MorphoEng.gf$ is that the types
|
-- The main difference with $MorphoEng.gf$ is that the types
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
-- had the design principle of always having existing forms, rather
|
-- had the design principle of always having existing forms, rather
|
||||||
-- than stems, as string
|
-- than stems, as string arguments of the paradigms.
|
||||||
-- arguments of the paradigms.
|
--
|
||||||
|
-- The structure of functions for each word class $C$ is the following:
|
||||||
|
-- first we give a handful of patterns that aim to cover all
|
||||||
|
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||||
|
-- escape to construct the most irregular words of type $C$.
|
||||||
|
-- However, this function should only seldom be needed: we have a
|
||||||
|
-- separate module $IrregularEng$, which covers all irregularly inflected
|
||||||
|
-- words.
|
||||||
--
|
--
|
||||||
-- The following modules are presupposed:
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
@@ -30,157 +37,235 @@ oper
|
|||||||
|
|
||||||
human : Gender ;
|
human : Gender ;
|
||||||
nonhuman : Gender ;
|
nonhuman : Gender ;
|
||||||
|
masculine : Gender ;
|
||||||
|
feminite : Gender ;
|
||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
-- To abstract over number names, we define the following.
|
||||||
|
|
||||||
Number : Type ;
|
Number : Type ;
|
||||||
|
|
||||||
singular : Number ;
|
singular : Number ;
|
||||||
plural : Number ;
|
plural : Number ;
|
||||||
|
|
||||||
-- To abstract over case names, we define the following.
|
-- To abstract over case names, we define the following.
|
||||||
|
|
||||||
Case : Type ;
|
Case : Type ;
|
||||||
|
|
||||||
nominative : Case ;
|
nominative : Case ;
|
||||||
genitive : Case ;
|
genitive : Case ;
|
||||||
|
|
||||||
|
-- Prepositions used in many-argument functions are just strings.
|
||||||
|
|
||||||
|
Preposition : Type = Str ;
|
||||||
|
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
-- Worst case: give all four forms and the semantic gender.
|
-- Worst case: give all four forms and the semantic gender.
|
||||||
|
|
||||||
|
mkN : (man,men,man's,men's : Str) -> N ;
|
||||||
|
|
||||||
|
-- The regular function captures the variants for nouns ending with
|
||||||
|
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
||||||
|
-- "fly - flies" (but "toy - toys"),
|
||||||
|
|
||||||
|
regN : Str -> N ;
|
||||||
|
|
||||||
-- In practice the worst case is just: give singular and plural nominative.
|
-- In practice the worst case is just: give singular and plural nominative.
|
||||||
|
|
||||||
oper
|
mk2N : (man,men : Str) -> N ;
|
||||||
mkN : (man,men,man's,men's : Str) -> Gender -> N ;
|
|
||||||
nMan : (man,men : Str) -> Gender -> N ;
|
|
||||||
|
|
||||||
-- Regular nouns, nouns ending with "s", "y", or "o", and nouns with the same
|
-- All nouns created by the previous functions are marked as
|
||||||
-- plural form as the singular.
|
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
|
||||||
|
-- function:
|
||||||
|
|
||||||
nReg : Str -> Gender -> N ; -- dog, dogs
|
genderN : Gender -> N -> N ;
|
||||||
nKiss : Str -> Gender -> N ; -- kiss, kisses
|
|
||||||
nFly : Str -> Gender -> N ; -- fly, flies
|
|
||||||
nHero : Str -> Gender -> N ; -- hero, heroes (= nKiss !)
|
|
||||||
nSheep : Str -> Gender -> N ; -- sheep, sheep
|
|
||||||
|
|
||||||
-- These use general heuristics, that recognizes the last letter. *N.B* it
|
--3 Compound nouns
|
||||||
-- does not get right with "boy", "rush", since it only looks at one letter.
|
--
|
||||||
|
-- All the functions above work quite as well to form compound nouns,
|
||||||
|
-- such as "baby boom".
|
||||||
|
|
||||||
nHuman : Str -> N ; -- gambler/actress/nanny
|
|
||||||
nNonhuman : Str -> N ; -- dog/kiss/fly
|
|
||||||
|
|
||||||
-- Nouns used as functions need a preposition. The most common is "of".
|
--3 Relational nouns
|
||||||
|
--
|
||||||
|
-- Relational nouns ("daughter of x") need a preposition.
|
||||||
|
|
||||||
mkN2 : N -> Preposition -> N2 ;
|
mkN2 : N -> Preposition -> N2 ;
|
||||||
|
|
||||||
funHuman : Str -> N2 ; -- the father/mistress/daddy of
|
-- The most common preposition is "of", and the following is a
|
||||||
funNonhuman : Str -> N2 ; -- the successor/address/copy of
|
-- shortcut for regular, $nonhuman$ relational nouns with "of".
|
||||||
|
|
||||||
-- Proper names, with their regular genitive.
|
regN2 : Str -> N2 ;
|
||||||
|
|
||||||
pnReg : (John : Str) -> PN ; -- John, John's
|
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
||||||
|
-- form other prepositions.
|
||||||
|
--
|
||||||
|
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||||
|
|
||||||
-- The most common cases on the higher-level category $CN$ have shortcuts.
|
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||||
-- The regular "y"/"s" variation is taken into account.
|
|
||||||
|
|
||||||
cnNonhuman : Str -> CN ;
|
|
||||||
cnHuman : Str -> CN ;
|
|
||||||
npReg : Str -> NP ;
|
|
||||||
|
|
||||||
-- In some cases, you may want to make a complex $CN$ into a function.
|
--3 Relational common noun phrases
|
||||||
|
--
|
||||||
|
-- In some cases, you may want to make a complex $CN$ into a
|
||||||
|
-- relational noun (e.g. "the old town hall of").
|
||||||
|
|
||||||
mkN2CN : CN -> Preposition -> N2 ;
|
cnN2 : CN -> Preposition -> N2 ;
|
||||||
funOfCN : CN -> N2 ;
|
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
||||||
|
|
||||||
|
--
|
||||||
|
--3 Proper names and noun phrases
|
||||||
|
--
|
||||||
|
-- Proper names, with a regular genitive, are formed as follows
|
||||||
|
|
||||||
|
regPN : Str -> Gender -> PN ; -- John, John's
|
||||||
|
|
||||||
|
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||||
|
|
||||||
|
nounPN : N -> PN ;
|
||||||
|
|
||||||
|
-- To form a noun phrase that can also be plural and have an irregular
|
||||||
|
-- genitive, you can use the worst-case function.
|
||||||
|
|
||||||
|
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
|
|
||||||
-- Non-comparison one-place adjectives just have one form.
|
-- Non-comparison one-place adjectives need two forms: one for
|
||||||
|
-- the adjectival and one for the adverbial form ("free - freely")
|
||||||
|
|
||||||
mkA : (even : Str) -> A ;
|
mkA : (free,freely : Str) -> A ;
|
||||||
|
|
||||||
-- Two-place adjectives need a preposition as second argument.
|
-- For regular adjectives, the adverbial form is derived. This holds
|
||||||
|
-- even for cases with the variation "happy - happily".
|
||||||
|
|
||||||
mkA2 : (divisible, by : Str) -> A2 ;
|
regA : Str -> A ;
|
||||||
|
|
||||||
-- Comparison adjectives have three forms. The common irregular
|
--3 Two-place adjectives
|
||||||
-- cases are ones ending with "y" and a consonant that is duplicated;
|
--
|
||||||
-- the "y" ending is recognized by the function $aReg$.
|
-- Two-place adjectives need a preposition for their second argument.
|
||||||
|
|
||||||
mkADeg : (good,better,best : Str) -> ADeg ;
|
mkA2 : A -> Preposition -> A2 ;
|
||||||
|
|
||||||
aReg : (long : Str) -> ADeg ; -- long, longer, longest
|
-- Comparison adjectives may two more forms.
|
||||||
aFat : (fat : Str) -> ADeg ; -- fat, fatter, fattest
|
|
||||||
aRidiculous : (ridiculous : Str) -> ADeg ; -- -/more/most ridiculous
|
|
||||||
|
|
||||||
-- On higher level, there are adjectival phrases. The most common case is
|
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||||
-- just to use a one-place adjective.
|
|
||||||
|
-- The regular pattern recognizes two common variations:
|
||||||
|
-- "-e" ("rude" - "ruder" - "rudest") and
|
||||||
|
-- "-y" ("happy - happier - happiest - happily")
|
||||||
|
|
||||||
|
regADeg : Str -> ADeg ; -- long, longer, longest
|
||||||
|
|
||||||
|
-- However, the duplication of the final consonant is nor predicted,
|
||||||
|
-- but a separate pattern is used:
|
||||||
|
|
||||||
|
duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||||
|
|
||||||
|
-- If comparison is formed by "more, "most", as in general for
|
||||||
|
-- long adjective, the following pattern is used:
|
||||||
|
|
||||||
|
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||||
|
|
||||||
|
-- From a given $ADeg$, it is possible to get back to $A$.
|
||||||
|
|
||||||
|
adegA : ADeg -> A ;
|
||||||
|
|
||||||
apReg : Str -> AP ;
|
|
||||||
|
|
||||||
--2 Adverbs
|
--2 Adverbs
|
||||||
|
|
||||||
-- Adverbs are not inflected. Most lexical ones have position not
|
-- Adverbs are not inflected. Most lexical ones have position
|
||||||
-- before the verb. Some can be preverbal (e.g. "always").
|
-- after the verb. Some can be preverbal (e.g. "always").
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
mkAdv : Str -> Adv ;
|
||||||
mkAdvPre : Str -> Adv ;
|
mkAdV : Str -> AdV ;
|
||||||
|
|
||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
mkAdA : Str -> AdA ;
|
||||||
mkAdC : Str -> AdC ;
|
|
||||||
|
|
||||||
-- Prepositional phrases are another productive form of adverbials.
|
--2 Prepositions
|
||||||
|
--
|
||||||
|
-- A preposition is just a string.
|
||||||
|
|
||||||
mkPP : Str -> NP -> Adv ;
|
mkPreposition : Str -> Preposition ;
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
-- The fragment now has all verb forms, except the gerund/present participle.
|
-- Except for "be", the worst case needs five forms: the infinitive and
|
||||||
-- Except for "be", the worst case needs four forms: the infinitive and
|
-- the third person singular present, the past indicative, and the
|
||||||
-- the third person singular present, the past indicative, and the past participle.
|
-- past and present participles.
|
||||||
|
|
||||||
mkV : (go, goes, went, gone : Str) -> V ;
|
mkV : (go, goes, went, gone, going : Str) -> V ;
|
||||||
|
|
||||||
vReg : (walk : Str) -> V ; -- walk, walks
|
-- The regular verb function recognizes the special cases where the last
|
||||||
vKiss : (kiss : Str) -> V ; -- kiss, kisses
|
-- character is "y" ("cry - cries" but "buy - buys") or "s", "sh", "x", "z"
|
||||||
vFly : (fly : Str) -> V ; -- fly, flies
|
-- ("fix - fixes", etc).
|
||||||
vGo : (go : Str) -> V ; -- go, goes (= vKiss !)
|
|
||||||
|
|
||||||
-- This generic function recognizes the special cases where the last
|
regV : Str -> V ;
|
||||||
-- character is "y", "s", or "z". It is not right for "finish" and "convey".
|
|
||||||
|
|
||||||
vGen : Str -> V ; -- walk/kiss/fly
|
-- The following variant duplicates the last letter in the forms like
|
||||||
|
-- "rip - ripped - ripping".
|
||||||
|
|
||||||
-- The verbs "be" and "have" are special.
|
regDuplV : Str -> V ;
|
||||||
|
|
||||||
vBe : V ;
|
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
||||||
vHave : V ;
|
-- In practice, it is enough to give three forms,
|
||||||
|
-- e.g. "drink - drank - drunk", with a variant indicating consonant
|
||||||
|
-- duplication in the present participle.
|
||||||
|
|
||||||
-- Verbs with a particle.
|
irregV : (drink, drank, drunk : Str) -> V ;
|
||||||
|
irregDuplV : (get, got, gotten : Str) -> V ;
|
||||||
|
|
||||||
vPart : (go, goes, went, gone, up : Str) -> V ;
|
|
||||||
vPartReg : (get, up : Str) -> V ;
|
|
||||||
|
|
||||||
-- Two-place verbs, and the special case with direct object.
|
--3 Verbs with a particle.
|
||||||
-- Notice that a particle can already be included in $V$.
|
--
|
||||||
|
-- The particle, such as in "switch on", is given as a string.
|
||||||
|
|
||||||
mkV2 : V -> Str -> V2 ; -- look for, kill
|
partV : V -> Str -> V ;
|
||||||
|
|
||||||
tvGen : (look, for : Str) -> V2 ; -- look for, talk about
|
--3 Two-place verbs
|
||||||
tvDir : V -> V2 ; -- switch off
|
--
|
||||||
tvGenDir : (kill : Str) -> V2 ; -- kill
|
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||||
|
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||||
|
|
||||||
-- Regular two-place verbs with a particle.
|
mkV2 : V -> Preposition -> V2 ;
|
||||||
|
|
||||||
tvPartReg : Str -> Str -> Str -> V2 ; -- get, along, with
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
-- Ditransitive verbs.
|
--3 Three-place verbs
|
||||||
|
--
|
||||||
|
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||||
|
-- the first one or both can be absent.
|
||||||
|
|
||||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||||
v3Dir : V -> Str -> V3 ; -- give,_,to
|
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||||
v3DirDir : V -> V3 ; -- give,_,_
|
dirdirV3 : V -> V3 ; -- give,_,_
|
||||||
|
|
||||||
|
--3 Other complement patterns
|
||||||
|
--
|
||||||
|
-- Verbs and adjectives can take complements such as sentences,
|
||||||
|
-- questions, verb phrases, and adjectives.
|
||||||
|
|
||||||
|
mkV0 : V -> V0 ;
|
||||||
|
mkVS : V -> VS ;
|
||||||
|
mkV2S : V -> Str -> V2S ;
|
||||||
|
mkVV : V -> VV ;
|
||||||
|
mkV2V : V -> Str -> Str -> V2V ;
|
||||||
|
mkVA : V -> VA ;
|
||||||
|
mkV2A : V -> Str -> V2A ;
|
||||||
|
mkVQ : V -> VQ ;
|
||||||
|
mkV2Q : V -> Str -> V2Q ;
|
||||||
|
|
||||||
|
mkAS : A -> AS ;
|
||||||
|
mkA2S : A -> Str -> A2S ;
|
||||||
|
mkAV : A -> AV ;
|
||||||
|
mkA2V : A -> Str -> A2V ;
|
||||||
|
|
||||||
|
|
||||||
|
--2 Definitions of paradigms
|
||||||
|
--
|
||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
-- hidden from the document.
|
-- hidden from the document.
|
||||||
--.
|
--.
|
||||||
@@ -190,112 +275,144 @@ oper
|
|||||||
Case = SyntaxEng.Case ;
|
Case = SyntaxEng.Case ;
|
||||||
human = Masc ;
|
human = Masc ;
|
||||||
nonhuman = Neutr ;
|
nonhuman = Neutr ;
|
||||||
|
masculine = Masc ;
|
||||||
|
feminine = Fem ;
|
||||||
singular = Sg ;
|
singular = Sg ;
|
||||||
plural = Pl ;
|
plural = Pl ;
|
||||||
|
|
||||||
nominative = Nom ;
|
nominative = Nom ;
|
||||||
genitive = Nom ;
|
genitive = Gen ;
|
||||||
|
|
||||||
mkN = \man,men,man's,men's,g ->
|
regN = \ray ->
|
||||||
mkNoun man men man's men's ** {g = g ; lock_N = <>} ;
|
let
|
||||||
nReg a g = addGenN nounReg a g ;
|
ra = Predef.tk 1 ray ;
|
||||||
nKiss n g = addGenN nounS n g ;
|
y = Predef.dp 1 ray ;
|
||||||
nFly = \fly -> addGenN nounY (Predef.tk 1 fly) ;
|
r = Predef.tk 2 ray ;
|
||||||
nMan = \man,men -> mkN man men (man + "'s") (men + "'s") ;
|
ay = Predef.dp 2 ray ;
|
||||||
nHero = nKiss ;
|
rays =
|
||||||
nSheep = \sheep -> nMan sheep sheep ;
|
case y of {
|
||||||
|
"y" => y2ie ray "s" ;
|
||||||
|
"s" => ray + "es" ;
|
||||||
|
"z" => ray + "es" ;
|
||||||
|
"x" => ray + "es" ;
|
||||||
|
_ => case ay of {
|
||||||
|
"sh" => ray + "es" ;
|
||||||
|
"ch" => ray + "es" ;
|
||||||
|
_ => ray + "s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in
|
||||||
|
mk2N ray rays ;
|
||||||
|
|
||||||
nHuman = \s -> nGen s human ;
|
mk2N = \man,men ->
|
||||||
nNonhuman = \s -> nGen s nonhuman ;
|
let mens = case last men of {
|
||||||
|
"s" => men + "'" ;
|
||||||
|
_ => men + "'s"
|
||||||
|
}
|
||||||
|
in
|
||||||
|
mkN man men (man + "'s") mens ;
|
||||||
|
|
||||||
nGen : Str -> Gender -> N = \fly,g -> let {
|
mkN = \man,men,man's,men's ->
|
||||||
fl = Predef.tk 1 fly ;
|
mkNoun man men man's men's ** {g = Neutr ; lock_N = <>} ;
|
||||||
y = Predef.dp 1 fly ;
|
|
||||||
eqy = ifTok (Str -> Gender -> N) y
|
|
||||||
} in
|
|
||||||
eqy "y" nFly (
|
|
||||||
eqy "s" nKiss (
|
|
||||||
eqy "z" nKiss (
|
|
||||||
nReg))) fly g ;
|
|
||||||
|
|
||||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
||||||
funNonhuman = \s -> mkN2 (nNonhuman s) "of" ;
|
|
||||||
funHuman = \s -> mkN2 (nHuman s) "of" ;
|
|
||||||
|
|
||||||
pnReg n = nameReg n human ** {lock_PN = <>} ;
|
mkN2 = \n,p -> UseN n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
regN2 n = mkN2 (regN n) (mkPreposition "of") ;
|
||||||
|
mkN3 = \n,p,q -> UseN n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
||||||
|
cnN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
||||||
|
|
||||||
cnNonhuman = \s -> UseN (nGen s nonhuman) ;
|
regPN n g = nameReg n g ** {lock_PN = <>} ;
|
||||||
cnHuman = \s -> UseN (nGen s human) ;
|
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||||
npReg = \s -> UsePN (pnReg s) ;
|
mkNP x y n g = {s = table {GenP => x ; _ => y} ; a = toAgr n P3 g ;
|
||||||
|
lock_NP = <>} ;
|
||||||
|
|
||||||
mkN2CN = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
mkA a b = mkAdjective a b ** {lock_A = <>} ;
|
||||||
funOfCN = \n -> mkN2CN n "of" ;
|
regA a = regAdjective a ** {lock_A = <>} ;
|
||||||
|
|
||||||
addGenN : (Str -> CommonNoun) -> Str -> Gender -> N = \f ->
|
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
||||||
\s,g -> f s ** {g = g ; lock_N = <>} ;
|
|
||||||
|
|
||||||
mkA a = regAdjective a ** {lock_A = <>} ;
|
mkADeg a b c d = mkAdjDegrWorst a b c c d d ** {lock_ADeg = <>} ;
|
||||||
mkA2 = \s,p -> regAdjective s ** {s2 = p} ** {lock_A2 = <>} ;
|
|
||||||
mkADeg a b c = adjDegrIrreg a b c ** {lock_ADeg = <>} ;
|
|
||||||
aReg a = adjDegrReg a ** {lock_ADeg = <>} ;
|
|
||||||
aFat = \fat -> let {fatt = fat + Predef.dp 1 fat} in
|
|
||||||
mkADeg fat (fatt + "er") (fatt + "est") ;
|
|
||||||
aRidiculous a = adjDegrLong a ** {lock_ADeg = <>} ;
|
|
||||||
apReg = \s -> UseA (mkA s) ;
|
|
||||||
|
|
||||||
aGen : Str -> ADeg = \s -> case last s of {
|
regADeg happy =
|
||||||
"y" => mkADeg s (init s + "ier") (init s + "iest") ;
|
let
|
||||||
"e" => mkADeg s (s + "r") (s + "st") ;
|
happ = init happy ;
|
||||||
_ => aReg s
|
y = last happy ;
|
||||||
|
happie = case y of {
|
||||||
|
"y" => happ + "ie" ;
|
||||||
|
"e" => happy ;
|
||||||
|
_ => happy + "e"
|
||||||
} ;
|
} ;
|
||||||
|
happily = case y of {
|
||||||
|
"y" => happ + "ily" ;
|
||||||
|
_ => happy + "ly"
|
||||||
|
} ;
|
||||||
|
in mkADeg happy happily (happie + "r") (happie + "st") ;
|
||||||
|
|
||||||
mkAdv a = ss a ** {lock_Adv = <>} ;
|
duplADeg fat = mkADeg fat
|
||||||
mkAdvPre a = ss a ** {lock_Adv = <>} ;
|
(fat + "ly") (fat + last fat + "er") (fat + last fat + "est") ;
|
||||||
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
compoundADeg a = let ad = (a.s ! AAdj) in
|
||||||
mkAdA a = ss a ** {lock_AdA = <>} ;
|
mkADeg ad (a.s ! AAdv) ("more" ++ ad) ("most" ++ ad) ;
|
||||||
mkAdC a = ss a ** {lock_AdC = <>} ;
|
adegA a = {s = a.s ! Pos ; lock_A = <>} ;
|
||||||
|
|
||||||
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||||
{lock_V = <>} ;
|
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||||
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
|
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||||
vKiss = \kiss -> mkV kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
|
||||||
vFly = \cry -> let {cr = Predef.tk 1 cry} in
|
|
||||||
mkV cry (cr + "ies") (cr + "ied") (cr + "ied") ;
|
|
||||||
vGo = vKiss ;
|
|
||||||
|
|
||||||
vGen = \fly -> let {
|
mkPreposition p = p ;
|
||||||
fl = Predef.tk 1 fly ;
|
|
||||||
y = Predef.dp 1 fly ;
|
|
||||||
eqy = ifTok (Str -> V) y
|
|
||||||
} in
|
|
||||||
eqy "y" vFly (
|
|
||||||
eqy "s" vKiss (
|
|
||||||
eqy "z" vKiss (
|
|
||||||
vReg))) fly ;
|
|
||||||
|
|
||||||
vPart = \go, goes, went, gone, up ->
|
mkV a b c d e = mkVerbP3worst a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||||
verbPart (mkVerbP3 go goes went gone) up ** {lock_V = <>} ;
|
|
||||||
vPartReg = \get, up ->
|
|
||||||
verbPart (vGen get) up ** {lock_V = <>} ;
|
|
||||||
|
|
||||||
mkV2 = \v,p -> v ** {lock_V2 = <> ; s3 = p} ;
|
regV cry =
|
||||||
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
let
|
||||||
|
cr = init cry ;
|
||||||
|
y = last cry ;
|
||||||
|
cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||||
|
crie = init cries ;
|
||||||
|
cried = case last crie of {
|
||||||
|
"e" => crie + "d" ;
|
||||||
|
_ => crie + "ed"
|
||||||
|
} ;
|
||||||
|
crying = case y of {
|
||||||
|
"e" => cr + "ing" ;
|
||||||
|
_ => cry + "ing"
|
||||||
|
}
|
||||||
|
in mkV cry cries cried cried crying ;
|
||||||
|
|
||||||
vBe = verbBe ** {s1 = [] ; lock_V = <>} ;
|
regDuplV fit =
|
||||||
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
let fitt = fit + last fit in
|
||||||
|
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
||||||
|
|
||||||
tvGen = \s,p -> mkV2 (vGen s) p ;
|
irregV x y z = mkVerbIrreg x y z ** {s1 = [] ; lock_V = <>} ;
|
||||||
tvDir = \v -> mkV2 v [] ;
|
|
||||||
tvGenDir = \s -> tvDir (vGen s) ;
|
|
||||||
|
|
||||||
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
irregDuplV fit y z =
|
||||||
v3Dir x y = mkV3 x [] y ;
|
let
|
||||||
v3DirDir x = v3Dir x [] ;
|
fitting = (regDuplV fit).s ! PresPart
|
||||||
|
in
|
||||||
|
mkV fit (fit + "s") y z fitting ;
|
||||||
|
|
||||||
-- these are used in the generated lexicon
|
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
||||||
noun : Str -> N = nNonhuman ;
|
|
||||||
|
|
||||||
verb2 : Str -> Str -> V2 = \v -> mkV2 (vGen v) ;
|
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; lock_V2 = <>} ;
|
||||||
verb3 : Str -> Str -> Str -> V3 = \v -> mkV3 (vGen v) ;
|
dirV2 v = mkV2 v [] ;
|
||||||
|
|
||||||
|
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; s4 = q ; lock_V3 = <>} ;
|
||||||
|
dirV3 v p = mkV3 v [] p ;
|
||||||
|
dirdirV3 v = dirV3 v [] ;
|
||||||
|
|
||||||
|
mkV0 v = v ** {lock_V0 = <>} ;
|
||||||
|
mkVS v = v ** {lock_VS = <>} ;
|
||||||
|
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
||||||
|
mkVV v = v ** {isAux = False ; lock_VV = <>} ;
|
||||||
|
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
||||||
|
mkVA v = v ** {lock_VA = <>} ;
|
||||||
|
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||||
|
mkVQ v = v ** {lock_VQ = <>} ;
|
||||||
|
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
||||||
|
|
||||||
|
mkAS v = v ** {lock_AS = <>} ;
|
||||||
|
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||||
|
mkAV v = v ** {lock_AV = <>} ;
|
||||||
|
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ flags
|
|||||||
lexer=text ;
|
lexer=text ;
|
||||||
unlexer=text ;
|
unlexer=text ;
|
||||||
|
|
||||||
|
optimize=all ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
UseN = noun2CommNounPhrase ;
|
UseN = noun2CommNounPhrase ;
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
@@ -44,6 +46,8 @@ lin
|
|||||||
DefNumNP = defNounPhraseNum plural ;
|
DefNumNP = defNounPhraseNum plural ;
|
||||||
|
|
||||||
DetNP = detNounPhrase ;
|
DetNP = detNounPhrase ;
|
||||||
|
NDetNP = numDetNounPhrase ;
|
||||||
|
NDetNum = justNumDetNounPhrase ;
|
||||||
MassNP = detNounPhrase (mkDeterminer Sg []) ;
|
MassNP = detNounPhrase (mkDeterminer Sg []) ;
|
||||||
|
|
||||||
AppN2 = appFunComm ;
|
AppN2 = appFunComm ;
|
||||||
@@ -109,6 +113,8 @@ lin
|
|||||||
PrepNP p = prepPhrase p.s ; ---
|
PrepNP p = prepPhrase p.s ; ---
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
AdvAP = advAdjPhrase ;
|
AdvAP = advAdjPhrase ;
|
||||||
|
AdvAdv = cc2 ;
|
||||||
|
|
||||||
|
|
||||||
--3 Sentences and relative clauses
|
--3 Sentences and relative clauses
|
||||||
--
|
--
|
||||||
@@ -126,13 +132,8 @@ lin
|
|||||||
--3 Questions and imperatives
|
--3 Questions and imperatives
|
||||||
--
|
--
|
||||||
|
|
||||||
WhoOne = intPronWho singular ;
|
IDetCN d n = nounPhraseInt (detNounPhrase d n) ;
|
||||||
WhoMany = intPronWho plural ;
|
|
||||||
WhatOne = intPronWhat singular ;
|
|
||||||
WhatMany = intPronWhat plural ;
|
|
||||||
FunIP = funIntPron ;
|
FunIP = funIntPron ;
|
||||||
NounIPOne = nounIntPron singular ;
|
|
||||||
NounIPMany = nounIntPron plural ;
|
|
||||||
|
|
||||||
QuestCl = questClause ;
|
QuestCl = questClause ;
|
||||||
IntSlash = intSlash ;
|
IntSlash = intSlash ;
|
||||||
@@ -147,6 +148,9 @@ lin
|
|||||||
ImperMany = imperUtterance plural ;
|
ImperMany = imperUtterance plural ;
|
||||||
|
|
||||||
AdvCl = advClause ;
|
AdvCl = advClause ;
|
||||||
|
AdvVP = advVerbPhrase ;
|
||||||
|
|
||||||
|
AdCPhr = advSentence ;
|
||||||
AdvPhr = advSentence ;
|
AdvPhr = advSentence ;
|
||||||
|
|
||||||
|
|
||||||
@@ -169,6 +173,11 @@ lin
|
|||||||
ConjNP = conjunctNounPhrase ;
|
ConjNP = conjunctNounPhrase ;
|
||||||
ConjDNP = conjunctDistrNounPhrase ;
|
ConjDNP = conjunctDistrNounPhrase ;
|
||||||
|
|
||||||
|
TwoAdv = twoSentence ;
|
||||||
|
ConsAdv = consSentence ;
|
||||||
|
ConjAdv = conjunctSentence ;
|
||||||
|
ConjDAdv = conjunctDistrSentence ;
|
||||||
|
|
||||||
SubjS = subjunctSentence ;
|
SubjS = subjunctSentence ;
|
||||||
SubjImper = subjunctImperative ;
|
SubjImper = subjunctImperative ;
|
||||||
SubjQS = subjunctQuestion ;
|
SubjQS = subjunctQuestion ;
|
||||||
|
|||||||
@@ -6,106 +6,95 @@
|
|||||||
--
|
--
|
||||||
concrete StructuralEng of Structural =
|
concrete StructuralEng of Structural =
|
||||||
CategoriesEng, NumeralsEng ** open Prelude, SyntaxEng in {
|
CategoriesEng, NumeralsEng ** open Prelude, SyntaxEng in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
INP = pronNounPhrase pronI ;
|
|
||||||
ThouNP = pronNounPhrase pronYouSg ;
|
|
||||||
HeNP = pronNounPhrase pronHe ;
|
|
||||||
SheNP = pronNounPhrase pronShe ;
|
|
||||||
ItNP = pronNounPhrase pronIt ;
|
|
||||||
WeNumNP n = pronNounPhrase (pronWithNum pronWe n) ;
|
|
||||||
YeNumNP n = pronNounPhrase (pronWithNum pronYouPl n) ;
|
|
||||||
YouNP = pronNounPhrase pronYouSg ;
|
|
||||||
TheyNP = pronNounPhrase pronThey ;
|
|
||||||
TheyFemNP = pronNounPhrase pronThey ;
|
|
||||||
|
|
||||||
EveryDet = everyDet ;
|
|
||||||
AllMassDet = mkDeterminer Sg "all" ; --- all the missing
|
|
||||||
AllNumDet = mkDeterminerNum Pl "all" ;
|
|
||||||
WhichDet = whichDet ;
|
|
||||||
WhichNumDet = mkDeterminerNum Pl "which" ;
|
|
||||||
|
|
||||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
||||||
|
|
||||||
MostsDet = mostDet ;
|
|
||||||
MostDet = mkDeterminer Sg "most" ;
|
|
||||||
SomeDet = mkDeterminer Sg "some" ;
|
|
||||||
SomeNumDet = mkDeterminerNum Pl "some" ;
|
|
||||||
AnyDet = mkDeterminer Sg "any" ;
|
|
||||||
AnyNumDet = mkDeterminerNum Pl "any" ;
|
|
||||||
NoDet = mkDeterminer Sg "no" ;
|
|
||||||
NoNumDet = mkDeterminerNum Pl "no" ;
|
|
||||||
ManyDet = mkDeterminer Pl "many" ;
|
|
||||||
HowManyDet = mkDeterminer Pl ["how many"] ;
|
|
||||||
MuchDet = mkDeterminer Sg ["a lot of"] ; ---
|
|
||||||
ThisDet = mkDeterminer Sg "this" ;
|
|
||||||
TheseNumDet = mkDeterminerNum Pl "these" ;
|
|
||||||
ThatDet = mkDeterminer Sg "that" ;
|
|
||||||
ThoseNumDet = mkDeterminerNum Pl "those" ;
|
|
||||||
|
|
||||||
ThisNP = nameNounPhrase (nameReg "this" Neutr) ;
|
above_Prep = ss "above" ;
|
||||||
ThatNP = nameNounPhrase (nameReg "that" Neutr) ;
|
after_Prep = ss "after" ;
|
||||||
TheseNumNP n = nameNounPhrasePl {s = \\c => "these" ++ n.s ! c ; g =
|
all8mass_Det = mkDeterminer Sg "all" ; --- all the missing
|
||||||
Neutr} ;
|
all_NDet = mkDeterminerNum "all" ;
|
||||||
ThoseNumNP n = nameNounPhrasePl {s = \\c => "those" ++ n.s ! c ; g =
|
almost_Adv = ss "almost" ;
|
||||||
Neutr} ;
|
although_Subj = ss "although" ;
|
||||||
|
and_Conj = ss "and" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "because" ;
|
||||||
|
before_Prep = ss "before" ;
|
||||||
|
behind_Prep = ss "behind" ;
|
||||||
|
between_Prep = ss "between" ;
|
||||||
|
both_AndConjD = sd2 "both" "and" ** {n = Pl} ;
|
||||||
|
by8agent_Prep = ss "by" ;
|
||||||
|
by8means_Prep = ss "by" ;
|
||||||
|
can8know_VV = vvCan ;
|
||||||
|
can_VV = vvCan ;
|
||||||
|
during_Prep = ss "during" ;
|
||||||
|
either8or_ConjD = sd2 "either" "or" ** {n = Sg} ;
|
||||||
|
everybody_NP = nameNounPhrase (nameReg "everybody" human) ;
|
||||||
|
every_Det = everyDet ;
|
||||||
|
everything_NP = nameNounPhrase (nameReg "everything" Neutr) ;
|
||||||
|
everywhere_Adv = ss "everywhere" ;
|
||||||
|
from_Prep = ss "from" ;
|
||||||
|
he_NP = pronNounPhrase pronHe ;
|
||||||
|
how_IAdv = ss "how" ;
|
||||||
|
how8many_IDet = mkDeterminer Pl ["how many"] ;
|
||||||
|
if_Subj = ss "if" ;
|
||||||
|
in8front_Prep = ss ["in front of"] ;
|
||||||
|
i_NP = pronNounPhrase pronI ;
|
||||||
|
in_Prep = ss "in" ;
|
||||||
|
it_NP = pronNounPhrase pronIt ;
|
||||||
|
many_Det = mkDeterminer Pl "many" ;
|
||||||
|
most_Det = mkDeterminer Sg "most" ;
|
||||||
|
most8many_Det = mostDet ;
|
||||||
|
much_Det = mkDeterminer Sg ["a lot of"] ; ---
|
||||||
|
must_VV = vvMust ;
|
||||||
|
|
||||||
EverybodyNP = nameNounPhrase (nameReg "everybody" human) ;
|
no_Phr = ss "No." ;
|
||||||
SomebodyNP = nameNounPhrase (nameReg "somebody" human) ;
|
on_Prep = ss "on" ;
|
||||||
NobodyNP = nameNounPhrase (nameReg "nobody" human) ;
|
or_Conj = ss "or" ** {n = Sg} ;
|
||||||
EverythingNP = nameNounPhrase (nameReg "everything" Neutr) ;
|
otherwise_Adv = ss "otherwise" ;
|
||||||
SomethingNP = nameNounPhrase (nameReg "something" Neutr) ;
|
part_Prep = ss "of" ;
|
||||||
NothingNP = nameNounPhrase (nameReg "nothing" Neutr) ;
|
possess_Prep = ss "of" ;
|
||||||
|
quite_Adv = ss "quite" ;
|
||||||
CanVV = vvCan ;
|
she_NP = pronNounPhrase pronShe ;
|
||||||
CanKnowVV = vvCan ;
|
so_Adv = ss "so" ;
|
||||||
MustVV = vvMust ;
|
somebody_NP = nameNounPhrase (nameReg "somebody" human) ;
|
||||||
WantVV = verbNoPart (regVerbP3 "want") ** {isAux = False} ;
|
some_Det = mkDeterminer Sg "some" ;
|
||||||
|
some_NDet = mkDeterminerNum "some" ;
|
||||||
HowIAdv = ss "how" ;
|
something_NP = nameNounPhrase (nameReg "something" Neutr) ;
|
||||||
WhenIAdv = ss "when" ;
|
somewhere_Adv = ss "somewhere" ;
|
||||||
WhereIAdv = ss "where" ;
|
that_Det = mkDeterminer Sg "that" ;
|
||||||
WhyIAdv = ss "why" ;
|
that_NP = nameNounPhrase (nameReg "that" Neutr) ;
|
||||||
EverywhereNP = ss "everywhere" ;
|
therefore_Adv = ss "therefore" ;
|
||||||
SomewhereNP = ss "somewhere" ;
|
these_NDet = mkDeterminerNum "these" ;
|
||||||
NowhereNP = ss "nowhere" ;
|
they8fem_NP = pronNounPhrase pronThey ;
|
||||||
|
they_NP = pronNounPhrase pronThey ;
|
||||||
AndConj = ss "and" ** {n = Pl} ;
|
this_Det = mkDeterminer Sg "this" ;
|
||||||
OrConj = ss "or" ** {n = Sg} ;
|
this_NP = nameNounPhrase (nameReg "this" Neutr) ;
|
||||||
BothAnd = sd2 "both" "and" ** {n = Pl} ;
|
those_NDet = mkDeterminerNum "those" ;
|
||||||
EitherOr = sd2 "either" "or" ** {n = Sg} ;
|
thou_NP = pronNounPhrase pronYouSg ;
|
||||||
NeitherNor = sd2 "neither" "nor" ** {n = Sg} ;
|
through_Prep = ss "through" ;
|
||||||
IfSubj = ss "if" ;
|
too_Adv = ss "too" ;
|
||||||
WhenSubj = ss "when" ;
|
to_Prep = ss "to" ;
|
||||||
AlthoughSubj = ss "although" ;
|
under_Prep = ss "under" ;
|
||||||
|
very_Adv = ss "very" ;
|
||||||
PhrYes = ss "Yes." ;
|
want_VV = verbNoPart (regVerbP3 "want") ** {isAux = False} ;
|
||||||
PhrNo = ss "No." ;
|
we_NP = pronNounPhrase pronWe ;
|
||||||
|
what8many_IP = intPronWhat plural ;
|
||||||
VeryAdv = ss "very" ;
|
what8one_IP = intPronWhat singular ;
|
||||||
TooAdv = ss "too" ;
|
when_IAdv = ss "when" ;
|
||||||
AlmostAdv = ss "almost" ;
|
when_Subj = ss "when" ;
|
||||||
QuiteAdv = ss "quite" ;
|
where_IAdv = ss "where" ;
|
||||||
OtherwiseAdv = ss "otherwise" ;
|
which8many_IDet = mkDeterminer Pl ["which"] ;
|
||||||
ThereforeAdv = ss "therefore" ;
|
which8one_IDet = mkDeterminer Sg ["which"] ;
|
||||||
|
who8many_IP = intPronWho plural ;
|
||||||
InPrep = ss "in" ;
|
who8one_IP = intPronWho singular ;
|
||||||
OnPrep = ss "on" ;
|
why_IAdv = ss "why" ;
|
||||||
ToPrep = ss "to" ;
|
without_Prep = ss "without" ;
|
||||||
ThroughPrep = ss "through" ;
|
with_Prep = ss "with" ;
|
||||||
AbovePrep = ss "above" ;
|
ye_NP = pronNounPhrase pronYouPl ;
|
||||||
UnderPrep = ss "under" ;
|
you_NP = pronNounPhrase pronYouSg ;
|
||||||
InFrontPrep = ss ["in front of"] ;
|
yes_Phr = ss "Yes." ;
|
||||||
BehindPrep = ss "behind" ;
|
|
||||||
BetweenPrep = ss "between" ;
|
|
||||||
FromPrep = ss "from" ;
|
|
||||||
BeforePrep = ss "before" ;
|
|
||||||
DuringPrep = ss "during" ;
|
|
||||||
AfterPrep = ss "after" ;
|
|
||||||
WithPrep = ss "with" ;
|
|
||||||
WithoutPrep = ss "without" ;
|
|
||||||
ByMeansPrep = ss "by" ;
|
|
||||||
PossessPrep = ss "of" ;
|
|
||||||
PartPrep = ss "of" ;
|
|
||||||
AgentPrep = ss "by" ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
resource SyntaxEng = MorphoEng ** open Prelude, (CO = Coordination) in {
|
resource SyntaxEng = MorphoEng ** open Prelude, (CO = Coordination) in {
|
||||||
|
|
||||||
|
flags optimize=parametrize ;
|
||||||
|
|
||||||
--2 Common Nouns
|
--2 Common Nouns
|
||||||
--
|
--
|
||||||
-- Simple common nouns are defined as the type $CommNoun$ in $morpho.Deu.gf$.
|
-- Simple common nouns are defined as the type $CommNoun$ in $morpho.Deu.gf$.
|
||||||
@@ -90,32 +92,43 @@ oper
|
|||||||
-- The determiner is not inflected.
|
-- The determiner is not inflected.
|
||||||
|
|
||||||
Determiner : Type = {s : Str ; n : Number} ;
|
Determiner : Type = {s : Str ; n : Number} ;
|
||||||
|
DeterminerNum : Type = {s : Str} ;
|
||||||
|
|
||||||
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \every, man ->
|
detNounPhrase : Determiner -> CommNounPhrase -> NounPhrase = \every, man ->
|
||||||
{s = \\c => every.s ++ man.s ! every.n ! toCase c ;
|
{s = \\c => every.s ++ man.s ! every.n ! toCase c ;
|
||||||
a = toAgr every.n P3 man.g
|
a = toAgr every.n P3 man.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkDeterminer : Number -> Str -> Determiner = \n,the ->
|
numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase =
|
||||||
mkDeterminerNum n the noNum ;
|
\all, six, men ->
|
||||||
|
{s = \\c => all.s ++ six.s ! Nom ++ men.s ! Pl ! toCase c ;
|
||||||
|
a = toAgr Pl P3 men.g
|
||||||
|
} ;
|
||||||
|
justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase =
|
||||||
|
\all, six ->
|
||||||
|
{s = \\c => all.s ++ six.s ! toCase c ;
|
||||||
|
a = toAgr Pl P3 Neutr --- gender does not matter
|
||||||
|
} ;
|
||||||
|
|
||||||
mkDeterminerNum : Number -> Str -> Numeral -> Determiner = \n,det,two ->
|
mkDeterminer : Number -> Str -> Determiner = \n,the ->
|
||||||
{s = det ++ two.s ! Nom ;
|
{s = the ;
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkDeterminerNum : Str -> DeterminerNum = mkDeterminer Pl ;
|
||||||
|
|
||||||
everyDet = mkDeterminer Sg "every" ;
|
everyDet = mkDeterminer Sg "every" ;
|
||||||
allDet = mkDeterminerNum Pl "all" ;
|
allDet = mkDeterminerNum "all" ;
|
||||||
mostDet = mkDeterminer Pl "most" ;
|
mostDet = mkDeterminer Pl "most" ;
|
||||||
aDet = mkDeterminer Sg artIndef ;
|
aDet = mkDeterminer Sg artIndef ;
|
||||||
plDet = mkDeterminerNum Pl [] ;
|
plDet = mkDeterminerNum [] ;
|
||||||
theSgDet = mkDeterminer Sg "the" ;
|
theSgDet = mkDeterminer Sg "the" ;
|
||||||
thePlDet = mkDeterminerNum Pl "the" ;
|
thePlDet = mkDeterminerNum "the" ;
|
||||||
anySgDet = mkDeterminer Sg "any" ;
|
anySgDet = mkDeterminer Sg "any" ;
|
||||||
anyPlDet = mkDeterminerNum Pl "any" ;
|
anyPlDet = mkDeterminerNum "any" ;
|
||||||
|
|
||||||
whichSgDet = mkDeterminer Sg "which" ;
|
whichSgDet = mkDeterminer Sg "which" ;
|
||||||
whichPlDet = mkDeterminerNum Pl "which" ;
|
whichPlDet = mkDeterminerNum "which" ;
|
||||||
|
|
||||||
whichDet = whichSgDet ; --- API
|
whichDet = whichSgDet ; --- API
|
||||||
|
|
||||||
@@ -687,6 +700,12 @@ oper
|
|||||||
isAux = sings.isAux
|
isAux = sings.isAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
advVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \sing, well ->
|
||||||
|
{
|
||||||
|
s = \\b,a => sing.s ! b ! a ++ well.s ;
|
||||||
|
s1 = sing.s1
|
||||||
|
} ;
|
||||||
|
|
||||||
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \very, good ->
|
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \very, good ->
|
||||||
{s = \\a => very.s ++ good.s ! a ;
|
{s = \\a => very.s ++ good.s ! a ;
|
||||||
p = good.p
|
p = good.p
|
||||||
@@ -1164,6 +1183,9 @@ oper
|
|||||||
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences,
|
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences,
|
||||||
-- others that are line $S/NP - NP$ sentences.
|
-- others that are line $S/NP - NP$ sentences.
|
||||||
|
|
||||||
|
nounPhraseInt : NounPhrase -> IntPron = \who ->
|
||||||
|
{s = who.s} ** fromAgr who.a ;
|
||||||
|
|
||||||
intNounPhrase : IntPron -> NounPhrase = \who ->
|
intNounPhrase : IntPron -> NounPhrase = \who ->
|
||||||
{s = who.s ; a = toAgr who.n P3 who.g} ;
|
{s = who.s ; a = toAgr who.n P3 who.g} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--# -path=.:../abstract:../../prelude
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
concrete TestResourceEng of TestResource = RulesEng, ClauseEng, StructuralEng **
|
concrete TestResourceEng of TestResource = RulesEng, ClauseEng, StructuralEng **
|
||||||
open Prelude, SyntaxEng, ParadigmsEng in {
|
open Prelude, SyntaxEng, OldParadigmsEng in {
|
||||||
|
|
||||||
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,31 @@
|
|||||||
concrete TimeEng of Time = {
|
concrete TimeEng of Time = NumeralsEng **
|
||||||
|
open Prelude, ResourceEng, ParadigmsEng in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Date = SS ;
|
||||||
|
Weekday = N ;
|
||||||
|
Hour = SS ;
|
||||||
|
Minute = SS ;
|
||||||
|
Time = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
DayDate day = ss (day.s ! singular ! nominative) ;
|
||||||
|
DayTimeDate day time = ss (day.s ! singular ! nominative ++ "at" ++ time.s) ;
|
||||||
|
|
||||||
|
FormalTime = infixSS ["hundred and"] ;
|
||||||
|
PastTime h m = ss (m.s ++ "past" ++ h.s) ;
|
||||||
|
ToTime h m = ss (m.s ++ "to" ++ h.s) ;
|
||||||
|
ExactTime h = ss (h.s ++ "sharp") ;
|
||||||
|
|
||||||
|
NumHour n = n ;
|
||||||
|
NumMinute n = n ;
|
||||||
|
|
||||||
|
monday = regN "Monday" ;
|
||||||
|
tuesday = regN "Tuesday" ;
|
||||||
|
wednesday = regN "Wednesday" ;
|
||||||
|
thursday = regN "Thursday" ;
|
||||||
|
friday = regN "Friday" ;
|
||||||
|
saturday = regN "Saturday" ;
|
||||||
|
sunday = regN "Sunday" ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -6,8 +6,96 @@
|
|||||||
--
|
--
|
||||||
concrete StructuralNor of Structural =
|
concrete StructuralNor of Structural =
|
||||||
CategoriesNor, NumeralsNor ** open Prelude, MorphoNor, SyntaxNor in {
|
CategoriesNor, NumeralsNor ** open Prelude, MorphoNor, SyntaxNor in {
|
||||||
lin
|
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||||
|
|
||||||
|
above_Prep = ss "ovenfor" ;
|
||||||
|
after_Prep = ss "etter" ;
|
||||||
|
by8agent_Prep = ss "av" ;
|
||||||
|
all8mass_Det = mkDeterminerSgGender2 "all" "alt" IndefP ;
|
||||||
|
all_NDet = mkDeterminerPlNum "alle" IndefP ;
|
||||||
|
almost_Adv = ss "nesten" ;
|
||||||
|
although_Subj = ss ["selv om"] ;
|
||||||
|
and_Conj = ss "og" ** {n = Pl} ;
|
||||||
|
because_Subj = ss ["fordi"] ;
|
||||||
|
before_Prep = ss "før" ;
|
||||||
|
behind_Prep = ss "bakom" ;
|
||||||
|
between_Prep = ss "mellom" ;
|
||||||
|
both_AndConjD = sd2 "både" "og" ** {n = Pl} ;
|
||||||
|
by8means_Prep = ss "med" ;
|
||||||
|
can8know_VV = mkVerb "kunne" "kan" nonExist "kunne" "kunnet" nonExist ** {s1 = [] ; s3 = []} ;
|
||||||
|
can_VV = mkVerb "kunne" "kan" nonExist "kunne" "kunnet" nonExist ** {s1 = [] ; s3 = []} ;
|
||||||
|
during_Prep = ss "under" ;
|
||||||
|
either8or_ConjD = sd2 "enten" "eller" ** {n = Sg} ;
|
||||||
|
everybody_NP = let alla = table {Nom => "alle" ; Gen => "alles"} in
|
||||||
|
{s = \\c => alla ! npCase c ; g = Utr Masc ; n = Pl ; p = P3} ;
|
||||||
|
every_Det = varjeDet ;
|
||||||
|
everything_NP = nameNounPhrase (mkProperName "alt" NNeutr) ;
|
||||||
|
everywhere_Adv = advPost "overalt" ;
|
||||||
|
from_Prep = ss "fra" ;
|
||||||
|
he_NP = pronNounPhrase han_34 ;
|
||||||
|
how_IAdv = ss "hvor" ;
|
||||||
|
how8many_IDet = mkDeterminerPl ["hvor mange"] IndefP ;
|
||||||
|
if_Subj = ss "hvis" ;
|
||||||
|
in8front_Prep = ss "foran" ;
|
||||||
|
i_NP = pronNounPhrase jag_32 ;
|
||||||
|
in_Prep = ss "i" ;
|
||||||
|
it_NP = pronNounPhrase det_40 ; ----
|
||||||
|
many_Det = mkDeterminerPl "mange" IndefP ;
|
||||||
|
most_Det = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
||||||
|
most8many_Det = flestaDet ;
|
||||||
|
much_Det = mkDeterminerSg (detSgInvar "mye") IndefP ;
|
||||||
|
must_VV = mkVerb "måtte" "må" "mås" "måtte" "måttet" "mått" ** {s1 = [] ; s3 = []} ; ---- ?
|
||||||
|
on_Prep = ss "på" ;
|
||||||
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
|
otherwise_Adv = ss "annerledes" ; ---- ?
|
||||||
|
part_Prep = ss "av" ;
|
||||||
|
no_Phr = ss ["Nei ."] ;
|
||||||
|
yes_Phr = ss ["Ja ."] ;
|
||||||
|
possess_Prep = ss "av" ;
|
||||||
|
quite_Adv = ss "temmelig" ;
|
||||||
|
she_NP = pronNounPhrase hon_35 ;
|
||||||
|
so_Adv = ss "så" ;
|
||||||
|
somebody_NP = nameNounPhrase (mkProperName "noen" (NUtr Masc)) ;
|
||||||
|
some_Det = mkDeterminerSgGender2 "noen" "noe" IndefP ;
|
||||||
|
some_NDet = mkDeterminerPlNum "noen" IndefP ;
|
||||||
|
something_NP = nameNounPhrase (mkProperName "noe" NNeutr) ;
|
||||||
|
somewhere_Adv = advPost ["et eller annet sted"] ; ---- ?
|
||||||
|
that_Det = mkDeterminerSgGender2 ["den der"] ["det der"] (DefP Indef) ;
|
||||||
|
that_NP = regNameNounPhrase ["det"] NNeutr ;
|
||||||
|
therefore_Adv = ss "derfor" ;
|
||||||
|
these_NDet = mkDeterminerPlNum ["disse"] (DefP Def) ;
|
||||||
|
they8fem_NP = pronNounPhrase de_38 ;
|
||||||
|
they_NP = pronNounPhrase de_38 ;
|
||||||
|
this_Det = mkDeterminerSgGender2 ["denne"] ["dette"] (DefP Def) ;
|
||||||
|
this_NP = regNameNounPhrase ["dette"] NNeutr ;
|
||||||
|
those_NDet = mkDeterminerPlNum ["de der"] (DefP Def) ;
|
||||||
|
thou_NP = pronNounPhrase du_33 ;
|
||||||
|
through_Prep = ss "gjennom" ;
|
||||||
|
too_Adv = ss "for" ;
|
||||||
|
to_Prep = ss "til" ;
|
||||||
|
under_Prep = ss "under" ;
|
||||||
|
very_Adv = ss "meget" ;
|
||||||
|
want_VV = mkVerb "ville" "vil" nonExist "ville" "villet" "vill" ** {s1 = [] ; s3 = []} ; ---
|
||||||
|
we_NP = pronNounPhrase (vi_36) ;
|
||||||
|
what8many_IP = intPronWhat plural ;
|
||||||
|
what8one_IP = intPronWhat singular ;
|
||||||
|
when_IAdv = ss "når" ;
|
||||||
|
when_Subj = ss "når" ;
|
||||||
|
where_IAdv = ss "hver" ;
|
||||||
|
which8one_IDet = vilkenDet ;
|
||||||
|
which8many_IDet = mkDeterminerPl "hvilke" IndefP ;
|
||||||
|
who8many_IP = intPronWho plural ;
|
||||||
|
who8one_IP = intPronWho singular ;
|
||||||
|
why_IAdv = ss "hvorfor" ;
|
||||||
|
without_Prep = ss "uten" ;
|
||||||
|
with_Prep = ss "med" ;
|
||||||
|
ye_NP = pronNounPhrase (ni_37) ;
|
||||||
|
you_NP = pronNounPhrase De_38 ;
|
||||||
|
|
||||||
|
|
||||||
|
{-
|
||||||
INP = pronNounPhrase jag_32 ;
|
INP = pronNounPhrase jag_32 ;
|
||||||
ThouNP = pronNounPhrase du_33 ;
|
ThouNP = pronNounPhrase du_33 ;
|
||||||
HeNP = pronNounPhrase han_34 ;
|
HeNP = pronNounPhrase han_34 ;
|
||||||
@@ -23,8 +111,7 @@ concrete StructuralNor of Structural =
|
|||||||
ThisNP = regNameNounPhrase ["dette"] NNeutr ;
|
ThisNP = regNameNounPhrase ["dette"] NNeutr ;
|
||||||
ThatNP = regNameNounPhrase ["det"] NNeutr ;
|
ThatNP = regNameNounPhrase ["det"] NNeutr ;
|
||||||
TheseNumNP n =
|
TheseNumNP n =
|
||||||
{s = \\c => ["disse"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p =
|
{s = \\c => ["disse"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p = P3} ;
|
||||||
P3} ;
|
|
||||||
ThoseNumNP n =
|
ThoseNumNP n =
|
||||||
{s = \\c => ["de der"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p
|
{s = \\c => ["de der"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p
|
||||||
= P3} ;
|
= P3} ;
|
||||||
@@ -42,7 +129,6 @@ concrete StructuralNor of Structural =
|
|||||||
NoNumDet = mkDeterminerPlNum "ingen" IndefP ;
|
NoNumDet = mkDeterminerPlNum "ingen" IndefP ;
|
||||||
WhichNumDet = mkDeterminerPlNum "hvilke" IndefP ;
|
WhichNumDet = mkDeterminerPlNum "hvilke" IndefP ;
|
||||||
|
|
||||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
|
||||||
|
|
||||||
WhichDet = vilkenDet ;
|
WhichDet = vilkenDet ;
|
||||||
MostDet = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
MostDet = mkDeterminerSgGender2 ["den meste"] ["det meste"] (DefP Def) ;
|
||||||
@@ -117,5 +203,5 @@ concrete StructuralNor of Structural =
|
|||||||
PossessPrep = ss "av" ;
|
PossessPrep = ss "av" ;
|
||||||
PartPrep = ss "av" ;
|
PartPrep = ss "av" ;
|
||||||
AgentPrep = ss "av" ;
|
AgentPrep = ss "av" ;
|
||||||
|
-}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ lincat
|
|||||||
-- = {s : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
-- = {s : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
||||||
PN = {s : Case => Str ; g : NounGender} ;
|
PN = {s : Case => Str ; g : NounGender} ;
|
||||||
Det = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
Det = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
||||||
|
NDet = {s : NounGender => Str ; b : SpeciesP} ;
|
||||||
N2 = Function ;
|
N2 = Function ;
|
||||||
-- = CommNoun ** {s2 : Preposition} ;
|
-- = CommNoun ** {s2 : Preposition} ;
|
||||||
N3 = Function ** {s3 : Preposition} ;
|
N3 = Function ** {s3 : Preposition} ;
|
||||||
@@ -72,6 +73,7 @@ lincat
|
|||||||
RS = {s : GenNum => Person => Str} ;
|
RS = {s : GenNum => Person => Str} ;
|
||||||
RCl = {s : Bool => SForm => GenNum => Person => Str} ;
|
RCl = {s : Bool => SForm => GenNum => Person => Str} ;
|
||||||
IP = NounPhrase ;
|
IP = NounPhrase ;
|
||||||
|
IDet = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
||||||
QS = {s : QuestForm => Str} ;
|
QS = {s : QuestForm => Str} ;
|
||||||
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
||||||
Imp = {s : Number => Str} ;
|
Imp = {s : Number => Str} ;
|
||||||
@@ -84,4 +86,6 @@ lincat
|
|||||||
ListS = {s1,s2 : Order => Str} ;
|
ListS = {s1,s2 : Order => Str} ;
|
||||||
ListAP = {s1,s2 : AdjFormPos => Case => Str ; p : Bool} ;
|
ListAP = {s1,s2 : AdjFormPos => Case => Str ; p : Bool} ;
|
||||||
ListNP = {s1,s2 : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
ListNP = {s1,s2 : NPForm => Str ; g : Gender ; n : Number ; p : Person} ;
|
||||||
|
ListAdv = {s1,s2 : Str} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ lin
|
|||||||
DefNumNP = defNounPhraseNum plural ;
|
DefNumNP = defNounPhraseNum plural ;
|
||||||
|
|
||||||
DetNP = detNounPhrase ;
|
DetNP = detNounPhrase ;
|
||||||
|
NDetNP = numDetNounPhrase ;
|
||||||
|
NDetNum = justNumDetNounPhrase ;
|
||||||
MassNP = detNounPhrase (mkDeterminerSg (detSgInvar []) IndefP) ;
|
MassNP = detNounPhrase (mkDeterminerSg (detSgInvar []) IndefP) ;
|
||||||
|
|
||||||
AppN2 = appFunComm ;
|
AppN2 = appFunComm ;
|
||||||
@@ -94,6 +96,7 @@ lin
|
|||||||
|
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
AdvAP = advAdjPhrase ;
|
AdvAP = advAdjPhrase ;
|
||||||
|
AdvAdv = cc2 ;
|
||||||
|
|
||||||
--3 Sentences and relative clauses
|
--3 Sentences and relative clauses
|
||||||
--
|
--
|
||||||
@@ -111,13 +114,14 @@ lin
|
|||||||
--3 Questions and imperatives
|
--3 Questions and imperatives
|
||||||
--
|
--
|
||||||
|
|
||||||
WhoOne = intPronWho singular ;
|
IDetCN d n = detNounPhrase d n ;
|
||||||
WhoMany = intPronWho plural ;
|
|
||||||
WhatOne = intPronWhat singular ;
|
|
||||||
WhatMany = intPronWhat plural ;
|
|
||||||
FunIP = funIntPron ;
|
FunIP = funIntPron ;
|
||||||
NounIPOne = nounIntPron singular ;
|
-- NounIPOne = nounIntPron singular ;
|
||||||
NounIPMany = nounIntPron plural ;
|
-- NounIPMany = nounIntPron plural ;
|
||||||
|
-- WhoOne = intPronWho singular ;
|
||||||
|
-- WhoMany = intPronWho plural ;
|
||||||
|
-- WhatOne = intPronWhat singular ;
|
||||||
|
-- WhatMany = intPronWhat plural ;
|
||||||
|
|
||||||
QuestCl = questClause ;
|
QuestCl = questClause ;
|
||||||
IntSlash = intSlash ;
|
IntSlash = intSlash ;
|
||||||
@@ -132,7 +136,9 @@ lin
|
|||||||
ImperMany = imperUtterance plural ;
|
ImperMany = imperUtterance plural ;
|
||||||
|
|
||||||
AdvCl = advClause ;
|
AdvCl = advClause ;
|
||||||
|
AdvVP = advVerbPhrase ;
|
||||||
AdvPhr = advSentence ;
|
AdvPhr = advSentence ;
|
||||||
|
AdCPhr = advSentence ;
|
||||||
|
|
||||||
|
|
||||||
--!
|
--!
|
||||||
@@ -154,6 +160,11 @@ lin
|
|||||||
ConjNP = conjunctNounPhrase ;
|
ConjNP = conjunctNounPhrase ;
|
||||||
ConjDNP = conjunctDistrNounPhrase ;
|
ConjDNP = conjunctDistrNounPhrase ;
|
||||||
|
|
||||||
|
TwoAdv = twoAdverb ;
|
||||||
|
ConsAdv = consAdverb ;
|
||||||
|
ConjAdv = conjunctAdverb ;
|
||||||
|
ConjDAdv = conjunctDistrAdverb ;
|
||||||
|
|
||||||
SubjS = subjunctSentence ;
|
SubjS = subjunctSentence ;
|
||||||
SubjImper = subjunctImperative ;
|
SubjImper = subjunctImperative ;
|
||||||
SubjQS = subjunctQuestion ;
|
SubjQS = subjunctQuestion ;
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ oper
|
|||||||
-- The number and species of the noun are determined by the determiner.
|
-- The number and species of the noun are determined by the determiner.
|
||||||
|
|
||||||
Determiner : Type = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
Determiner : Type = {s : NounGender => Str ; n : Number ; b : SpeciesP} ;
|
||||||
|
DeterminerNum : Type = {s : NounGender => Str ; b : SpeciesP} ;
|
||||||
|
|
||||||
artIndef : Gender => Str ;
|
artIndef : Gender => Str ;
|
||||||
|
|
||||||
@@ -131,6 +132,17 @@ oper
|
|||||||
{s = table {c => en.s ! man.g ++ man.s ! en.n ! en.b ! npCase c} ;
|
{s = table {c => en.s ! man.g ++ man.s ! en.n ! en.b ! npCase c} ;
|
||||||
g = genNoun man.g ; n = en.n ; p = P3} ;
|
g = genNoun man.g ; n = en.n ; p = P3} ;
|
||||||
|
|
||||||
|
numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase =
|
||||||
|
\alla,sex, man ->
|
||||||
|
{s = \\c => alla.s ! man.g ++ sex.s ! Nom ++ man.s ! Pl ! alla.b ! npCase c ;
|
||||||
|
g = genNoun man.g ; n = Pl ; p = P3} ;
|
||||||
|
|
||||||
|
justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase =
|
||||||
|
\alla,sex ->
|
||||||
|
{s = \\c => alla.s ! NNeutr ++ sex.s ! npCase c ;
|
||||||
|
g = Neutr ; n = Pl ; p = P3} ;
|
||||||
|
|
||||||
|
|
||||||
-- The following macros are sufficient to define most determiners.
|
-- The following macros are sufficient to define most determiners.
|
||||||
-- All $SpeciesP$ values come into question:
|
-- All $SpeciesP$ values come into question:
|
||||||
-- "en god vän" - "min gode vän" - "den gode vännen".
|
-- "en god vän" - "min gode vän" - "den gode vännen".
|
||||||
@@ -142,14 +154,13 @@ oper
|
|||||||
{s = en ; n = Sg ; b = b} ;
|
{s = en ; n = Sg ; b = b} ;
|
||||||
|
|
||||||
mkDeterminerPl : DetPl -> SpeciesP -> Determiner = \alla,b ->
|
mkDeterminerPl : DetPl -> SpeciesP -> Determiner = \alla,b ->
|
||||||
mkDeterminerPlNum alla b noNum ;
|
{s = \\_ => alla ;
|
||||||
|
|
||||||
mkDeterminerPlNum : DetPl -> SpeciesP -> Numeral -> Determiner = \alla,b,n ->
|
|
||||||
{s = \\_ => alla ++ n.s ! Nom ;
|
|
||||||
n = Pl ;
|
n = Pl ;
|
||||||
b = b
|
b = b
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkDeterminerPlNum : DetPl -> SpeciesP -> DeterminerNum = mkDeterminerPl ;
|
||||||
|
|
||||||
detSgInvar : Str -> DetSg = \varje -> table {_ => varje} ;
|
detSgInvar : Str -> DetSg = \varje -> table {_ => varje} ;
|
||||||
|
|
||||||
-- A large class of determiners can be built from a gender-dependent table.
|
-- A large class of determiners can be built from a gender-dependent table.
|
||||||
@@ -226,9 +237,10 @@ oper
|
|||||||
(mkDeterminerSgGender (table {g => artDef ! cn.p ! ASg g})
|
(mkDeterminerSgGender (table {g => artDef ! cn.p ! ASg g})
|
||||||
(DefP (specDefPhrase cn.p))) cn ;
|
(DefP (specDefPhrase cn.p))) cn ;
|
||||||
deDet : Numeral -> CommNounPhrase -> NounPhrase = \n,cn ->
|
deDet : Numeral -> CommNounPhrase -> NounPhrase = \n,cn ->
|
||||||
detNounPhrase
|
numDetNounPhrase
|
||||||
(mkDeterminerPlNum (artDef ! cn.p ! APl)
|
(mkDeterminerPlNum (artDef ! cn.p ! APl)
|
||||||
(DefP (specDefPhrase cn.p)) n) cn ;
|
(DefP (specDefPhrase cn.p)))
|
||||||
|
n cn ;
|
||||||
|
|
||||||
-- This is uniformly $Def$ in Swedish, but in Danish, $Indef$ for
|
-- This is uniformly $Def$ in Swedish, but in Danish, $Indef$ for
|
||||||
-- compounds with determiner.
|
-- compounds with determiner.
|
||||||
@@ -726,6 +738,12 @@ oper
|
|||||||
s3 = \\sf,g,n,p => spelar.s3 ! sf ! g ! n ! p
|
s3 = \\sf,g,n,p => spelar.s3 ! sf ! g ! n ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
advVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \sing, well ->
|
||||||
|
{
|
||||||
|
s = \\a,b,c,d => sing.s ! a ! b ! c ! d ++ well.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \mycket, dyr ->
|
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \mycket, dyr ->
|
||||||
{s = \\a,c => mycket.s ++ dyr.s ! a ! c ;
|
{s = \\a,c => mycket.s ++ dyr.s ! a ! c ;
|
||||||
p = dyr.p
|
p = dyr.p
|
||||||
@@ -1325,6 +1343,35 @@ oper
|
|||||||
|
|
||||||
conjGender : Gender -> Gender -> Gender ;
|
conjGender : Gender -> Gender -> Gender ;
|
||||||
|
|
||||||
|
--3 Coordinating adverbs
|
||||||
|
--
|
||||||
|
-- We need a category of lists of adverbs. It is a discontinuous
|
||||||
|
-- category, the parts corresponding to 'init' and 'last' segments
|
||||||
|
-- (rather than 'head' and 'tail', because we have to keep track of the slot between
|
||||||
|
-- the last two elements of the list). A list has at least two elements.
|
||||||
|
|
||||||
|
ListAdverb : Type = SD2 ;
|
||||||
|
|
||||||
|
twoAdverb : (_,_ : Adverb) -> ListAdverb = CO.twoSS ;
|
||||||
|
|
||||||
|
consAdverb : ListAdverb -> Adverb -> ListAdverb =
|
||||||
|
CO.consSS CO.comma ;
|
||||||
|
|
||||||
|
-- To coordinate a list of adverbs by a simple conjunction, we place
|
||||||
|
-- it between the last two elements; commas are put in the other slots,
|
||||||
|
|
||||||
|
conjunctAdverb : Conjunction -> ListAdverb -> Adverb = \c,xs ->
|
||||||
|
ss (CO.conjunctX c xs) ;
|
||||||
|
|
||||||
|
-- To coordinate a list of adverbs by a distributed conjunction, we place
|
||||||
|
-- the first part (e.g. "either") in front of the first element, the second
|
||||||
|
-- part ("or") between the last two elements, and commas in the other slots.
|
||||||
|
|
||||||
|
conjunctDistrAdverb : ConjunctionDistr -> ListAdverb -> Adverb =
|
||||||
|
\c,xs ->
|
||||||
|
ss (CO.conjunctDistrX c xs) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--2 Subjunction
|
--2 Subjunction
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
concrete BasicSwe of Basic = CategoriesSwe ** open NewParadigmsSwe in {
|
concrete BasicSwe of Basic = CategoriesSwe ** open ParadigmsSwe in {
|
||||||
|
|
||||||
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
||||||
|
optimize=values ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
airplane_N = regN "flygplan" neutrum ;
|
airplane_N = regN "flygplan" neutrum ;
|
||||||
@@ -218,5 +219,11 @@ lin
|
|||||||
put_V2 = mkV2 (irregV "sätta" "satte" "satt") [] ;
|
put_V2 = mkV2 (irregV "sätta" "satte" "satt") [] ;
|
||||||
stop_V = regV "stanna" ;
|
stop_V = regV "stanna" ;
|
||||||
jump_V = regV "hoppa" ;
|
jump_V = regV "hoppa" ;
|
||||||
|
here_Adv = mkAdv "här" ;
|
||||||
|
here7to_Adv = mkAdv "hit" ;
|
||||||
|
here7from_Adv = mkAdv ["härifrån"] ;
|
||||||
|
there_Adv = mkAdv "där" ;
|
||||||
|
there7to_Adv = mkAdv "dit" ;
|
||||||
|
there7from_Adv = mkAdv ["därifrån"] ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
27
lib/resource/swedish/CountrySwe.gf
Normal file
27
lib/resource/swedish/CountrySwe.gf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
concrete CountrySwe of Country = open ResourceSwe, ParadigmsSwe in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Country = PN ;
|
||||||
|
Nationality = A ;
|
||||||
|
Language = N ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
Denmark = regPN "Danmark" neutrum ;
|
||||||
|
England = regPN "England" neutrum ;
|
||||||
|
Finland = regPN "Finland" neutrum ;
|
||||||
|
France = regPN "Frankrike" neutrum ;
|
||||||
|
Germany = regPN "Tyskland" neutrum ;
|
||||||
|
Italy = regPN "Italien" neutrum ;
|
||||||
|
Norway = regPN "Norge" neutrum ;
|
||||||
|
Russia = regPN "Ryssland" neutrum ;
|
||||||
|
Spain = regPN "Spanien" neutrum ;
|
||||||
|
Sweden = regPN "Sverige" neutrum ;
|
||||||
|
|
||||||
|
Danish = regA "Dansk" ;
|
||||||
|
English = regA "Engelsk" ;
|
||||||
|
|
||||||
|
DanishLang = regN "Danska" utrum ;
|
||||||
|
EnglishLang = regN "Engelska" utrum ;
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
22
lib/resource/swedish/LangSwe.gf
Normal file
22
lib/resource/swedish/LangSwe.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete LangSwe of Lang =
|
||||||
|
RulesSwe,
|
||||||
|
ClauseSwe,
|
||||||
|
StructuralSwe,
|
||||||
|
BasicSwe,
|
||||||
|
TimeSwe,
|
||||||
|
CountrySwe
|
||||||
|
|
||||||
|
** open Prelude, ResourceSwe, ParadigmsSwe in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
AdvDate d = prefixSS "på" d ;
|
||||||
|
AdvTime t = prefixSS "klockan" t ;
|
||||||
|
NWeekday w = w ;
|
||||||
|
PNWeekday w = nounPN w ;
|
||||||
|
|
||||||
|
PNCountry x = x ;
|
||||||
|
ANationality x = x ;
|
||||||
|
NLanguage x = x ;
|
||||||
|
}
|
||||||
@@ -1,348 +0,0 @@
|
|||||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
|
||||||
|
|
||||||
--1 Swedish Lexical Paradigms UNDER RECONSTRUCTION!
|
|
||||||
--
|
|
||||||
-- Aarne Ranta 2003
|
|
||||||
--
|
|
||||||
-- This is an API to the user of the resource grammar
|
|
||||||
-- for adding lexical items. It gives functions for forming
|
|
||||||
-- expressions of open categories: nouns, adjectives, verbs.
|
|
||||||
--
|
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
|
||||||
--
|
|
||||||
-- The main difference with $MorphoEng.gf$ is that the types
|
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
|
||||||
-- had the design principle of always having existing forms, rather
|
|
||||||
-- than stems, as string arguments of the paradigms.
|
|
||||||
--
|
|
||||||
-- The structure of functions for each word class $C$ is the following:
|
|
||||||
-- first we give a handful of patterns that aim to cover all
|
|
||||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
|
||||||
-- escape to construct the most irregular words of type $C$.
|
|
||||||
-- However, this function should only seldom be needed: we have a
|
|
||||||
-- separate module $IrregularEng$, which covers all irregularly inflected
|
|
||||||
-- words.
|
|
||||||
--
|
|
||||||
-- The following modules are presupposed:
|
|
||||||
|
|
||||||
resource NewParadigmsSwe =
|
|
||||||
open (Predef=Predef), Prelude, TypesSwe, MorphoSwe, SyntaxSwe, ResourceSwe in {
|
|
||||||
|
|
||||||
--2 Parameters
|
|
||||||
--
|
|
||||||
-- To abstract over gender names, we define the following identifiers.
|
|
||||||
|
|
||||||
oper
|
|
||||||
Gender : Type ;
|
|
||||||
|
|
||||||
utrum : Gender ;
|
|
||||||
neutrum : Gender ;
|
|
||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
|
||||||
|
|
||||||
Number : Type ;
|
|
||||||
|
|
||||||
singular : Number ;
|
|
||||||
plural : Number ;
|
|
||||||
|
|
||||||
-- To abstract over case names, we define the following.
|
|
||||||
|
|
||||||
Case : Type ;
|
|
||||||
|
|
||||||
nominative : Case ;
|
|
||||||
genitive : Case ;
|
|
||||||
|
|
||||||
-- Prepositions used in many-argument functions are just strings.
|
|
||||||
|
|
||||||
Preposition : Type = Str ;
|
|
||||||
|
|
||||||
--2 Nouns
|
|
||||||
|
|
||||||
-- Worst case: give all four forms. The gender is computed from the
|
|
||||||
-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$).
|
|
||||||
|
|
||||||
mkN : (apa,apan,apor,aporna : Str) -> N ;
|
|
||||||
|
|
||||||
-- The regular function takes the singular indefinite form and the gender,
|
|
||||||
-- and computes the other forms by a heuristic.
|
|
||||||
-- If in doubt, use the $cc$ command to test!
|
|
||||||
|
|
||||||
regN : Str -> Gender -> N ;
|
|
||||||
|
|
||||||
-- In practice the worst case is often just: give singular and plural indefinite.
|
|
||||||
|
|
||||||
mk2N : (nyckel,nycklar : Str) -> N ;
|
|
||||||
|
|
||||||
-- All nouns created by the previous functions are marked as
|
|
||||||
-- $nonmasculine$. If you want a $masculine$ noun, wrap it with the following
|
|
||||||
-- function:
|
|
||||||
|
|
||||||
mascN : N -> N ;
|
|
||||||
|
|
||||||
--3 Compound nouns
|
|
||||||
--
|
|
||||||
-- All the functions above work quite as well to form compound nouns,
|
|
||||||
-- such as "fotboll".
|
|
||||||
|
|
||||||
|
|
||||||
--3 Relational nouns
|
|
||||||
--
|
|
||||||
-- Relational nouns ("daughter of x") need a preposition.
|
|
||||||
|
|
||||||
mkN2 : N -> Preposition -> N2 ;
|
|
||||||
|
|
||||||
-- The most common preposition is "av", and the following is a
|
|
||||||
-- shortcut for regular, $nonhuman$ relational nouns with "av".
|
|
||||||
|
|
||||||
regN2 : Str -> Gender -> N2 ;
|
|
||||||
|
|
||||||
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
|
||||||
-- form other prepositions.
|
|
||||||
--
|
|
||||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
|
||||||
|
|
||||||
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
|
||||||
|
|
||||||
|
|
||||||
--3 Relational common noun phrases
|
|
||||||
--
|
|
||||||
-- In some cases, you may want to make a complex $CN$ into a
|
|
||||||
-- relational noun (e.g. "the old town hall of").
|
|
||||||
|
|
||||||
cnN2 : CN -> Preposition -> N2 ;
|
|
||||||
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
|
||||||
|
|
||||||
--
|
|
||||||
--3 Proper names and noun phrases
|
|
||||||
--
|
|
||||||
-- Proper names, with a regular genitive, are formed as follows
|
|
||||||
|
|
||||||
regPN : Str -> Gender -> PN ; -- John, John's
|
|
||||||
|
|
||||||
-- To form a noun phrase that can also be plural and have an irregular
|
|
||||||
-- genitive, you can use the worst-case function.
|
|
||||||
|
|
||||||
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
|
||||||
|
|
||||||
--2 Adjectives
|
|
||||||
|
|
||||||
-- Non-comparison one-place adjectives need for forms:
|
|
||||||
|
|
||||||
mkA : (galen,galet,galna : Str) -> A ;
|
|
||||||
|
|
||||||
-- For regular adjectives, the other forms are derived.
|
|
||||||
|
|
||||||
regA : Str -> A ;
|
|
||||||
|
|
||||||
-- In practice, two forms are enough.
|
|
||||||
|
|
||||||
mk2A : (bred,brett : Str) -> A ;
|
|
||||||
|
|
||||||
--3 Two-place adjectives
|
|
||||||
--
|
|
||||||
-- Two-place adjectives need a preposition for their second argument.
|
|
||||||
|
|
||||||
mkA2 : A -> Preposition -> A2 ;
|
|
||||||
|
|
||||||
-- Comparison adjectives may need as many as seven forms.
|
|
||||||
|
|
||||||
mkADeg : (liten, litet, lilla, sma, mindre, minst, minsta : Str) -> ADeg ;
|
|
||||||
|
|
||||||
-- The regular pattern works for many adjectives, e.g. those ending
|
|
||||||
-- with "ig".
|
|
||||||
|
|
||||||
regADeg : Str -> ADeg ;
|
|
||||||
|
|
||||||
-- Just the comparison forms can be irregular.
|
|
||||||
|
|
||||||
irregADeg : (tung,tyngre,tyngst : Str) -> ADeg ;
|
|
||||||
|
|
||||||
-- Sometimes just the positive forms are irregular.
|
|
||||||
|
|
||||||
mk3ADeg : (galen,galet,galna : Str) -> ADeg ;
|
|
||||||
mk2ADeg : (bred,brett : Str) -> ADeg ;
|
|
||||||
|
|
||||||
-- If comparison is formed by "more, "most", as in general for
|
|
||||||
-- long adjective, the following pattern is used:
|
|
||||||
|
|
||||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
|
||||||
|
|
||||||
-- From a given $ADeg$, it is possible to get back to $A$.
|
|
||||||
|
|
||||||
adegA : ADeg -> A ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbs
|
|
||||||
|
|
||||||
-- Adverbs are not inflected. Most lexical ones have position
|
|
||||||
-- after the verb. Some can be preverbal (e.g. "always").
|
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
|
||||||
mkAdV : Str -> AdV ;
|
|
||||||
|
|
||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
|
||||||
|
|
||||||
--2 Prepositions
|
|
||||||
--
|
|
||||||
-- A preposition is just a string.
|
|
||||||
|
|
||||||
mkPreposition : Str -> Preposition ;
|
|
||||||
|
|
||||||
--2 Verbs
|
|
||||||
--
|
|
||||||
-- The worst case needs five forms.
|
|
||||||
|
|
||||||
mkV : (supa,super,sup,söp,supit,supen : Str) -> V ;
|
|
||||||
|
|
||||||
-- The 'regular verb' function is the first conjugation.
|
|
||||||
|
|
||||||
regV : (tala : Str) -> V ;
|
|
||||||
|
|
||||||
-- The almost regular verb function needs the infinitive and the present.
|
|
||||||
|
|
||||||
mk2V : (leka,leker : Str) -> V ;
|
|
||||||
|
|
||||||
-- There is an extensive list of irregular verbs in the module $IrregularSwe$.
|
|
||||||
-- In practice, it is enough to give three forms, as in school books.
|
|
||||||
|
|
||||||
irregV : (dricka, drack, druckit : Str) -> V ;
|
|
||||||
|
|
||||||
|
|
||||||
--3 Verbs with a particle.
|
|
||||||
--
|
|
||||||
-- The particle, such as in "switch on", is given as a string.
|
|
||||||
|
|
||||||
partV : V -> Str -> V ;
|
|
||||||
|
|
||||||
--3 Deponent verbs.
|
|
||||||
--
|
|
||||||
-- Some words are used in passive forms only, e.g. "hoppas".
|
|
||||||
|
|
||||||
depV : V -> V ;
|
|
||||||
|
|
||||||
--3 Two-place verbs
|
|
||||||
--
|
|
||||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
|
||||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
|
||||||
|
|
||||||
mkV2 : V -> Preposition -> V2 ;
|
|
||||||
|
|
||||||
dirV2 : V -> V2 ;
|
|
||||||
|
|
||||||
--3 Three-place verbs
|
|
||||||
--
|
|
||||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
|
||||||
-- the first one or both can be absent.
|
|
||||||
|
|
||||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
|
||||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
|
||||||
dirdirV3 : V -> V3 ; -- give,_,_
|
|
||||||
|
|
||||||
--3 Other complement patterns
|
|
||||||
--
|
|
||||||
-- Verbs and adjectives can take complements such as sentences,
|
|
||||||
-- questions, verb phrases, and adjectives.
|
|
||||||
|
|
||||||
mkV0 : V -> V0 ;
|
|
||||||
mkVS : V -> VS ;
|
|
||||||
mkV2S : V -> Str -> V2S ;
|
|
||||||
mkVV : V -> VV ;
|
|
||||||
mkV2V : V -> Str -> Str -> V2V ;
|
|
||||||
mkVA : V -> VA ;
|
|
||||||
mkV2A : V -> Str -> V2A ;
|
|
||||||
mkVQ : V -> VQ ;
|
|
||||||
mkV2Q : V -> Str -> V2Q ;
|
|
||||||
|
|
||||||
mkAS : A -> AS ;
|
|
||||||
mkA2S : A -> Str -> A2S ;
|
|
||||||
mkAV : A -> AV ;
|
|
||||||
mkA2V : A -> Str -> A2V ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Definitions of the paradigms
|
|
||||||
--
|
|
||||||
-- The definitions should not bother the user of the API. So they are
|
|
||||||
-- hidden from the document.
|
|
||||||
--.
|
|
||||||
|
|
||||||
Gender = SyntaxSwe.NounGender ;
|
|
||||||
Number = TypesSwe.Number ;
|
|
||||||
Case = TypesSwe.Case ;
|
|
||||||
utrum = NUtr NoMasc ;
|
|
||||||
neutrum = NNeutr ;
|
|
||||||
singular = Sg ;
|
|
||||||
plural = Pl ;
|
|
||||||
nominative = Nom ;
|
|
||||||
genitive = Gen ;
|
|
||||||
|
|
||||||
mkN x y z u = extCommNoun (mkNoun x y z u) ** {lock_N = <>} ;
|
|
||||||
regN x g = extCommNoun (regNoun x (genNoun g)) ** {lock_N = <>} ;
|
|
||||||
mk2N x g = extCommNoun (reg2Noun x g) ** {lock_N = <>} ;
|
|
||||||
mascN n = {s = n.s ; g = NUtr Masc ; lock_N = <>} ;
|
|
||||||
|
|
||||||
mkN2 = \n,p -> UseN n ** {lock_N2 = <> ; s2 = p} ;
|
|
||||||
regN2 n g = mkN2 (regN n g) (mkPreposition "av") ;
|
|
||||||
mkN3 = \n,p,q -> UseN n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
|
||||||
cnN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
|
||||||
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
|
||||||
|
|
||||||
regPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ;
|
|
||||||
mkNP x y n g =
|
|
||||||
{s = table {PGen _ => x ; _ => y} ; g = genNoun g ; n = n ; p = P3 ;
|
|
||||||
lock_NP = <>} ;
|
|
||||||
|
|
||||||
mkA a b c = extractPositive (adjAlmostReg a b c) ** {lock_A = <>} ;
|
|
||||||
mk2A a b = extractPositive (adj2Reg a b) ** {lock_A = <>} ;
|
|
||||||
regA a = extractPositive (adjReg a) ** {lock_A = <>} ;
|
|
||||||
|
|
||||||
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
|
||||||
|
|
||||||
mkADeg a b c d e f g = mkAdjective a b c d e f g ** {lock_ADeg = <>} ;
|
|
||||||
regADeg a = adjReg a ** {lock_ADeg = <>} ;
|
|
||||||
irregADeg a b c = adjIrreg3 a b c ** {lock_ADeg = <>} ;
|
|
||||||
mk3ADeg a b c = adjAlmostReg a b c ** {lock_ADeg = <>} ;
|
|
||||||
mk2ADeg a b = adj2Reg a b ** {lock_ADeg = <>} ;
|
|
||||||
|
|
||||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
|
||||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
|
||||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
|
||||||
|
|
||||||
mkPreposition p = p ;
|
|
||||||
|
|
||||||
mkV a b c d e f = mkVerb a b c d e f ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
|
|
||||||
regV a = mk2V a (a + "r") ;
|
|
||||||
mk2V a b = regVerb a b ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
|
|
||||||
irregV x y z = vSälja x y z
|
|
||||||
** {s1 = [] ; lock_V = <>} ;
|
|
||||||
|
|
||||||
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
|
||||||
depV v = deponentVerb v ** {lock_V = <>} ;
|
|
||||||
|
|
||||||
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s2 = p ; lock_V2 = <>} ;
|
|
||||||
dirV2 v = mkV2 v [] ;
|
|
||||||
|
|
||||||
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; s2 = p ; s3 = q ; lock_V3 = <>} ;
|
|
||||||
dirV3 v p = mkV3 v [] p ;
|
|
||||||
dirdirV3 v = dirV3 v [] ;
|
|
||||||
|
|
||||||
mkV0 v = v ** {lock_V0 = <>} ;
|
|
||||||
mkVS v = v ** {lock_VS = <>} ;
|
|
||||||
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
|
||||||
mkVV v = v ** {s3 = "att" ; lock_VV = <>} ;
|
|
||||||
mkV2V v p t = mkV2 v p ** {s3 = t ; lock_V2V = <>} ;
|
|
||||||
mkVA v = v ** {lock_VA = <>} ;
|
|
||||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
|
||||||
mkVQ v = v ** {lock_VQ = <>} ;
|
|
||||||
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
|
||||||
|
|
||||||
mkAS v = v ** {lock_AS = <>} ;
|
|
||||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
|
||||||
mkAV v = v ** {lock_AV = <>} ;
|
|
||||||
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
|
||||||
|
|
||||||
} ;
|
|
||||||
370
lib/resource/swedish/OldParadigmsSwe.gf
Normal file
370
lib/resource/swedish/OldParadigmsSwe.gf
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
|
--1 Swedish Lexical Paradigms
|
||||||
|
--
|
||||||
|
-- Aarne Ranta 2003
|
||||||
|
--
|
||||||
|
-- This is an API to the user of the resource grammar
|
||||||
|
-- for adding lexical items. It give shortcuts for forming
|
||||||
|
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||||
|
--
|
||||||
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
|
-- accessed through the resource syntax API, $Structural.gf$.
|
||||||
|
--
|
||||||
|
-- The main difference with $MorphoSwe.gf$ is that the types
|
||||||
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
|
-- had the design principle of always having existing forms, not stems, as string
|
||||||
|
-- arguments of the paradigms.
|
||||||
|
--
|
||||||
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
|
resource ParadigmsSwe = open (Predef=Predef), Prelude, MorphoSwe, SyntaxSwe, ResourceSwe in {
|
||||||
|
|
||||||
|
--2 Parameters
|
||||||
|
--
|
||||||
|
-- To abstract over gender names, we define the following identifiers.
|
||||||
|
|
||||||
|
oper
|
||||||
|
Gender : Type ;
|
||||||
|
utrum : Gender ;
|
||||||
|
neutrum : Gender ;
|
||||||
|
|
||||||
|
Sex : Type ;
|
||||||
|
|
||||||
|
masculine : Sex ;
|
||||||
|
nonmasculine : Sex ;
|
||||||
|
|
||||||
|
-- To abstract over case names, we define the following.
|
||||||
|
|
||||||
|
Case : Type ;
|
||||||
|
|
||||||
|
nominative : Case ;
|
||||||
|
genitive : Case ;
|
||||||
|
|
||||||
|
-- To abstract over number names, we define the following.
|
||||||
|
Number : Type ;
|
||||||
|
|
||||||
|
singular : Number ;
|
||||||
|
plural : Number ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
--2 Nouns
|
||||||
|
|
||||||
|
-- Worst case: give all nominative forms and the gender.
|
||||||
|
-- The genitive is formed automatically, even when the nominative
|
||||||
|
-- ends with an "s".
|
||||||
|
|
||||||
|
mkN : (_,_,_,_ : Str) -> Gender -> Sex -> N ;
|
||||||
|
-- man, mannen, män, männen
|
||||||
|
|
||||||
|
-- Here are some common patterns, corresponding to school-gramamr declensions.
|
||||||
|
-- Except $nPojke$, $nKarl$, and $nMurare$,
|
||||||
|
-- they are defined to be $nonmasculine$, which means that they don't create
|
||||||
|
-- the definite adjective form with "e" but with "a".
|
||||||
|
|
||||||
|
nApa : Str -> N ; -- apa (apan, apor, aporna) ; utrum
|
||||||
|
nBil : Str -> N ; -- bil (bilen, bilar, bilarna) ; utrum
|
||||||
|
nKarl : Str -> N ; -- karl (karlen, karlar, karlarna) ; utrum ; masculine
|
||||||
|
nPojke : Str -> N ; -- pojke (pojken, pojkar, pojkarna) ; utrum ; masculine
|
||||||
|
nNyckel : Str -> N ; -- nyckel (nyckeln, nycklar, nycklarna) ; utrum
|
||||||
|
nRisk : Str -> N ; -- risk (risken, risker, riskerna) ; utrum
|
||||||
|
nDike : Str -> N ; -- dike (diket, diken, dikena) ; neutrum
|
||||||
|
nRep : Str -> N ; -- rep (repet, rep, repen) ; neutrum
|
||||||
|
nPapper : Str -> N ; -- papper (pappret, papper, pappren) ; neutrum
|
||||||
|
nMurare : Str -> N ; -- murare (muraren, murare, murarna) ; utrum ; masculine
|
||||||
|
nKikare : Str -> N ; -- kikare (kikaren, kikare, kikarna) ; utrum
|
||||||
|
|
||||||
|
-- Nouns used as functions need a preposition. The most common ones are "av",
|
||||||
|
-- "på", and "till". A preposition is a string.
|
||||||
|
|
||||||
|
mkN2 : N -> Str -> N2 ;
|
||||||
|
funAv : N -> N2 ;
|
||||||
|
funPaa : N -> N2 ;
|
||||||
|
funTill : N -> N2 ;
|
||||||
|
|
||||||
|
-- Proper names, with their possibly
|
||||||
|
-- irregular genitive. The regular genitive is "s", omitted after "s".
|
||||||
|
|
||||||
|
mkPN : (_,_ : Str) -> Gender -> Sex -> PN ; -- Karolus, Karoli
|
||||||
|
pnReg : Str -> Gender -> Sex -> PN ; -- Johan,Johans ; Johannes, Johannes
|
||||||
|
pnS : Str -> Gender -> Sex -> PN ; -- "Burger King(s)"
|
||||||
|
|
||||||
|
-- On the top level, it is maybe $CN$ that is used rather than $N$, and
|
||||||
|
-- $NP$ rather than $PN$.
|
||||||
|
|
||||||
|
mkCN : N -> CN ;
|
||||||
|
mkNP : (Karolus, Karoli : Str) -> Gender -> NP ;
|
||||||
|
|
||||||
|
npReg : Str -> Gender -> NP ; -- Johann, Johanns
|
||||||
|
|
||||||
|
|
||||||
|
--2 Adjectives
|
||||||
|
|
||||||
|
-- Non-comparison one-place adjectives need four forms in the worst case:
|
||||||
|
-- strong singular, weak singular, plural.
|
||||||
|
|
||||||
|
mkA : (_,_,_,_ : Str) -> A ; -- liten, litet, lilla, små
|
||||||
|
|
||||||
|
-- Special cases needing one form each are: regular adjectives,
|
||||||
|
-- adjectives with unstressed "e" in the last syllable, those
|
||||||
|
-- ending with "n" as a further special case, and invariable
|
||||||
|
-- adjectives.
|
||||||
|
|
||||||
|
adjReg : Str -> A ; -- billig (billigt, billiga, billiga)
|
||||||
|
adjNykter : Str -> A ; -- nykter (nyktert, nyktra, nyktra)
|
||||||
|
adjGalen : Str -> A ; -- galen (galet, galna, galna)
|
||||||
|
adjInvar : Str -> A ; -- bra
|
||||||
|
|
||||||
|
-- Two-place adjectives need a preposition and a case as extra arguments.
|
||||||
|
|
||||||
|
mkA2 : A -> Str -> A2 ; -- delbar, med
|
||||||
|
mkA2Reg : Str -> Str -> A2 ; --
|
||||||
|
|
||||||
|
-- Comparison adjectives may need the three four forms for the positive case, plus
|
||||||
|
-- three more forms for the comparison cases.
|
||||||
|
|
||||||
|
mkADeg : (liten, litet, lilla, sma, mindre, minst, minsta : Str) -> ADeg ;
|
||||||
|
|
||||||
|
-- Some comparison adjectives are completely regular.
|
||||||
|
|
||||||
|
aReg : Str -> ADeg ;
|
||||||
|
|
||||||
|
-- On top level, there are adjectival phrases. The most common case is
|
||||||
|
-- just to use a one-place adjective. The variation in $adjGen$ is taken
|
||||||
|
-- into account.
|
||||||
|
|
||||||
|
apReg : Str -> AP ;
|
||||||
|
|
||||||
|
--2 Adverbs
|
||||||
|
|
||||||
|
-- Adverbs are not inflected. Most lexical ones have position not
|
||||||
|
-- before the verb. Some can be preverbal (e.g. "alltid").
|
||||||
|
|
||||||
|
mkAdv : Str -> Adv ;
|
||||||
|
mkAdvPre : Str -> Adv ;
|
||||||
|
|
||||||
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
|
mkAdA : Str -> AdA ;
|
||||||
|
mkAdS : Str -> AdS ;
|
||||||
|
|
||||||
|
-- Prepositional phrases are another productive form of adverbials.
|
||||||
|
|
||||||
|
mkPP : Str -> NP -> Adv ;
|
||||||
|
|
||||||
|
|
||||||
|
--2 Verbs
|
||||||
|
--
|
||||||
|
-- The fragment only has present tense so far.
|
||||||
|
-- The worst case needs three forms: the infinitive, the indicative, and the
|
||||||
|
-- imperative.
|
||||||
|
|
||||||
|
Voice: Type;
|
||||||
|
|
||||||
|
passive : Voice;
|
||||||
|
active: Voice;
|
||||||
|
|
||||||
|
mkV : (_,_,_,_,_,_ : Str) -> V ; -- vara, är, var; trivas, trivs, trivs
|
||||||
|
|
||||||
|
-- The main conjugations need one string each.
|
||||||
|
|
||||||
|
vKoka : Str -> V ; -- tala (talar, tala)
|
||||||
|
vSteka : Str -> V ; -- leka (leker, lek)
|
||||||
|
---- vBo : Str -> V ; -- bo (bor, bo)
|
||||||
|
|
||||||
|
---- vAndas : Str -> V ; -- andas [all forms the same: also "slåss"]
|
||||||
|
---- vTrivas : Str -> V ; -- trivas (trivs, trivs)
|
||||||
|
|
||||||
|
-- The verbs 'be' and 'have' are special.
|
||||||
|
|
||||||
|
vVara : V ;
|
||||||
|
vHa : V ;
|
||||||
|
|
||||||
|
-- Particle verbs are formed by putting together a verb and a particle.
|
||||||
|
-- If the verb already has a particle, it is replaced by the new one.
|
||||||
|
|
||||||
|
mkPartV : V -> Str -> V ; -- stänga av ;
|
||||||
|
|
||||||
|
-- Two-place verbs, and the special case with direct object.
|
||||||
|
|
||||||
|
mkV2 : V -> Str -> V2 ; -- tycka, om
|
||||||
|
tvDir : V -> V2 ; -- gilla
|
||||||
|
|
||||||
|
-- Ditransitive verbs.
|
||||||
|
|
||||||
|
mkV3 : V -> Str -> Str -> V3 ; -- prata, med, om
|
||||||
|
v3Dir : V -> Str -> V3 ; -- ge,_,till
|
||||||
|
v3DirDir : V -> V3 ; -- ge,_,_
|
||||||
|
|
||||||
|
-- Sentence complement verbs.
|
||||||
|
|
||||||
|
mkVS : V -> VS ; -- säga (att ...)
|
||||||
|
|
||||||
|
-- Verb phrase complement verbs.
|
||||||
|
|
||||||
|
vvInf : V -> VV ; -- orka (spela)
|
||||||
|
vvAtt : V -> VV ; -- gilla (att spela)
|
||||||
|
vvBoth : V -> VV ; -- försöka (spela | att spela)
|
||||||
|
|
||||||
|
|
||||||
|
-- The definitions should not bother the user of the API. So they are
|
||||||
|
-- hidden from the document.
|
||||||
|
--.
|
||||||
|
|
||||||
|
Gender = SyntaxSwe.Gender ;
|
||||||
|
Sex = SyntaxSwe.Sex ;
|
||||||
|
Case = SyntaxSwe.Case ;
|
||||||
|
Number = SyntaxSwe.Number ;
|
||||||
|
Voice = SyntaxSwe.Voice ;
|
||||||
|
|
||||||
|
utrum = Utr ;
|
||||||
|
neutrum = Neutr ;
|
||||||
|
masculine = Masc ;
|
||||||
|
nonmasculine = NoMasc ;
|
||||||
|
nominative = Nom ;
|
||||||
|
genitive = Gen ;
|
||||||
|
singular = Sg ;
|
||||||
|
plural = Pl ;
|
||||||
|
|
||||||
|
active = Act;
|
||||||
|
passive = Pass;
|
||||||
|
|
||||||
|
mkN = \apa, apan, apor, aporna, g, x -> let
|
||||||
|
{nom = table {
|
||||||
|
SF Sg Indef _ => apa ;
|
||||||
|
SF Sg Def _ => apan ;
|
||||||
|
SF Pl Indef _ => apor ;
|
||||||
|
SF Pl Def _ => aporna
|
||||||
|
}
|
||||||
|
} in
|
||||||
|
{s = \\n,d,c => mkCase c (nom ! SF n d Nom) ;
|
||||||
|
g = gensex g x ; lock_N = <>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
-- auxiliaries
|
||||||
|
mkGenit : Tok -> Tok = \s -> ifTok Tok (Predef.dp 1 s) "s" s (s + "s") ;
|
||||||
|
mkCase : Case -> Tok -> Tok = \c,t -> case c of {
|
||||||
|
Nom => t ;
|
||||||
|
Gen => mkGenit t
|
||||||
|
} ;
|
||||||
|
|
||||||
|
nApa = \apa ->
|
||||||
|
let {apor = Predef.tk 1 apa + "or"} in
|
||||||
|
mkN apa (apa + "n") apor (apor + "na") utrum nonmasculine ;
|
||||||
|
|
||||||
|
nBil = \bil ->
|
||||||
|
mkN bil (bil + "en") (bil + "ar") (bil + "arna") utrum nonmasculine ;
|
||||||
|
nKarl = \bil ->
|
||||||
|
mkN bil (bil + "en") (bil + "ar") (bil + "arna") utrum masculine ;
|
||||||
|
nPojke = \pojke ->
|
||||||
|
let {bil = Predef.tk 1 pojke} in
|
||||||
|
mkN pojke (bil + "en") (bil + "ar") (bil + "arna") utrum masculine ;
|
||||||
|
nNyckel = \cykel ->
|
||||||
|
let {cykl = Predef.tk 2 cykel + Predef.dp 1 cykel} in
|
||||||
|
mkN cykel (cykel + "n") (cykl + "ar") (cykl + "arna") utrum nonmasculine ;
|
||||||
|
nRisk = \bil ->
|
||||||
|
mkN bil (bil + "en") (bil + "er") (bil + "erna") utrum nonmasculine ;
|
||||||
|
nDike = \dike ->
|
||||||
|
mkN dike (dike + "t") (dike + "n") (dike + "na") neutrum nonmasculine ;
|
||||||
|
nRep = \rep ->
|
||||||
|
mkN rep (rep + "et") rep (rep + "en") neutrum nonmasculine ;
|
||||||
|
nPapper = \cykel ->
|
||||||
|
let {cykl = Predef.tk 2 cykel + Predef.dp 1 cykel} in
|
||||||
|
mkN cykel (cykl + "et") cykel (cykl + "en") neutrum nonmasculine ;
|
||||||
|
nMurare = \murare ->
|
||||||
|
let {murar = Predef.tk 1 murare} in
|
||||||
|
mkN murare (murar + "en") murare (murar + "na") utrum masculine ;
|
||||||
|
nKikare = \murare ->
|
||||||
|
let {murar = Predef.tk 1 murare} in
|
||||||
|
mkN murare (murar + "en") murare (murar + "na") utrum nonmasculine ;
|
||||||
|
|
||||||
|
|
||||||
|
mkN2 x y = mkFun x y ** {lock_N2 = <>} ;
|
||||||
|
funAv = \f -> mkN2 f "av" ;
|
||||||
|
funPaa = \f -> mkN2 f "på" ;
|
||||||
|
funTill = \f -> mkN2 f "till" ;
|
||||||
|
|
||||||
|
mkPN = \karolus, karoli, g, x ->
|
||||||
|
{s = table {Gen => karoli ; _ => karolus} ; g = gensex g x ; lock_PN = <>} ;
|
||||||
|
pnReg = \horst ->
|
||||||
|
mkPN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ;
|
||||||
|
pnS = \bk ->
|
||||||
|
mkPN bk (bk + "s") ;
|
||||||
|
|
||||||
|
mkCN = UseN ;
|
||||||
|
mkNP = \a,b,g -> UsePN (mkPN a b g nonmasculine) ; -- gender irrelevant in NP
|
||||||
|
npReg = \s,g -> UsePN (pnReg s g nonmasculine) ;
|
||||||
|
|
||||||
|
mkA = \liten, litet, lilla, små ->
|
||||||
|
{s = table {
|
||||||
|
Strong (ASg Utr) => \\c => mkCase c liten ;
|
||||||
|
Strong (ASg Neutr) => \\c => mkCase c litet ;
|
||||||
|
Strong APl => \\c => mkCase c små ;
|
||||||
|
Weak (AxSg Masc) => \\c => mkCase c (Predef.tk 1 lilla + "e") ;
|
||||||
|
Weak _ => \\c => mkCase c lilla
|
||||||
|
} ;
|
||||||
|
lock_A = <>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
adjReg = \billig -> mkA billig (billig + "t") (billig + "a") (billig + "a") ;
|
||||||
|
adjNykter = \nykter ->
|
||||||
|
let {nyktr = Predef.tk 2 nykter + Predef.dp 1 nykter} in
|
||||||
|
mkA nykter (nykter + "t") (nyktr + "a") (nyktr + "a") ;
|
||||||
|
adjGalen = \galen ->
|
||||||
|
let {gal = Predef.tk 2 galen} in
|
||||||
|
mkA galen (gal + "et") (gal + "na") (gal + "na") ;
|
||||||
|
adjInvar = \bra -> {s = \\_,_ => bra ; lock_A = <>} ;
|
||||||
|
|
||||||
|
mkA2 = \a,p -> a ** {s2 = p ; lock_A2 = <>} ;
|
||||||
|
mkA2Reg = \a -> mkA2 (adjReg a) ;
|
||||||
|
|
||||||
|
mkADeg = \liten, litet, lilla, sma, mindre, minst, minsta ->
|
||||||
|
let {lit = (mkA liten litet lilla sma).s} in
|
||||||
|
{s = table {
|
||||||
|
AF (Posit f) c => lit ! f ! c ;
|
||||||
|
AF Compar c => mkCase c mindre ;
|
||||||
|
AF (Super SupStrong) c => mkCase c minst ;
|
||||||
|
AF (Super SupWeak) c => mkCase c minsta --- masculine!
|
||||||
|
} ;
|
||||||
|
lock_ADeg = <>
|
||||||
|
} ;
|
||||||
|
|
||||||
|
aReg = \fin -> mkADeg fin
|
||||||
|
(fin + "t") (fin + "a") (fin + "a") (fin + "are") (fin + "ast") (fin + "aste") ;
|
||||||
|
|
||||||
|
apReg = \s -> UseA (adjReg s) ;
|
||||||
|
|
||||||
|
mkAdv a = advPost a ** {lock_Adv = <>} ;
|
||||||
|
mkAdvPre a = advPre a ** {lock_Adv = <>} ;
|
||||||
|
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
||||||
|
mkAdA a = ss a ** {lock_AdA = <>} ;
|
||||||
|
mkAdS a = ss a ** {lock_AdS = <>} ;
|
||||||
|
|
||||||
|
mkV x y z a b c = mkVerb x y z a b c ** {lock_V = <>} ;
|
||||||
|
vKoka = \tala -> vTala (Predef.tk 1 tala) ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
vSteka = \leka -> vLeka (Predef.tk 1 leka) ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
---- vBo = \bo -> mkV bo (bo+"r") bo ;
|
||||||
|
---- vAndas = \andas -> mkV andas andas andas ;
|
||||||
|
---- vTrivas = \trivas ->
|
||||||
|
---- let {trivs = Predef.tk 1 trivas + "s"} in mkV trivas trivs trivs ;
|
||||||
|
vVara = verbVara ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
vHa = verbHava ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
mkPartV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
||||||
|
mkV2 x y = mkTransVerb x y ** {lock_V2 = <>} ;
|
||||||
|
tvDir = \v -> mkV2 v [] ;
|
||||||
|
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
||||||
|
v3Dir x y = mkV3 x [] y ;
|
||||||
|
v3DirDir x = v3Dir x [] ;
|
||||||
|
|
||||||
|
mkVS v = v ** {lock_VS = <>} ;
|
||||||
|
vvInf v = v ** {isAux = True ; lock_VV = <>} ;
|
||||||
|
vvAtt v = v ** {isAux = False ; lock_VV = <>} ;
|
||||||
|
vvBoth v = v ** {isAux = variants {False ; True} ; lock_VV = <>} ;
|
||||||
|
|
||||||
|
gensex : Gender -> Sex -> NounGender = \g,x -> case g of {
|
||||||
|
Utr => NUtr x ;
|
||||||
|
_ => NNeutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} ;
|
||||||
@@ -1,24 +1,33 @@
|
|||||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
--1 Swedish Lexical Paradigms
|
--1 Swedish Lexical Paradigms UNDER RECONSTRUCTION!
|
||||||
--
|
--
|
||||||
-- Aarne Ranta 2003
|
-- Aarne Ranta 2003
|
||||||
--
|
--
|
||||||
-- This is an API to the user of the resource grammar
|
-- This is an API to the user of the resource grammar
|
||||||
-- for adding lexical items. It give shortcuts for forming
|
-- for adding lexical items. It gives functions for forming
|
||||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
-- expressions of open categories: nouns, adjectives, verbs.
|
||||||
--
|
--
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
-- accessed through the resource syntax API, $Structural.gf$.
|
||||||
--
|
--
|
||||||
-- The main difference with $MorphoSwe.gf$ is that the types
|
-- The main difference with $MorphoEng.gf$ is that the types
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
-- had the design principle of always having existing forms, not stems, as string
|
-- had the design principle of always having existing forms, rather
|
||||||
-- arguments of the paradigms.
|
-- than stems, as string arguments of the paradigms.
|
||||||
|
--
|
||||||
|
-- The structure of functions for each word class $C$ is the following:
|
||||||
|
-- first we give a handful of patterns that aim to cover all
|
||||||
|
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||||
|
-- escape to construct the most irregular words of type $C$.
|
||||||
|
-- However, this function should only seldom be needed: we have a
|
||||||
|
-- separate module $IrregularEng$, which covers all irregularly inflected
|
||||||
|
-- words.
|
||||||
--
|
--
|
||||||
-- The following modules are presupposed:
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
resource ParadigmsSwe = open (Predef=Predef), Prelude, MorphoSwe, SyntaxSwe, ResourceSwe in {
|
resource ParadigmsSwe =
|
||||||
|
open (Predef=Predef), Prelude, TypesSwe, MorphoSwe, SyntaxSwe, ResourceSwe in {
|
||||||
|
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
@@ -26,13 +35,16 @@ resource ParadigmsSwe = open (Predef=Predef), Prelude, MorphoSwe, SyntaxSwe, Res
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
Gender : Type ;
|
Gender : Type ;
|
||||||
|
|
||||||
utrum : Gender ;
|
utrum : Gender ;
|
||||||
neutrum : Gender ;
|
neutrum : Gender ;
|
||||||
|
|
||||||
Sex : Type ;
|
-- To abstract over number names, we define the following.
|
||||||
|
|
||||||
masculine : Sex ;
|
Number : Type ;
|
||||||
nonmasculine : Sex ;
|
|
||||||
|
singular : Number ;
|
||||||
|
plural : Number ;
|
||||||
|
|
||||||
-- To abstract over case names, we define the following.
|
-- To abstract over case names, we define the following.
|
||||||
|
|
||||||
@@ -41,330 +53,298 @@ oper
|
|||||||
nominative : Case ;
|
nominative : Case ;
|
||||||
genitive : Case ;
|
genitive : Case ;
|
||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
-- Prepositions used in many-argument functions are just strings.
|
||||||
Number : Type ;
|
|
||||||
|
|
||||||
singular : Number ;
|
|
||||||
plural : Number ;
|
|
||||||
|
|
||||||
|
|
||||||
|
Preposition : Type = Str ;
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
-- Worst case: give all nominative forms and the gender.
|
-- Worst case: give all four forms. The gender is computed from the
|
||||||
-- The genitive is formed automatically, even when the nominative
|
-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$).
|
||||||
-- ends with an "s".
|
|
||||||
|
|
||||||
mkN : (_,_,_,_ : Str) -> Gender -> Sex -> N ;
|
mkN : (apa,apan,apor,aporna : Str) -> N ;
|
||||||
-- man, mannen, män, männen
|
|
||||||
|
|
||||||
-- Here are some common patterns, corresponding to school-gramamr declensions.
|
-- The regular function takes the singular indefinite form and the gender,
|
||||||
-- Except $nPojke$, $nKarl$, and $nMurare$,
|
-- and computes the other forms by a heuristic.
|
||||||
-- they are defined to be $nonmasculine$, which means that they don't create
|
-- If in doubt, use the $cc$ command to test!
|
||||||
-- the definite adjective form with "e" but with "a".
|
|
||||||
|
|
||||||
nApa : Str -> N ; -- apa (apan, apor, aporna) ; utrum
|
regN : Str -> Gender -> N ;
|
||||||
nBil : Str -> N ; -- bil (bilen, bilar, bilarna) ; utrum
|
|
||||||
nKarl : Str -> N ; -- karl (karlen, karlar, karlarna) ; utrum ; masculine
|
|
||||||
nPojke : Str -> N ; -- pojke (pojken, pojkar, pojkarna) ; utrum ; masculine
|
|
||||||
nNyckel : Str -> N ; -- nyckel (nyckeln, nycklar, nycklarna) ; utrum
|
|
||||||
nRisk : Str -> N ; -- risk (risken, risker, riskerna) ; utrum
|
|
||||||
nDike : Str -> N ; -- dike (diket, diken, dikena) ; neutrum
|
|
||||||
nRep : Str -> N ; -- rep (repet, rep, repen) ; neutrum
|
|
||||||
nPapper : Str -> N ; -- papper (pappret, papper, pappren) ; neutrum
|
|
||||||
nMurare : Str -> N ; -- murare (muraren, murare, murarna) ; utrum ; masculine
|
|
||||||
nKikare : Str -> N ; -- kikare (kikaren, kikare, kikarna) ; utrum
|
|
||||||
|
|
||||||
-- Nouns used as functions need a preposition. The most common ones are "av",
|
-- In practice the worst case is often just: give singular and plural indefinite.
|
||||||
-- "på", and "till". A preposition is a string.
|
|
||||||
|
|
||||||
mkN2 : N -> Str -> N2 ;
|
mk2N : (nyckel,nycklar : Str) -> N ;
|
||||||
funAv : N -> N2 ;
|
|
||||||
funPaa : N -> N2 ;
|
|
||||||
funTill : N -> N2 ;
|
|
||||||
|
|
||||||
-- Proper names, with their possibly
|
-- All nouns created by the previous functions are marked as
|
||||||
-- irregular genitive. The regular genitive is "s", omitted after "s".
|
-- $nonmasculine$. If you want a $masculine$ noun, wrap it with the following
|
||||||
|
-- function:
|
||||||
|
|
||||||
mkPN : (_,_ : Str) -> Gender -> Sex -> PN ; -- Karolus, Karoli
|
mascN : N -> N ;
|
||||||
pnReg : Str -> Gender -> Sex -> PN ; -- Johan,Johans ; Johannes, Johannes
|
|
||||||
pnS : Str -> Gender -> Sex -> PN ; -- "Burger King(s)"
|
|
||||||
|
|
||||||
-- On the top level, it is maybe $CN$ that is used rather than $N$, and
|
--3 Compound nouns
|
||||||
-- $NP$ rather than $PN$.
|
--
|
||||||
|
-- All the functions above work quite as well to form compound nouns,
|
||||||
|
-- such as "fotboll".
|
||||||
|
|
||||||
mkCN : N -> CN ;
|
|
||||||
mkNP : (Karolus, Karoli : Str) -> Gender -> NP ;
|
|
||||||
|
|
||||||
npReg : Str -> Gender -> NP ; -- Johann, Johanns
|
--3 Relational nouns
|
||||||
|
--
|
||||||
|
-- Relational nouns ("daughter of x") need a preposition.
|
||||||
|
|
||||||
|
mkN2 : N -> Preposition -> N2 ;
|
||||||
|
|
||||||
|
-- The most common preposition is "av", and the following is a
|
||||||
|
-- shortcut for regular, $nonhuman$ relational nouns with "av".
|
||||||
|
|
||||||
|
regN2 : Str -> Gender -> N2 ;
|
||||||
|
|
||||||
|
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
||||||
|
-- form other prepositions.
|
||||||
|
--
|
||||||
|
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||||
|
|
||||||
|
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||||
|
|
||||||
|
|
||||||
|
--3 Relational common noun phrases
|
||||||
|
--
|
||||||
|
-- In some cases, you may want to make a complex $CN$ into a
|
||||||
|
-- relational noun (e.g. "the old town hall of"). However, $N2$ and
|
||||||
|
-- $N3$ are purely lexical categories. But you can use the $AdvCN$
|
||||||
|
-- and $PrepNP$ constructions to build phrases like this.
|
||||||
|
|
||||||
|
--
|
||||||
|
--3 Proper names and noun phrases
|
||||||
|
--
|
||||||
|
-- Proper names, with a regular genitive, are formed as follows
|
||||||
|
|
||||||
|
regPN : Str -> Gender -> PN ; -- John, John's
|
||||||
|
|
||||||
|
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||||
|
|
||||||
|
nounPN : N -> PN ;
|
||||||
|
|
||||||
|
-- To form a noun phrase that can also be plural and have an irregular
|
||||||
|
-- genitive, you can use the worst-case function.
|
||||||
|
|
||||||
|
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
|
|
||||||
-- Non-comparison one-place adjectives need four forms in the worst case:
|
-- Non-comparison one-place adjectives need for forms:
|
||||||
-- strong singular, weak singular, plural.
|
|
||||||
|
|
||||||
mkA : (_,_,_,_ : Str) -> A ; -- liten, litet, lilla, små
|
mkA : (galen,galet,galna : Str) -> A ;
|
||||||
|
|
||||||
-- Special cases needing one form each are: regular adjectives,
|
-- For regular adjectives, the other forms are derived.
|
||||||
-- adjectives with unstressed "e" in the last syllable, those
|
|
||||||
-- ending with "n" as a further special case, and invariable
|
|
||||||
-- adjectives.
|
|
||||||
|
|
||||||
adjReg : Str -> A ; -- billig (billigt, billiga, billiga)
|
regA : Str -> A ;
|
||||||
adjNykter : Str -> A ; -- nykter (nyktert, nyktra, nyktra)
|
|
||||||
adjGalen : Str -> A ; -- galen (galet, galna, galna)
|
|
||||||
adjInvar : Str -> A ; -- bra
|
|
||||||
|
|
||||||
-- Two-place adjectives need a preposition and a case as extra arguments.
|
-- In practice, two forms are enough.
|
||||||
|
|
||||||
mkA2 : A -> Str -> A2 ; -- delbar, med
|
mk2A : (bred,brett : Str) -> A ;
|
||||||
mkA2Reg : Str -> Str -> A2 ; --
|
|
||||||
|
|
||||||
-- Comparison adjectives may need the three four forms for the positive case, plus
|
--3 Two-place adjectives
|
||||||
-- three more forms for the comparison cases.
|
--
|
||||||
|
-- Two-place adjectives need a preposition for their second argument.
|
||||||
|
|
||||||
|
mkA2 : A -> Preposition -> A2 ;
|
||||||
|
|
||||||
|
-- Comparison adjectives may need as many as seven forms.
|
||||||
|
|
||||||
mkADeg : (liten, litet, lilla, sma, mindre, minst, minsta : Str) -> ADeg ;
|
mkADeg : (liten, litet, lilla, sma, mindre, minst, minsta : Str) -> ADeg ;
|
||||||
|
|
||||||
-- Some comparison adjectives are completely regular.
|
-- The regular pattern works for many adjectives, e.g. those ending
|
||||||
|
-- with "ig".
|
||||||
|
|
||||||
aReg : Str -> ADeg ;
|
regADeg : Str -> ADeg ;
|
||||||
|
|
||||||
-- On top level, there are adjectival phrases. The most common case is
|
-- Just the comparison forms can be irregular.
|
||||||
-- just to use a one-place adjective. The variation in $adjGen$ is taken
|
|
||||||
-- into account.
|
irregADeg : (tung,tyngre,tyngst : Str) -> ADeg ;
|
||||||
|
|
||||||
|
-- Sometimes just the positive forms are irregular.
|
||||||
|
|
||||||
|
mk3ADeg : (galen,galet,galna : Str) -> ADeg ;
|
||||||
|
mk2ADeg : (bred,brett : Str) -> ADeg ;
|
||||||
|
|
||||||
|
-- If comparison is formed by "more, "most", as in general for
|
||||||
|
-- long adjective, the following pattern is used:
|
||||||
|
|
||||||
|
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||||
|
|
||||||
|
-- From a given $ADeg$, it is possible to get back to $A$.
|
||||||
|
|
||||||
|
adegA : ADeg -> A ;
|
||||||
|
|
||||||
apReg : Str -> AP ;
|
|
||||||
|
|
||||||
--2 Adverbs
|
--2 Adverbs
|
||||||
|
|
||||||
-- Adverbs are not inflected. Most lexical ones have position not
|
-- Adverbs are not inflected. Most lexical ones have position
|
||||||
-- before the verb. Some can be preverbal (e.g. "alltid").
|
-- after the verb. Some can be preverbal (e.g. "always").
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
mkAdv : Str -> Adv ;
|
||||||
mkAdvPre : Str -> Adv ;
|
mkAdV : Str -> AdV ;
|
||||||
|
|
||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
mkAdA : Str -> AdA ;
|
||||||
mkAdS : Str -> AdS ;
|
|
||||||
|
|
||||||
-- Prepositional phrases are another productive form of adverbials.
|
--2 Prepositions
|
||||||
|
--
|
||||||
mkPP : Str -> NP -> Adv ;
|
-- A preposition is just a string.
|
||||||
|
|
||||||
|
mkPreposition : Str -> Preposition ;
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
-- The fragment only has present tense so far.
|
-- The worst case needs five forms.
|
||||||
-- The worst case needs three forms: the infinitive, the indicative, and the
|
|
||||||
-- imperative.
|
|
||||||
|
|
||||||
Voice: Type;
|
mkV : (supa,super,sup,söp,supit,supen : Str) -> V ;
|
||||||
|
|
||||||
passive : Voice;
|
-- The 'regular verb' function is the first conjugation.
|
||||||
active: Voice;
|
|
||||||
|
|
||||||
mkV : (_,_,_,_,_,_ : Str) -> V ; -- vara, är, var; trivas, trivs, trivs
|
regV : (tala : Str) -> V ;
|
||||||
|
|
||||||
-- The main conjugations need one string each.
|
-- The almost regular verb function needs the infinitive and the present.
|
||||||
|
|
||||||
vKoka : Str -> V ; -- tala (talar, tala)
|
mk2V : (leka,leker : Str) -> V ;
|
||||||
vSteka : Str -> V ; -- leka (leker, lek)
|
|
||||||
---- vBo : Str -> V ; -- bo (bor, bo)
|
|
||||||
|
|
||||||
---- vAndas : Str -> V ; -- andas [all forms the same: also "slåss"]
|
-- There is an extensive list of irregular verbs in the module $IrregularSwe$.
|
||||||
---- vTrivas : Str -> V ; -- trivas (trivs, trivs)
|
-- In practice, it is enough to give three forms, as in school books.
|
||||||
|
|
||||||
-- The verbs 'be' and 'have' are special.
|
irregV : (dricka, drack, druckit : Str) -> V ;
|
||||||
|
|
||||||
vVara : V ;
|
|
||||||
vHa : V ;
|
|
||||||
|
|
||||||
-- Particle verbs are formed by putting together a verb and a particle.
|
|
||||||
-- If the verb already has a particle, it is replaced by the new one.
|
|
||||||
|
|
||||||
mkPartV : V -> Str -> V ; -- stänga av ;
|
|
||||||
|
|
||||||
-- Two-place verbs, and the special case with direct object.
|
|
||||||
|
|
||||||
mkV2 : V -> Str -> V2 ; -- tycka, om
|
|
||||||
tvDir : V -> V2 ; -- gilla
|
|
||||||
|
|
||||||
-- Ditransitive verbs.
|
|
||||||
|
|
||||||
mkV3 : V -> Str -> Str -> V3 ; -- prata, med, om
|
|
||||||
v3Dir : V -> Str -> V3 ; -- ge,_,till
|
|
||||||
v3DirDir : V -> V3 ; -- ge,_,_
|
|
||||||
|
|
||||||
-- Sentence complement verbs.
|
|
||||||
|
|
||||||
mkVS : V -> VS ; -- säga (att ...)
|
|
||||||
|
|
||||||
-- Verb phrase complement verbs.
|
|
||||||
|
|
||||||
vvInf : V -> VV ; -- orka (spela)
|
|
||||||
vvAtt : V -> VV ; -- gilla (att spela)
|
|
||||||
vvBoth : V -> VV ; -- försöka (spela | att spela)
|
|
||||||
|
|
||||||
|
|
||||||
|
--3 Verbs with a particle.
|
||||||
|
--
|
||||||
|
-- The particle, such as in "switch on", is given as a string.
|
||||||
|
|
||||||
|
partV : V -> Str -> V ;
|
||||||
|
|
||||||
|
--3 Deponent verbs.
|
||||||
|
--
|
||||||
|
-- Some words are used in passive forms only, e.g. "hoppas".
|
||||||
|
|
||||||
|
depV : V -> V ;
|
||||||
|
|
||||||
|
--3 Two-place verbs
|
||||||
|
--
|
||||||
|
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||||
|
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||||
|
|
||||||
|
mkV2 : V -> Preposition -> V2 ;
|
||||||
|
|
||||||
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
|
--3 Three-place verbs
|
||||||
|
--
|
||||||
|
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||||
|
-- the first one or both can be absent.
|
||||||
|
|
||||||
|
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||||
|
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||||
|
dirdirV3 : V -> V3 ; -- give,_,_
|
||||||
|
|
||||||
|
--3 Other complement patterns
|
||||||
|
--
|
||||||
|
-- Verbs and adjectives can take complements such as sentences,
|
||||||
|
-- questions, verb phrases, and adjectives.
|
||||||
|
|
||||||
|
mkV0 : V -> V0 ;
|
||||||
|
mkVS : V -> VS ;
|
||||||
|
mkV2S : V -> Str -> V2S ;
|
||||||
|
mkVV : V -> VV ;
|
||||||
|
mkV2V : V -> Str -> Str -> V2V ;
|
||||||
|
mkVA : V -> VA ;
|
||||||
|
mkV2A : V -> Str -> V2A ;
|
||||||
|
mkVQ : V -> VQ ;
|
||||||
|
mkV2Q : V -> Str -> V2Q ;
|
||||||
|
|
||||||
|
mkAS : A -> AS ;
|
||||||
|
mkA2S : A -> Str -> A2S ;
|
||||||
|
mkAV : A -> AV ;
|
||||||
|
mkA2V : A -> Str -> A2V ;
|
||||||
|
|
||||||
|
|
||||||
|
--2 Definitions of the paradigms
|
||||||
|
--
|
||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
-- hidden from the document.
|
-- hidden from the document.
|
||||||
--.
|
--.
|
||||||
|
|
||||||
Gender = SyntaxSwe.Gender ;
|
Gender = SyntaxSwe.NounGender ;
|
||||||
Sex = SyntaxSwe.Sex ;
|
Number = TypesSwe.Number ;
|
||||||
Case = SyntaxSwe.Case ;
|
Case = TypesSwe.Case ;
|
||||||
Number = SyntaxSwe.Number ;
|
utrum = NUtr NoMasc ;
|
||||||
Voice = SyntaxSwe.Voice ;
|
neutrum = NNeutr ;
|
||||||
|
|
||||||
utrum = Utr ;
|
|
||||||
neutrum = Neutr ;
|
|
||||||
masculine = Masc ;
|
|
||||||
nonmasculine = NoMasc ;
|
|
||||||
nominative = Nom ;
|
|
||||||
genitive = Gen ;
|
|
||||||
singular = Sg ;
|
singular = Sg ;
|
||||||
plural = Pl ;
|
plural = Pl ;
|
||||||
|
nominative = Nom ;
|
||||||
|
genitive = Gen ;
|
||||||
|
|
||||||
active = Act;
|
mkN x y z u = extCommNoun (mkNoun x y z u) ** {lock_N = <>} ;
|
||||||
passive = Pass;
|
regN x g = extCommNoun (regNoun x (genNoun g)) ** {lock_N = <>} ;
|
||||||
|
mk2N x g = extCommNoun (reg2Noun x g) ** {lock_N = <>} ;
|
||||||
|
mascN n = {s = n.s ; g = NUtr Masc ; lock_N = <>} ;
|
||||||
|
|
||||||
mkN = \apa, apan, apor, aporna, g, x -> let
|
mkN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
{nom = table {
|
regN2 n g = mkN2 (regN n g) (mkPreposition "av") ;
|
||||||
SF Sg Indef _ => apa ;
|
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
||||||
SF Sg Def _ => apan ;
|
|
||||||
SF Pl Indef _ => apor ;
|
|
||||||
SF Pl Def _ => aporna
|
|
||||||
}
|
|
||||||
} in
|
|
||||||
{s = \\n,d,c => mkCase c (nom ! SF n d Nom) ;
|
|
||||||
g = gensex g x ; lock_N = <>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- auxiliaries
|
regPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ;
|
||||||
mkGenit : Tok -> Tok = \s -> ifTok Tok (Predef.dp 1 s) "s" s (s + "s") ;
|
nounPN n = {s = n.s ! singular ! Indef ; g = n.g ; lock_PN = <>} ;
|
||||||
mkCase : Case -> Tok -> Tok = \c,t -> case c of {
|
mkNP x y n g =
|
||||||
Nom => t ;
|
{s = table {PGen _ => x ; _ => y} ; g = genNoun g ; n = n ; p = P3 ;
|
||||||
Gen => mkGenit t
|
lock_NP = <>} ;
|
||||||
} ;
|
|
||||||
|
|
||||||
nApa = \apa ->
|
mkA a b c = extractPositive (adjAlmostReg a b c) ** {lock_A = <>} ;
|
||||||
let {apor = Predef.tk 1 apa + "or"} in
|
mk2A a b = extractPositive (adj2Reg a b) ** {lock_A = <>} ;
|
||||||
mkN apa (apa + "n") apor (apor + "na") utrum nonmasculine ;
|
regA a = extractPositive (adjReg a) ** {lock_A = <>} ;
|
||||||
|
|
||||||
nBil = \bil ->
|
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
||||||
mkN bil (bil + "en") (bil + "ar") (bil + "arna") utrum nonmasculine ;
|
|
||||||
nKarl = \bil ->
|
|
||||||
mkN bil (bil + "en") (bil + "ar") (bil + "arna") utrum masculine ;
|
|
||||||
nPojke = \pojke ->
|
|
||||||
let {bil = Predef.tk 1 pojke} in
|
|
||||||
mkN pojke (bil + "en") (bil + "ar") (bil + "arna") utrum masculine ;
|
|
||||||
nNyckel = \cykel ->
|
|
||||||
let {cykl = Predef.tk 2 cykel + Predef.dp 1 cykel} in
|
|
||||||
mkN cykel (cykel + "n") (cykl + "ar") (cykl + "arna") utrum nonmasculine ;
|
|
||||||
nRisk = \bil ->
|
|
||||||
mkN bil (bil + "en") (bil + "er") (bil + "erna") utrum nonmasculine ;
|
|
||||||
nDike = \dike ->
|
|
||||||
mkN dike (dike + "t") (dike + "n") (dike + "na") neutrum nonmasculine ;
|
|
||||||
nRep = \rep ->
|
|
||||||
mkN rep (rep + "et") rep (rep + "en") neutrum nonmasculine ;
|
|
||||||
nPapper = \cykel ->
|
|
||||||
let {cykl = Predef.tk 2 cykel + Predef.dp 1 cykel} in
|
|
||||||
mkN cykel (cykl + "et") cykel (cykl + "en") neutrum nonmasculine ;
|
|
||||||
nMurare = \murare ->
|
|
||||||
let {murar = Predef.tk 1 murare} in
|
|
||||||
mkN murare (murar + "en") murare (murar + "na") utrum masculine ;
|
|
||||||
nKikare = \murare ->
|
|
||||||
let {murar = Predef.tk 1 murare} in
|
|
||||||
mkN murare (murar + "en") murare (murar + "na") utrum nonmasculine ;
|
|
||||||
|
|
||||||
|
mkADeg a b c d e f g = mkAdjective a b c d e f g ** {lock_ADeg = <>} ;
|
||||||
|
regADeg a = adjReg a ** {lock_ADeg = <>} ;
|
||||||
|
irregADeg a b c = adjIrreg3 a b c ** {lock_ADeg = <>} ;
|
||||||
|
mk3ADeg a b c = adjAlmostReg a b c ** {lock_ADeg = <>} ;
|
||||||
|
mk2ADeg a b = adj2Reg a b ** {lock_ADeg = <>} ;
|
||||||
|
|
||||||
mkN2 x y = mkFun x y ** {lock_N2 = <>} ;
|
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||||
funAv = \f -> mkN2 f "av" ;
|
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||||
funPaa = \f -> mkN2 f "på" ;
|
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||||
funTill = \f -> mkN2 f "till" ;
|
|
||||||
|
|
||||||
mkPN = \karolus, karoli, g, x ->
|
mkPreposition p = p ;
|
||||||
{s = table {Gen => karoli ; _ => karolus} ; g = gensex g x ; lock_PN = <>} ;
|
|
||||||
pnReg = \horst ->
|
|
||||||
mkPN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) ;
|
|
||||||
pnS = \bk ->
|
|
||||||
mkPN bk (bk + "s") ;
|
|
||||||
|
|
||||||
mkCN = UseN ;
|
mkV a b c d e f = mkVerb a b c d e f ** {s1 = [] ; lock_V = <>} ;
|
||||||
mkNP = \a,b,g -> UsePN (mkPN a b g nonmasculine) ; -- gender irrelevant in NP
|
|
||||||
npReg = \s,g -> UsePN (pnReg s g nonmasculine) ;
|
|
||||||
|
|
||||||
mkA = \liten, litet, lilla, små ->
|
regV a = mk2V a (a + "r") ;
|
||||||
{s = table {
|
mk2V a b = regVerb a b ** {s1 = [] ; lock_V = <>} ;
|
||||||
Strong (ASg Utr) => \\c => mkCase c liten ;
|
|
||||||
Strong (ASg Neutr) => \\c => mkCase c litet ;
|
|
||||||
Strong APl => \\c => mkCase c små ;
|
|
||||||
Weak (AxSg Masc) => \\c => mkCase c (Predef.tk 1 lilla + "e") ;
|
|
||||||
Weak _ => \\c => mkCase c lilla
|
|
||||||
} ;
|
|
||||||
lock_A = <>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
adjReg = \billig -> mkA billig (billig + "t") (billig + "a") (billig + "a") ;
|
irregV x y z = vSälja x y z
|
||||||
adjNykter = \nykter ->
|
** {s1 = [] ; lock_V = <>} ;
|
||||||
let {nyktr = Predef.tk 2 nykter + Predef.dp 1 nykter} in
|
|
||||||
mkA nykter (nykter + "t") (nyktr + "a") (nyktr + "a") ;
|
|
||||||
adjGalen = \galen ->
|
|
||||||
let {gal = Predef.tk 2 galen} in
|
|
||||||
mkA galen (gal + "et") (gal + "na") (gal + "na") ;
|
|
||||||
adjInvar = \bra -> {s = \\_,_ => bra ; lock_A = <>} ;
|
|
||||||
|
|
||||||
mkA2 = \a,p -> a ** {s2 = p ; lock_A2 = <>} ;
|
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
||||||
mkA2Reg = \a -> mkA2 (adjReg a) ;
|
depV v = deponentVerb v ** {lock_V = <>} ;
|
||||||
|
|
||||||
mkADeg = \liten, litet, lilla, sma, mindre, minst, minsta ->
|
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s2 = p ; lock_V2 = <>} ;
|
||||||
let {lit = (mkA liten litet lilla sma).s} in
|
dirV2 v = mkV2 v [] ;
|
||||||
{s = table {
|
|
||||||
AF (Posit f) c => lit ! f ! c ;
|
|
||||||
AF Compar c => mkCase c mindre ;
|
|
||||||
AF (Super SupStrong) c => mkCase c minst ;
|
|
||||||
AF (Super SupWeak) c => mkCase c minsta --- masculine!
|
|
||||||
} ;
|
|
||||||
lock_ADeg = <>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
aReg = \fin -> mkADeg fin
|
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; s2 = p ; s3 = q ; lock_V3 = <>} ;
|
||||||
(fin + "t") (fin + "a") (fin + "a") (fin + "are") (fin + "ast") (fin + "aste") ;
|
dirV3 v p = mkV3 v [] p ;
|
||||||
|
dirdirV3 v = dirV3 v [] ;
|
||||||
apReg = \s -> UseA (adjReg s) ;
|
|
||||||
|
|
||||||
mkAdv a = advPost a ** {lock_Adv = <>} ;
|
|
||||||
mkAdvPre a = advPre a ** {lock_Adv = <>} ;
|
|
||||||
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
|
||||||
mkAdA a = ss a ** {lock_AdA = <>} ;
|
|
||||||
mkAdS a = ss a ** {lock_AdS = <>} ;
|
|
||||||
|
|
||||||
mkV x y z a b c = mkVerb x y z a b c ** {lock_V = <>} ;
|
|
||||||
vKoka = \tala -> vTala (Predef.tk 1 tala) ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
vSteka = \leka -> vLeka (Predef.tk 1 leka) ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
---- vBo = \bo -> mkV bo (bo+"r") bo ;
|
|
||||||
---- vAndas = \andas -> mkV andas andas andas ;
|
|
||||||
---- vTrivas = \trivas ->
|
|
||||||
---- let {trivs = Predef.tk 1 trivas + "s"} in mkV trivas trivs trivs ;
|
|
||||||
vVara = verbVara ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
vHa = verbHava ** {s1 = [] ; lock_V = <>} ;
|
|
||||||
mkPartV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
|
||||||
mkV2 x y = mkTransVerb x y ** {lock_V2 = <>} ;
|
|
||||||
tvDir = \v -> mkV2 v [] ;
|
|
||||||
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
|
||||||
v3Dir x y = mkV3 x [] y ;
|
|
||||||
v3DirDir x = v3Dir x [] ;
|
|
||||||
|
|
||||||
|
mkV0 v = v ** {lock_V0 = <>} ;
|
||||||
mkVS v = v ** {lock_VS = <>} ;
|
mkVS v = v ** {lock_VS = <>} ;
|
||||||
vvInf v = v ** {isAux = True ; lock_VV = <>} ;
|
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
||||||
vvAtt v = v ** {isAux = False ; lock_VV = <>} ;
|
mkVV v = v ** {s3 = "att" ; lock_VV = <>} ;
|
||||||
vvBoth v = v ** {isAux = variants {False ; True} ; lock_VV = <>} ;
|
mkV2V v p t = mkV2 v p ** {s3 = t ; lock_V2V = <>} ;
|
||||||
|
mkVA v = v ** {lock_VA = <>} ;
|
||||||
|
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||||
|
mkVQ v = v ** {lock_VQ = <>} ;
|
||||||
|
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
||||||
|
|
||||||
gensex : Gender -> Sex -> NounGender = \g,x -> case g of {
|
mkAS v = v ** {lock_AS = <>} ;
|
||||||
Utr => NUtr x ;
|
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||||
_ => NNeutr
|
mkAV v = v ** {lock_AV = <>} ;
|
||||||
} ;
|
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -6,14 +6,108 @@
|
|||||||
--
|
--
|
||||||
concrete StructuralSwe of Structural =
|
concrete StructuralSwe of Structural =
|
||||||
CategoriesSwe, NumeralsSwe ** open Prelude, MorphoSwe, SyntaxSwe in {
|
CategoriesSwe, NumeralsSwe ** open Prelude, MorphoSwe, SyntaxSwe in {
|
||||||
|
|
||||||
|
flags optimize=values ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|
||||||
|
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||||
|
|
||||||
|
above_Prep = ss "ovanför" ;
|
||||||
|
after_Prep = ss "efter" ;
|
||||||
|
by8agent_Prep = ss "av" ;
|
||||||
|
all8mass_Det = mkDeterminerSgGender2 "all" "allt" IndefP ;
|
||||||
|
all_NDet = mkDeterminerPlNum "alla" IndefP ;
|
||||||
|
almost_Adv = ss "nästan" ;
|
||||||
|
although_Subj = ss "fast" ;
|
||||||
|
and_Conj = ss "och" ** {n = Pl} ;
|
||||||
|
because_Subj = ss "eftersom" ;
|
||||||
|
before_Prep = ss "före" ;
|
||||||
|
behind_Prep = ss "bakom" ;
|
||||||
|
between_Prep = ss "mellan" ;
|
||||||
|
both_AndConjD = sd2 "både" "och" ** {n = Pl} ;
|
||||||
|
by8means_Prep = ss "med" ;
|
||||||
|
can8know_VV = mkVerb "kunna" "kan" "kunn" "kunde" "kunnat" "kunnen" ** {s3 = []} ;
|
||||||
|
can_VV = mkVerb "kunna" "kan" "kunn" "kunde" "kunnat" "kunnen" ** {s3 = []} ;
|
||||||
|
during_Prep = ss "under" ;
|
||||||
|
either8or_ConjD = sd2 "antingen" "eller" ** {n = Sg} ;
|
||||||
|
everybody_NP = let alla = table {Nom => "alla" ; Gen => "allas"} in
|
||||||
|
{s = \\c => alla ! npCase c ; g = Utr ; n = Pl ; p = P3} ;
|
||||||
|
every_Det = varjeDet ;
|
||||||
|
everything_NP = nameNounPhrase (mkProperName "allting" NNeutr) ;
|
||||||
|
everywhere_Adv = advPost "varstans" ;
|
||||||
|
from_Prep = ss "från" ;
|
||||||
|
he_NP = pronNounPhrase han_34 ;
|
||||||
|
how_IAdv = ss "hur" ;
|
||||||
|
how8many_IDet = mkDeterminerPl ["hur många"] IndefP ;
|
||||||
|
if_Subj = ss "om" ;
|
||||||
|
in8front_Prep = ss "framför" ;
|
||||||
|
i_NP = pronNounPhrase jag_32 ;
|
||||||
|
in_Prep = ss "i" ;
|
||||||
|
it_NP = pronNounPhrase det_40 ; ----
|
||||||
|
|
||||||
|
many_Det = mkDeterminerPl "många" IndefP ;
|
||||||
|
most_Det = mkDeterminerSgGender2 ["den mesta"] ["det mesta"] (DefP Def) ;
|
||||||
|
most8many_Det = flestaDet ;
|
||||||
|
much_Det = mkDeterminerSg (detSgInvar "mycket") IndefP ;
|
||||||
|
must_VV = mkVerb "få" "måste" "få" "fick" "måst" "måst" ** {s3 = []} ;
|
||||||
|
no_Phr = ss ["Nej ."] ;
|
||||||
|
on_Prep = ss "på" ;
|
||||||
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
|
otherwise_Adv = ss "annars" ;
|
||||||
|
part_Prep = ss "av" ;
|
||||||
|
possess_Prep = ss "av" ;
|
||||||
|
quite_Adv = ss "ganska" ;
|
||||||
|
she_NP = pronNounPhrase hon_35 ;
|
||||||
|
so_Adv = ss "så" ;
|
||||||
|
somebody_NP = nameNounPhrase (mkProperName "någon" (NUtr Masc)) ;
|
||||||
|
some_Det = mkDeterminerSgGender2 "någon" "något" IndefP ;
|
||||||
|
some_NDet = mkDeterminerPlNum "några" IndefP ;
|
||||||
|
something_NP = nameNounPhrase (mkProperName "någonting" NNeutr) ;
|
||||||
|
somewhere_Adv = advPost "någonstans" ;
|
||||||
|
that_Det = mkDeterminerSgGender2 ["den där"] ["det där"] (DefP Def) ;
|
||||||
|
that_NP = regNameNounPhrase ["det där"] NNeutr ;
|
||||||
|
therefore_Adv = ss "därför" ;
|
||||||
|
these_NDet = mkDeterminerPlNum ["de här"] (DefP Def) ;
|
||||||
|
they8fem_NP = pronNounPhrase de_38 ;
|
||||||
|
they_NP = pronNounPhrase de_38 ;
|
||||||
|
this_Det = mkDeterminerSgGender2 ["den här"] ["det här"] (DefP Def) ;
|
||||||
|
this_NP = regNameNounPhrase ["det här"] NNeutr ;
|
||||||
|
those_NDet = mkDeterminerPlNum ["de där"] (DefP Def) ;
|
||||||
|
thou_NP = pronNounPhrase du_33 ;
|
||||||
|
through_Prep = ss "genom" ;
|
||||||
|
too_Adv = ss "för" ;
|
||||||
|
to_Prep = ss "till" ;
|
||||||
|
under_Prep = ss "under" ;
|
||||||
|
very_Adv = ss "mycket" ;
|
||||||
|
want_VV = mkVerb "vilja" "vill" "vilj" "ville" "velat" "velad" ** {s3 = []} ;
|
||||||
|
we_NP = pronNounPhrase (vi_36) ;
|
||||||
|
what8many_IP = intPronWhat plural ;
|
||||||
|
what8one_IP = intPronWhat singular ;
|
||||||
|
when_IAdv = ss "när" ;
|
||||||
|
when_Subj = ss "när" ;
|
||||||
|
where_IAdv = ss "var" ;
|
||||||
|
which8one_IDet = vilkenDet ;
|
||||||
|
which8many_IDet = mkDeterminerPl "vilka" IndefP ;
|
||||||
|
who8many_IP = intPronWho plural ;
|
||||||
|
who8one_IP = intPronWho singular ;
|
||||||
|
why_IAdv = ss "varför" ;
|
||||||
|
without_Prep = ss "utan" ;
|
||||||
|
with_Prep = ss "med" ;
|
||||||
|
ye_NP = pronNounPhrase (ni_37) ;
|
||||||
|
yes_Phr = ss ["Ja ."] ;
|
||||||
|
you_NP = let {ni = pronNounPhrase ni_37 } in {
|
||||||
|
s = ni.s ; g = ni.g ; n = Sg ; p = P2} ; ---- gives wrong refl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{-
|
||||||
INP = pronNounPhrase jag_32 ;
|
INP = pronNounPhrase jag_32 ;
|
||||||
ThouNP = pronNounPhrase du_33 ;
|
ThouNP = pronNounPhrase du_33 ;
|
||||||
HeNP = pronNounPhrase han_34 ;
|
HeNP = pronNounPhrase han_34 ;
|
||||||
SheNP = pronNounPhrase hon_35 ;
|
SheNP = pronNounPhrase hon_35 ;
|
||||||
WeNumNP n = pronNounPhrase (pronWithNum vi_36 n) ;
|
WeNP n = pronNounPhrase (vi_36 n) ;
|
||||||
YeNumNP n = pronNounPhrase (pronWithNum ni_37 n) ;
|
YeNP n = pronNounPhrase (ni_37 n) ;
|
||||||
TheyNP = pronNounPhrase de_38 ;
|
TheyNP = pronNounPhrase de_38 ;
|
||||||
TheyFemNP = pronNounPhrase de_38 ;
|
TheyFemNP = pronNounPhrase de_38 ;
|
||||||
|
|
||||||
@@ -23,10 +117,6 @@ concrete StructuralSwe of Structural =
|
|||||||
ItNP = pronNounPhrase det_40 ; ----
|
ItNP = pronNounPhrase det_40 ; ----
|
||||||
ThisNP = regNameNounPhrase ["det här"] NNeutr ;
|
ThisNP = regNameNounPhrase ["det här"] NNeutr ;
|
||||||
ThatNP = regNameNounPhrase ["det där"] NNeutr ;
|
ThatNP = regNameNounPhrase ["det där"] NNeutr ;
|
||||||
TheseNumNP n =
|
|
||||||
{s = \\c => ["de här"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p = P3} ;
|
|
||||||
ThoseNumNP n =
|
|
||||||
{s = \\c => ["de där"] ++ n.s ! npCase c ; g = Neutr ; n = Pl ; p = P3} ;
|
|
||||||
|
|
||||||
EveryDet = varjeDet ;
|
EveryDet = varjeDet ;
|
||||||
AllMassDet = mkDeterminerSgGender2 "all" "allt" IndefP ;
|
AllMassDet = mkDeterminerSgGender2 "all" "allt" IndefP ;
|
||||||
@@ -66,16 +156,16 @@ concrete StructuralSwe of Structural =
|
|||||||
IfSubj = ss "om" ;
|
IfSubj = ss "om" ;
|
||||||
WhenSubj = ss "när" ;
|
WhenSubj = ss "när" ;
|
||||||
|
|
||||||
PhrYes = ss ["Ja ."] ;
|
YesPhr = ss ["Ja ."] ;
|
||||||
PhrNo = ss ["Nej ."] ;
|
NoPhr = ss ["Nej ."] ;
|
||||||
|
|
||||||
VeryAdv = ss "mycket" ;
|
VeryAdv = ss "mycket" ;
|
||||||
TooAdv = ss "för" ;
|
TooAdv = ss "för" ;
|
||||||
|
SoAdv = ss "så" ;
|
||||||
OtherwiseAdv = ss "annars" ;
|
OtherwiseAdv = ss "annars" ;
|
||||||
ThereforeAdv = ss "därför" ;
|
ThereforeAdv = ss "därför" ;
|
||||||
|
|
||||||
EverybodyNP = let alla = table {Nom => "alla" ; Gen => "allas"} in
|
EverybodyNP = let alla = table {Nom => "alla" ; Gen => "allas"} in {s = \\c => alla ! npCase c ; g = Utr ; n = Pl ; p = P3} ;
|
||||||
{s = \\c => alla ! npCase c ; g = Utr ; n = Pl ; p = P3} ;
|
|
||||||
SomebodyNP = nameNounPhrase (mkProperName "någon" (NUtr Masc)) ;
|
SomebodyNP = nameNounPhrase (mkProperName "någon" (NUtr Masc)) ;
|
||||||
NobodyNP = nameNounPhrase (mkProperName "ingen" (NUtr Masc)) ;
|
NobodyNP = nameNounPhrase (mkProperName "ingen" (NUtr Masc)) ;
|
||||||
EverythingNP = nameNounPhrase (mkProperName "allting" NNeutr) ;
|
EverythingNP = nameNounPhrase (mkProperName "allting" NNeutr) ;
|
||||||
@@ -115,5 +205,7 @@ concrete StructuralSwe of Structural =
|
|||||||
PossessPrep = ss "av" ;
|
PossessPrep = ss "av" ;
|
||||||
PartPrep = ss "av" ;
|
PartPrep = ss "av" ;
|
||||||
AgentPrep = ss "av" ;
|
AgentPrep = ss "av" ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
34
lib/resource/swedish/TimeSwe.gf
Normal file
34
lib/resource/swedish/TimeSwe.gf
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
concrete TimeSwe of Time = NumeralsSwe **
|
||||||
|
open Prelude, MorphoSwe, ResourceSwe, ParadigmsSwe in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Date = SS ;
|
||||||
|
Weekday = N ;
|
||||||
|
Hour = SS ;
|
||||||
|
Minute = SS ;
|
||||||
|
Time = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
DayDate day = ss (day.s ! singular ! Indef ! nominative) ;
|
||||||
|
DayTimeDate day time = ss (day.s ! singular ! Indef ! nominative ++ "klockan" ++ time.s) ;
|
||||||
|
|
||||||
|
FormalTime = infixSS "och" ;
|
||||||
|
PastTime h m = ss (m.s ++ "över" ++ h.s) ;
|
||||||
|
ToTime h m = ss (m.s ++ "i" ++ h.s) ;
|
||||||
|
ExactTime h = ss (h.s ++ "prick") ;
|
||||||
|
|
||||||
|
NumHour n = n ;
|
||||||
|
NumMinute n = n ;
|
||||||
|
|
||||||
|
monday = regN "måndag" utrum ;
|
||||||
|
tuesday = regN "tisdag" utrum ;
|
||||||
|
wednesday = regN "onsdag" utrum ;
|
||||||
|
thursday = regN "torsdag" utrum ;
|
||||||
|
friday = regN "fredag" utrum ;
|
||||||
|
saturday = regN "lördag" utrum ;
|
||||||
|
sunday = regN "söndag" utrum ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
@@ -82,8 +82,10 @@ pm, print_multigrammar: pm
|
|||||||
(Automatically executes the strip command (s) before doing this.)
|
(Automatically executes the strip command (s) before doing this.)
|
||||||
options:
|
options:
|
||||||
-utf8 apply UTF8-encoding to the grammar
|
-utf8 apply UTF8-encoding to the grammar
|
||||||
|
-graph print module dependency graph in 'dot' format
|
||||||
examples:
|
examples:
|
||||||
pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm
|
pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm
|
||||||
|
pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'
|
||||||
|
|
||||||
po, print_options: po
|
po, print_options: po
|
||||||
Print what modules there are in the state. Also
|
Print what modules there are in the state. Also
|
||||||
|
|||||||
@@ -111,8 +111,10 @@ txtHelpFile =
|
|||||||
"\n (Automatically executes the strip command (s) before doing this.)" ++
|
"\n (Automatically executes the strip command (s) before doing this.)" ++
|
||||||
"\n options:" ++
|
"\n options:" ++
|
||||||
"\n -utf8 apply UTF8-encoding to the grammar" ++
|
"\n -utf8 apply UTF8-encoding to the grammar" ++
|
||||||
|
"\n -graph print module dependency graph in 'dot' format" ++
|
||||||
"\n examples:" ++
|
"\n examples:" ++
|
||||||
"\n pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm" ++
|
"\n pm | wf Letter.gfcm -- print the grammar into the file Letter.gfcm" ++
|
||||||
|
"\n pm -printer=graph | wf D.dot -- then do 'dot -Tps D.dot > D.ps'" ++
|
||||||
"\n" ++
|
"\n" ++
|
||||||
"\npo, print_options: po" ++
|
"\npo, print_options: po" ++
|
||||||
"\n Print what modules there are in the state. Also" ++
|
"\n Print what modules there are in the state. Also" ++
|
||||||
|
|||||||
Reference in New Issue
Block a user