From 3772bf8e661d34b8006d5530c089a089e36098ce Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 2 Mar 2022 10:10:43 +0000 Subject: [PATCH] Support Korean language hashtags --- tests.py | 1 + utils.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tests.py b/tests.py index 5deb6316e..eff881d25 100644 --- a/tests.py +++ b/tests.py @@ -5326,6 +5326,7 @@ def _test_valid_hash_tag(): assert valid_hash_tag('ThisIsValid12345') assert valid_hash_tag('ThisIsVälid') assert valid_hash_tag('यहमान्यहै') + assert valid_hash_tag('한국어') assert not valid_hash_tag('ThisIsNotValid!') assert not valid_hash_tag('#ThisIsAlsoNotValid') assert not valid_hash_tag('#यहमान्यहै') diff --git a/utils.py b/utils.py index 0c806798b..fae909cbe 100644 --- a/utils.py +++ b/utils.py @@ -1864,6 +1864,11 @@ def _is_valid_language(text: str) -> bool: "Ogham": [5760, 5792], "Runic": [5792, 5888], "Khmer": [6016, 6144], + "Hangul Syllables": [44032, 55203], + "Hangul Jamo": [4352, 4607], + "Hangul Compatibility Jamo": [12592, 12687], + "Hangul Jamo Extended-A": [43360, 43391], + "Hangul Jamo Extended-B": [55216, 55295], "Mongolian": [6144, 6320] } for lang_name, lang_range in natural_languages.items():