From b2a0f252b07ac746a3106e9026a0b58bc4490a35 Mon Sep 17 00:00:00 2001 From: odanoburu Date: Mon, 26 Nov 2018 11:14:48 -0200 Subject: [PATCH] (Construction) add timeunitRange - fix documentation comments --- src/abstract/Construction.gf | 7 ++++--- src/english/ConstructionEng.gf | 2 ++ src/portuguese/ConstructionPor.gf | 9 ++++----- src/portuguese/DiffPor.gf | 10 ++++++++-- src/portuguese/ResPor.gf | 1 + 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/abstract/Construction.gf b/src/abstract/Construction.gf index ca2b39d72..69f5d1b4e 100644 --- a/src/abstract/Construction.gf +++ b/src/abstract/Construction.gf @@ -78,7 +78,8 @@ cat Year ; fun - timeunitAdv : Card -> Timeunit -> Adv ; -- (for) three hours + timeunitAdv : Card -> Timeunit -> Adv ; -- (for) three hours + timeunitRange : Card -> Card -> Timeunit -> Adv ; -- (cats live) ten to twenty years oneHour : Hour ; twoHour : Hour ; @@ -105,8 +106,8 @@ fun twentyThreeHour : Hour ; twentyFourHour : Hour ; - timeHour : Hour -> Adv ; -- at three (o'clock / am / pm) - timeHourMinute : Hour -> Card -> Adv ; -- at forty past six + timeHour : Hour -> Adv ; -- at three a.m./p.m. + timeHourMinute : Hour -> Card -> Adv ; -- at six forty a.m./p.m. weekdayPunctualAdv : Weekday -> Adv ; -- on Monday weekdayHabitualAdv : Weekday -> Adv ; -- on Mondays diff --git a/src/english/ConstructionEng.gf b/src/english/ConstructionEng.gf index d0e6b591f..a12cc46cb 100644 --- a/src/english/ConstructionEng.gf +++ b/src/english/ConstructionEng.gf @@ -74,6 +74,8 @@ lincat n_hours_NP : NP = mkNP n_card time ; in Sy.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ; + timeunitRange l u time = {s = l.s ! True ! R.Nom ++ to_Prep.s ++ u.s ! True ! R.Nom ++ time.s ! R.Pl ! R.Nom} ; + oneHour = mkHour "1" True ; twoHour = mkHour "2" True ; threeHour = mkHour "3" True ; diff --git a/src/portuguese/ConstructionPor.gf b/src/portuguese/ConstructionPor.gf index f3409985c..5803e813a 100644 --- a/src/portuguese/ConstructionPor.gf +++ b/src/portuguese/ConstructionPor.gf @@ -69,6 +69,8 @@ lin let n_card : Card = lin Card n; n_hours_NP : NP = mkNP n_card time ; in S.mkAdv for_Prep n_hours_NP | S.mkAdv to_Prep n_hours_NP ;--| S.mkAdv (n_hours_NP.s ! R.Nom) ; + timeunitRange l u time = {s = "de" ++ l.s ! time.g + ++ "a" ++ u.s ! time.g ++ time.s ! u.n } ; oneHour = mkHour "1" Manha Sg ; twoHour = mkHour "2" Manha Pl ; @@ -95,12 +97,12 @@ lin twentyThreeHour = mkHour "23" Noite Pl ; twentyFourHour = {s = "meia-noite" ; pe = None ; n = Sg} ; - timeHour h = mkAdv (a ! h.n ++ h.s ++ period ! h.pe) ; + timeHour h = mkAdv (R.a ! Fem ! h.n ++ h.s ++ period ! h.pe) ; timeHourMinute h m = let min = m.s ! Masc in - mkAdv (a ! h.n ++ h.s ++ "e" ++ min ++ period ! h.pe) ; + mkAdv (R.a ! Fem ! h.n ++ h.s ++ "e" ++ min ++ period ! h.pe) ; oper mkHour : Str -> Period -> Number -> {s : Str ; pe : Period ; n : Number} ; @@ -114,9 +116,6 @@ lin None => "" } ; - a : Number => Str ; - a = numForms "à" "às" ; - lin weekdayPunctualAdv w = lin Adv {s = w.s ! C.Sg} ; -- lundi weekdayHabitualAdv w = SyntaxPor.mkAdv noPrep (mkNP the_Det w) ; -- il lunedí ---- diff --git a/src/portuguese/DiffPor.gf b/src/portuguese/DiffPor.gf index c8cfc5981..16cd4d118 100644 --- a/src/portuguese/DiffPor.gf +++ b/src/portuguese/DiffPor.gf @@ -106,12 +106,18 @@ instance DiffPor of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRo partitive = \_,c -> prepCase c ; oper + a : Gender => Number => Str ; + a = genNumForms "a" "à" "aos" "às" ; + + de : Gender => Number => Str ; + de = genNumForms "do" "da" "dos" "das" ; + artDef : Bool -> Gender -> Number -> Case -> Str ; -- not sure if isNP is relevant artDef _isNP g n c = case c of { Nom | Acc => genNumForms "o" "a" "os" "as" ; - CPrep P_de => genNumForms "do" "da" "dos" "das" ; - CPrep P_a => genNumForms "ao" "à" "aos" "às" ; + CPrep P_de => de ; + CPrep P_a => a ; CPrep P_em => genNumForms "no" "na" "nos" "nas" ; CPrep P_por => genNumForms "pelo" "pela" "pelos" "pelas" } ! g ! n ; diff --git a/src/portuguese/ResPor.gf b/src/portuguese/ResPor.gf index f75f9df39..dcd9c98df 100644 --- a/src/portuguese/ResPor.gf +++ b/src/portuguese/ResPor.gf @@ -9,4 +9,5 @@ instance ResPor of ResRomance = DiffPor ** open CommonRomance, Prelude in { oper vowel : pattern Str = #("a" | "e" | "i" | "o" | "u") ; + } ;