diff --git a/lib/src/abstract/Cat.gf b/lib/src/abstract/Cat.gf index 0a1cebaf4..7c4bcf3f9 100644 --- a/lib/src/abstract/Cat.gf +++ b/lib/src/abstract/Cat.gf @@ -12,7 +12,7 @@ -- implementation in all languages in the resource (typically, -- just a string). These categories are -- $AdA, AdN, AdV, Adv, Ant, CAdv, IAdv, PConj, Phr$, --- $Pol, SC, Tense, Text, Utt, Voc$. +-- $Pol, SC, Tense, Text, Utt, Voc, Interj$. -- -- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$ -- are defined on $Conjunction$ and only used locally there. diff --git a/lib/src/abstract/Common.gf b/lib/src/abstract/Common.gf index 773cc4a75..12c810514 100644 --- a/lib/src/abstract/Common.gf +++ b/lib/src/abstract/Common.gf @@ -15,10 +15,11 @@ abstract Common = { -- Constructed in [``Phrase`` Phrase.html]: - Phr ; -- phrase in a text e.g. "but be quiet please" - Utt ; -- sentence, question, word... e.g. "be quiet" - Voc ; -- vocative or "please" e.g. "my darling" - PConj ; -- phrase-beginning conjunction e.g. "therefore" + Phr ; -- phrase in a text e.g. "but be quiet please" + Utt ; -- sentence, question, word... e.g. "be quiet" + Voc ; -- vocative or "please" e.g. "my darling" + PConj ; -- phrase-beginning conjunction e.g. "therefore" + Interj ; -- interjection e.g. "alas" -- Constructed in [``Sentence`` Sentence.html]: diff --git a/lib/src/abstract/Lexicon.gf b/lib/src/abstract/Lexicon.gf index 9017f2101..07e401137 100644 --- a/lib/src/abstract/Lexicon.gf +++ b/lib/src/abstract/Lexicon.gf @@ -2,6 +2,7 @@ abstract Lexicon = Cat ** { fun add_V3 : V3 ; airplane_N : N ; + alas_Interj : Interj ; already_Adv : Adv ; animal_N : N ; answer_V2S : V2S ; diff --git a/lib/src/abstract/Phrase.gf b/lib/src/abstract/Phrase.gf index 0951f4ae6..84af913e8 100644 --- a/lib/src/abstract/Phrase.gf +++ b/lib/src/abstract/Phrase.gf @@ -23,17 +23,18 @@ abstract Phrase = Cat ** { -- Moreover, in many languages e.g. noun phrases in different cases -- can be used. - UttIP : IP -> Utt ; -- who - UttIAdv : IAdv -> Utt ; -- why - UttNP : NP -> Utt ; -- this man - UttAdv : Adv -> Utt ; -- here - UttVP : VP -> Utt ; -- to sleep - UttCN : CN -> Utt ; -- house - UttCard : Card -> Utt ; -- five - UttAP : AP -> Utt ; -- fine + UttIP : IP -> Utt ; -- who + UttIAdv : IAdv -> Utt ; -- why + UttNP : NP -> Utt ; -- this man + UttAdv : Adv -> Utt ; -- here + UttVP : VP -> Utt ; -- to sleep + UttCN : CN -> Utt ; -- house + UttCard : Card -> Utt ; -- five + UttAP : AP -> Utt ; -- fine + UttInterj : Interj -> Utt ; -- alas -- The phrasal conjunction is optional. A sentence conjunction --- can also used to prefix an utterance. +-- can also be used to prefix an utterance. NoPConj : PConj ; PConjConj : Conj -> PConj ; -- and diff --git a/lib/src/common/CommonX.gf b/lib/src/common/CommonX.gf index 3cee26a12..3052a0649 100644 --- a/lib/src/common/CommonX.gf +++ b/lib/src/common/CommonX.gf @@ -1,18 +1,19 @@ concrete CommonX of Common = open (R = ParamX) in { lincat - Text = {s : Str} ; --lock_Text : {}} ; - Phr = {s : Str} ; --lock_Phr : {}} ; - Utt = {s : Str} ; --lock_Utt : {}} ; - Voc = {s : Str} ; --lock_Voc : {}} ; - SC = {s : Str} ; --lock_SC : {}} ; - Adv = {s : Str} ; --lock_Adv : {}} ; - AdV = {s : Str} ; --lock_AdV : {}} ; - AdA = {s : Str} ; --lock_AdA : {}} ; - AdN = {s : Str} ; --lock_AdN : {}} ; - IAdv = {s : Str} ; --lock_IAdv : {}} ; - CAdv = {s,p : Str} ; --lock_CAdv : {}} ; - PConj = {s : Str} ; --lock_PConj : {}} ; + Text = {s : Str} ; + Phr = {s : Str} ; + Utt = {s : Str} ; + Voc = {s : Str} ; + SC = {s : Str} ; + Adv = {s : Str} ; + AdV = {s : Str} ; + AdA = {s : Str} ; + AdN = {s : Str} ; + IAdv = {s : Str} ; + CAdv = {s,p : Str} ; + PConj = {s : Str} ; + Interj = {s : Str} ; Temp = {s : Str ; t : R.Tense ; a : R.Anteriority} ; Tense = {s : Str ; t : R.Tense} ; diff --git a/lib/src/english/LexiconEng.gf b/lib/src/english/LexiconEng.gf index 3d0147e4b..7164f227f 100644 --- a/lib/src/english/LexiconEng.gf +++ b/lib/src/english/LexiconEng.gf @@ -8,6 +8,7 @@ flags lin airplane_N = regN "airplane" ; + alas_Interj = ss "alas" ; answer_V2S = mkV2S (mkV "answer" "answered") toP ; apartment_N = regN "apartment" ; apple_N = regN "apple" ; diff --git a/lib/src/english/ParadigmsEng.gf b/lib/src/english/ParadigmsEng.gf index 854c350c7..d458f8b69 100644 --- a/lib/src/english/ParadigmsEng.gf +++ b/lib/src/english/ParadigmsEng.gf @@ -60,6 +60,10 @@ oper -- Prepositions are used in many-argument functions for rection. -- The resource category $Prep$ is used. +-- The number of a noun phrase can be extracted with the following +-- function. + + npNumber : NP -> Number ; --2 Nouns @@ -341,6 +345,8 @@ mkSubj : Str -> Subj = \s -> lin Subj {s = s} ; nominative = Nom ; genitive = Gen ; + npNumber np = (fromAgr np.a).n ; + Preposition : Type = Str ; -- obsolete regN = \ray -> diff --git a/lib/src/english/PhraseEng.gf b/lib/src/english/PhraseEng.gf index 5241a5709..cee682fc4 100644 --- a/lib/src/english/PhraseEng.gf +++ b/lib/src/english/PhraseEng.gf @@ -17,6 +17,7 @@ concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in { UttCN n = {s = n.s ! Sg ! Nom} ; UttCard n = {s = n.s ! Nom} ; UttAP ap = {s = ap.s ! agrP3 Sg} ; + UttInterj i = i ; NoPConj = {s = []} ; PConjConj conj = {s = conj.s2} ; ---