Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spaces in langs with no word spacing #917

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 14 additions & 14 deletions dateparser/data/date_translation_data/ja.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,59 +176,59 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) 日前",
"(\\d+)\\s?日前",
"(\\d+)日前"
],
"\\1 hour ago": [
"(\\d+) 時間前",
"(\\d+)\\s?時間前",
"(\\d+)時間前"
],
"\\1 minute ago": [
"(\\d+) 分前",
"(\\d+)\\s?分前",
"(\\d+)分前"
],
"\\1 month ago": [
"(\\d+) か月前",
"(\\d+)\\s?か月前",
"(\\d+)か月前"
],
"\\1 second ago": [
"(\\d+) 秒前",
"(\\d+)\\s?秒前",
"(\\d+)秒前"
],
"\\1 week ago": [
"(\\d+) 週間前",
"(\\d+)\\s?週間前",
"(\\d+)週間前"
],
"\\1 year ago": [
"(\\d+) 年前",
"(\\d+)\\s?年前",
"(\\d+)年前"
],
"in \\1 day": [
"(\\d+) 日後",
"(\\d+)\\s?日後",
"(\\d+)日後"
],
"in \\1 hour": [
"(\\d+) 時間後",
"(\\d+)\\s?時間後",
"(\\d+)時間後"
],
"in \\1 minute": [
"(\\d+) 分後",
"(\\d+)\\s?分後",
"(\\d+)分後"
],
"in \\1 month": [
"(\\d+) か月後",
"(\\d+)\\s?か月後",
"(\\d+)か月後"
],
"in \\1 second": [
"(\\d+) 秒後",
"(\\d+)\\s?秒後",
"(\\d+)秒後"
],
"in \\1 week": [
"(\\d+) 週間後",
"(\\d+)\\s?週間後",
"(\\d+)週間後"
],
"in \\1 year": [
"(\\d+) 年後",
"(\\d+)\\s?年後",
"(\\d+)年後"
]
},
Expand Down
58 changes: 30 additions & 28 deletions dateparser/data/date_translation_data/th.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,63 +195,64 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) วันที่ผ่านมา",
"(\\d+) วันที่แล้ว"
"(\\d+)\\s?วันที่ผ่านมา",
"(\\d+)\\s?วันที่แล้ว"
],
"\\1 hour ago": [
"(\\d+) ชม ที่แล้ว",
"(\\d+) ชั่วโมงที่ผ่านมา"
"(\\d+)\\s?ชม\\s?ที่แล้ว",
"(\\d+)\\s?ชั่วโมงที่ผ่านมา"
],
"\\1 minute ago": [
"(\\d+) นาทีที่ผ่านมา",
"(\\d+) นาทีที่แล้ว"
"(\\d+)\\s?นาทีที่ผ่านมา",
"(\\d+)\\s?นาทีที่แล้ว"
],
"\\1 month ago": [
"(\\d+) เดือนที่ผ่านมา",
"(\\d+) เดือนที่แล้ว"
"(\\d+)\\s?เดือนที่ผ่านมา",
"(\\d+)\\s?เดือนที่แล้ว"
],
"\\1 second ago": [
"(\\d+) วินาทีที่ผ่านมา",
"(\\d+) วินาทีที่แล้ว"
"(\\d+)\\s?วินาทีที่ผ่านมา",
"(\\d+)\\s?วินาทีที่แล้ว"
],
"\\1 week ago": [
"(\\d+) สัปดาห์ที่ผ่านมา",
"(\\d+) สัปดาห์ที่แล้ว"
"(\\d+)\\s?สัปดาห์ที่ผ่านมา",
"(\\d+)\\s?สัปดาห์ที่แล้ว"
],
"\\1 year ago": [
"(\\d+) ปีที่แล้ว"
"(\\d+)\\s?ปีที่แล้ว"
],
"in \\1 day": [
"ใน (\\d+) วัน",
"ในอีก (\\d+) วัน"
"ใน\\s?(\\d+)\\s?วัน",
"ในอีก\\s?(\\d+)\\s?วัน"
],
"in \\1 hour": [
"ใน (\\d+) ชม",
"ในอีก (\\d+) ชั่วโมง"
"ใน\\s?(\\d+)\\s?ชม",
"ในอีก\\s?(\\d+)\\s?ชั่วโมง"
],
"in \\1 minute": [
"ใน (\\d+) นาที",
"ในอีก (\\d+) นาที"
"ใน\\s?(\\d+)\\s?นาที",
"ในอีก\\s?(\\d+)\\s?นาที"
],
"in \\1 month": [
"ใน (\\d+) เดือน",
"ในอีก (\\d+) เดือน"
"ใน\\s?(\\d+)\\s?เดือน",
"ในอีก\\s?(\\d+)\\s?เดือน"
],
"in \\1 second": [
"ใน (\\d+) วินาที",
"ในอีก (\\d+) วินาที"
"ใน\\s?(\\d+)\\s?วินาที",
"ในอีก\\s?(\\d+)\\s?วินาที"
],
"in \\1 week": [
"ใน (\\d+) สัปดาห์",
"ในอีก (\\d+) สัปดาห์"
"ใน\\s?(\\d+)\\s?สัปดาห์",
"ในอีก\\s?(\\d+)\\s?สัปดาห์"
],
"in \\1 year": [
"ใน (\\d+) ปี",
"ในอีก (\\d+) ปี"
"ใน\\s?(\\d+)\\s?ปี",
"ในอีก\\s?(\\d+)\\s?ปี"
]
},
"locale_specific": {},
"sentence_splitter_group": 5,
"no_word_spacing": "True",
"skip": [
"น.",
"เมื่อ ",
Expand All @@ -272,7 +273,8 @@
"ago": [
"แต่ก่อน",
"มาแล้ว",
"ก่อน"
"ก่อน",
"ที่ผ่านมา"
],
"in": [
"ใน"
Expand Down
28 changes: 14 additions & 14 deletions dateparser/data/date_translation_data/yue.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,46 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) 日前"
"(\\d+)\\s?日前"
],
"\\1 hour ago": [
"(\\d+) 小時前"
"(\\d+)\\s?小時前"
],
"\\1 minute ago": [
"(\\d+) 分鐘前"
"(\\d+)\\s?分鐘前"
],
"\\1 month ago": [
"(\\d+) 個月前"
"(\\d+)\\s?個月前"
],
"\\1 second ago": [
"(\\d+) 秒前"
"(\\d+)\\s?秒前"
],
"\\1 week ago": [
"(\\d+) 個星期前"
"(\\d+)\\s?個星期前"
],
"\\1 year ago": [
"(\\d+) 年前"
"(\\d+)\\s?年前"
],
"in \\1 day": [
"(\\d+) 日後"
"(\\d+)\\s?日後"
],
"in \\1 hour": [
"(\\d+) 小時後"
"(\\d+)\\s?小時後"
],
"in \\1 minute": [
"(\\d+) 分鐘後"
"(\\d+)\\s?分鐘後"
],
"in \\1 month": [
"(\\d+) 個月後"
"(\\d+)\\s?個月後"
],
"in \\1 second": [
"(\\d+) 秒後"
"(\\d+)\\s?秒後"
],
"in \\1 week": [
"(\\d+) 個星期後"
"(\\d+)\\s?個星期後"
],
"in \\1 year": [
"(\\d+) 年後"
"(\\d+)\\s?年後"
]
},
"locale_specific": {},
Expand Down
44 changes: 22 additions & 22 deletions dateparser/data/date_translation_data/zh-Hant.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,46 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) 天前"
"(\\d+)\\s?天前"
],
"\\1 hour ago": [
"(\\d+) 小時前"
"(\\d+)\\s?小時前"
],
"\\1 minute ago": [
"(\\d+) 分鐘前"
"(\\d+)\\s?分鐘前"
],
"\\1 month ago": [
"(\\d+) 個月前"
"(\\d+)\\s?個月前"
],
"\\1 second ago": [
"(\\d+) 秒前"
"(\\d+)\\s?秒前"
],
"\\1 week ago": [
"(\\d+) 週前"
"(\\d+)\\s?週前"
],
"\\1 year ago": [
"(\\d+) 年前"
"(\\d+)\\s?年前"
],
"in \\1 day": [
"(\\d+) 天後"
"(\\d+)\\s?天後"
],
"in \\1 hour": [
"(\\d+) 小時後"
"(\\d+)\\s?小時後"
],
"in \\1 minute": [
"(\\d+) 分鐘後"
"(\\d+)\\s?分鐘後"
],
"in \\1 month": [
"(\\d+) 個月後"
"(\\d+)\\s?個月後"
],
"in \\1 second": [
"(\\d+) 秒後"
"(\\d+)\\s?秒後"
],
"in \\1 week": [
"(\\d+) 週後"
"(\\d+)\\s?週後"
],
"in \\1 year": [
"(\\d+) 年後"
"(\\d+)\\s?年後"
]
},
"locale_specific": {
Expand Down Expand Up @@ -236,7 +236,7 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) 日前",
"(\\d+)\\s?日前",
"(\\d+)日前"
],
"\\1 hour ago": [
Expand All @@ -252,14 +252,14 @@
"(\\d+)秒前"
],
"\\1 week ago": [
"(\\d+) 星期前",
"(\\d+)\\s?星期前",
"(\\d+)週前"
],
"\\1 year ago": [
"(\\d+)年前"
],
"in \\1 day": [
"(\\d+) 日後",
"(\\d+)\\s?日後",
"(\\d+)日後"
],
"in \\1 hour": [
Expand All @@ -275,7 +275,7 @@
"(\\d+)秒後"
],
"in \\1 week": [
"(\\d+) 星期後",
"(\\d+)\\s?星期後",
"(\\d+)週後"
],
"in \\1 year": [
Expand Down Expand Up @@ -335,7 +335,7 @@
},
"relative-type-regex": {
"\\1 day ago": [
"(\\d+) 日前",
"(\\d+)\\s?日前",
"(\\d+)日前"
],
"\\1 hour ago": [
Expand All @@ -351,14 +351,14 @@
"(\\d+)秒前"
],
"\\1 week ago": [
"(\\d+) 星期前",
"(\\d+)\\s?星期前",
"(\\d+)週前"
],
"\\1 year ago": [
"(\\d+)年前"
],
"in \\1 day": [
"(\\d+) 日後",
"(\\d+)\\s?日後",
"(\\d+)日後"
],
"in \\1 hour": [
Expand All @@ -374,7 +374,7 @@
"(\\d+)秒後"
],
"in \\1 week": [
"(\\d+) 星期後",
"(\\d+)\\s?星期後",
"(\\d+)週後"
],
"in \\1 year": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sentence_splitter_group : 5

no_word_spacing: "True"

skip: ["น.", "เมื่อ ", "เวลา"]

monday:
Expand Down Expand Up @@ -66,6 +68,7 @@ ago:
- แต่ก่อน
- มาแล้ว
- ก่อน
- ที่ผ่านมา
in:
- ใน

Expand Down
Loading