Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Commit

Permalink
[PT] Removing unnecessary prefix in some cycle rules (#161) (#199)
Browse files Browse the repository at this point in the history
* #98, #101, Holidays

* removing unnecessary prefix for cycle rules
  • Loading branch information
gnardari authored and Laurent Landowski committed Jan 28, 2017
1 parent eddf52c commit d653354
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions resources/languages/pt/corpus/time.clj
Original file line number Diff line number Diff line change
Expand Up @@ -164,28 +164,28 @@
"esta semana"
(datetime 2013 2 11 :grain :week)

"a semana passada"
"semana passada"
(datetime 2013 2 4 :grain :week)

"a semana que vem"
"a proxima semana"
"semana que vem"
"proxima semana"
(datetime 2013 2 18 :grain :week)

"o mês passado"
"mês passado"
(datetime 2013 1)

"o mes que vem"
"o próximo mês"
"mes que vem"
"próximo mês"
(datetime 2013 3)

"o ano passado"
"ano passado"
(datetime 2012)

"este ano"
(datetime 2013)

"o ano que vem"
"o proximo ano"
"ano que vem"
"proximo ano"
(datetime 2014)

"domingo passado"
Expand Down
30 changes: 15 additions & 15 deletions resources/languages/pt/rules/cycles.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@
#"(?i)m[eê]s(es)?"
{:dim :cycle
:grain :month}

"ano (cycle)"
#"(?i)anos?"
{:dim :cycle
:grain :year}

"este <cycle>"
[#"(?i)(n?es[st](es?|as?))" (dim :cycle)]
(cycle-nth (:grain %2) 0)

"o <cycle> passado"
[#"(?i)os?|as?" (dim :cycle) #"(?i)passad(a|o)s?"]
(cycle-nth (:grain %2) -1)
"<cycle> passado"
[(dim :cycle) #"(?i)passad(a|o)s?"]
(cycle-nth (:grain %1) -1)

"no <cycle> (que vem)"
[#"(?i)n?as?|n?os?" (dim :cycle) #"(?i)que vem|seguintes?"]
"<cycle> (que vem)"
[(dim :cycle) #"(?i)que vem|seguintes?"]
(cycle-nth (:grain %1) 1)

"proximo <cycle>"
[#"(?i)pr(ó|o)xim(o|a)s?" (dim :cycle)]
(cycle-nth (:grain %2) 1)

"no proximo <cycle> "
[#"(?i)n?as?|n?os?" #"(?i)pr(ó|o)xim(o|a)s?" (dim :cycle)]
(cycle-nth (:grain %3) 1)

"o <cycle> antes de <time>"
[#"(?i) n?as?|n?os?" (dim :cycle) #"(?i)antes d[eo]" (dim :time)]
(cycle-nth-after (:grain %2) -1 %4)
"<cycle> antes de <time>"
[(dim :cycle) #"(?i)antes d[eo]" (dim :time)]
(cycle-nth-after (:grain %1) -1 %3)

"passados n <cycle>"
[#"(?i)passad(a|o)s?" (integer 2 9999) (dim :cycle)]
Expand All @@ -67,7 +67,7 @@
"n passados <cycle>"
[(integer 2 9999) #"(?i)passad(a|o)s?" (dim :cycle)]
(cycle-n-not-immediate (:grain %3) (- (:value %1)))

"proximas n <cycle>"
[#"(?i)pr(ó|o)xim(o|a)s?" (integer 2 9999) (dim :cycle)]
(cycle-n-not-immediate (:grain %3) (:value %2))
Expand Down

0 comments on commit d653354

Please sign in to comment.