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

Commit

Permalink
[PT] Adds contractions of preposition 'desse' and 'deste' (of this) a…
Browse files Browse the repository at this point in the history
…s current moment (#218)

* Adds contractions of preposition 'desse' and 'deste' (of this) as current moment.

* PT - Update rules time regex with contractions: deste, desse, neste, nesta
  • Loading branch information
Godoy authored and ar7hur committed May 22, 2017
1 parent def8d25 commit 79a00a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions resources/languages/pt/corpus/time.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
"ja"
"nesse instante"
"neste instante"
"desse instante"
"deste instante"
(datetime 2013 2 12 4 30 00)

"hoje"
"nesse momento"
"neste momento"
"desse momento"
"deste momento"
(datetime 2013 2 12)

"ontem"
Expand Down
6 changes: 3 additions & 3 deletions resources/languages/pt/rules/time.clj
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@
; "this Monday" => next week if today is Monday

"this|next <day-of-week>"
[#"(?i)es[ts][ae]|pr[óo]xim[ao]" {:form :day-of-week}]
[#"(?i)[nd]?es[ts][ae]|pr[óo]xim[ao]" {:form :day-of-week}]
(pred-nth-not-immediate %2 0)

;; for other preds, it can be immediate:
;; "this month" => now is part of it
; See also: cycles in en.cycles.clj

"this <time>"
[#"(?i)es[ts][ae]" (dim :time)]
[#"(?i)[nd]?es[ts][ae]" (dim :time)]
(pred-nth %2 0)

"next <time>"
Expand Down Expand Up @@ -372,7 +372,7 @@
(assoc (intersect (cycle-nth :day 0) %2) :form :part-of-day) ;; removes :latent

"<part-of-day> dessa semana"
[(dim :time #(not (:latent %))) #"(?i)(d?es[ts]a semana)|agora"]
[(dim :time #(not (:latent %))) #"(?i)([nd]?es[ts]a semana)|agora"]
(assoc (intersect (cycle-nth :day 0) %1) :form :part-of-day) ;; removes :latent

; ;specific rule to address "3 in the morning","3h du matin" and extend morning span from 0 to 12
Expand Down

0 comments on commit 79a00a4

Please sign in to comment.