1
0
forked from GitHub/gf-rgl

(Construction) add timeunitRange

- fix documentation comments
This commit is contained in:
odanoburu
2018-11-26 11:14:48 -02:00
parent 28bc19f09c
commit b2a0f252b0
5 changed files with 19 additions and 10 deletions

View File

@@ -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

View File

@@ -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 ;

View File

@@ -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í ----

View File

@@ -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 ;

View File

@@ -9,4 +9,5 @@
instance ResPor of ResRomance = DiffPor ** open CommonRomance, Prelude in {
oper
vowel : pattern Str = #("a" | "e" | "i" | "o" | "u") ;
} ;