Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dateparser/data/date_translation_data/it.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"skip": [
"circa",
"e",
"alle",
" ",
"'",
",",
Expand All @@ -277,6 +278,9 @@
"simplifications": [
{
"(\\d++[.,]?\\d*+)\\s+ora": "\\1 ore"
},
{
"\\bun[' ]ora\\b": "1 ore"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
skip: ["circa", "e"]
skip: ["circa", "e", "alle"]

sentence_splitter_group : 1

Expand Down Expand Up @@ -28,3 +28,4 @@ relative-type:

simplifications:
- (\d+[.,]?\d*)\s+ora: \1 ore
- \bun[' ]ora\b: 1 ore
6 changes: 6 additions & 0 deletions tests/test_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,12 @@ def test_translation(self, shortname, datetime_string, expected_translation):
param("it", "oggi", "0 day ago"),
param("it", "2 settimana fa", "2 week ago"),
param("it", "2 anno fa", "2 year ago"),
param("it", "un ora fa", "1 hour ago"),
param("it", "un'ora fa", "1 hour ago"),
param("it", "oggi alle 11:00", "0 day ago 11:00"),
param("it", "oggi 11:00", "0 day ago 11:00"),
# "un'ora" simplification must not corrupt words like "orario"
param("it", "un orario", "un orario"),
# Portuguese
param("pt", "anteontem", "2 day ago"),
param("pt", "ontem", "1 day ago"),
Expand Down
Loading