Ladsgroup has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/162294

Change subject: Fix up timestripper for Korean and add ko tests
......................................................................

Fix up timestripper for Korean and add ko tests

Change-Id: Iaa72c87ed13a0f65451a7ad717abc94be4a8307f
---
M pywikibot/textlib.py
M tests/timestripper_tests.py
2 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/94/162294/1

diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 241e73a..64da90b 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -1223,9 +1223,9 @@
         # the last one is workaround for Korean
         if any(_.isdigit() for _ in self.origNames2monthNum):
             self.is_digit_month = True
-            monthR = 
r'(?P<month>(%s)(?:\u0654)?|(?:1[012]|0?[1-9])\.?(?:\uc6d4)?)' \
+            monthR = r'(?P<month>(%s)|(?:1[012]|0?[1-9])\.)' \
                 % u'|'.join(escaped_months)
-            dayR = r'(?P<day>(3[01]|[12]\d|0?[1-9]))(?:%s)?\.?\s*[01]?\d\.?' % 
u'\uc77c'
+            dayR = 
r'(?P<day>(3[01]|[12]\d|0?[1-9]))(?:%s)?\.?\s*(?:[01]?\d\.)?' % u'\uc77c'
         else:
             self.is_digit_month = False
             monthR = r'(?P<month>(%s))' % u'|'.join(escaped_months)
diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py
index 0f265e3..6c31248 100644
--- a/tests/timestripper_tests.py
+++ b/tests/timestripper_tests.py
@@ -151,6 +151,11 @@
             'match': u'3 février 2010 à 19:48 (CET) 7 février 2010 à 19:48 
(CET)',
             'nomatch': u'3 March 2010 19:48 (CET) 7 March 2010 19:48 (CET)',
         },
+        'kowiki': {
+            'family': 'wikipedia',
+            'code': 'ko',
+            'match': u'2010년 2월 3일 (수) 19:48 (KST) 2010년 2월 7일 (수) 19:48 
(KST)',
+        },
         'nowiki': {
             'family': 'wikipedia',
             'code': 'no',

-- 
To view, visit https://gerrit.wikimedia.org/r/162294
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa72c87ed13a0f65451a7ad717abc94be4a8307f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to