diff --git a/SECURITY.md b/SECURITY.md index a480849b1..97403d404 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,9 @@ | Version | Supported | | ------- | ------------------ | +| 5.0.x | :white_check_mark: | | 4.0.x | :white_check_mark: | -| 3.1.x | :white_check_mark: | +| 3.1.x | :x: | | 3.0.x | :x: | | 2.3.x | :x: | | 2.2.x | :x: | diff --git a/pythainlp/__init__.py b/pythainlp/__init__.py index cd8af7444..c5990ac43 100644 --- a/pythainlp/__init__.py +++ b/pythainlp/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # SPDX-FileCopyrightText: Copyright 2016-2024 PyThaiNLP Project # SPDX-License-Identifier: Apache-2.0 -__version__ = "5.0.0" +__version__ = "5.0.1" thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars diff --git a/pythainlp/util/pronounce.py b/pythainlp/util/pronounce.py index d4476d652..85f0c71ed 100644 --- a/pythainlp/util/pronounce.py +++ b/pythainlp/util/pronounce.py @@ -9,9 +9,7 @@ kv = KhaveeVerifier() -all_thai_words_dict = [ - i for i in list(thai_words()) if len(syllable_tokenize(i)) == 1 -] +all_thai_words_dict = None def rhyme(word: str) -> List[str]: @@ -29,7 +27,12 @@ def rhyme(word: str) -> List[str]: print(rhyme("จีบ")) # output: ['กลีบ', 'กีบ', 'ครีบ', ...] """ + global all_thai_words_dict list_sumpus = [] + if all_thai_words_dict == None: + all_thai_words_dict = [ + i for i in list(thai_words()) if len(syllable_tokenize(i)) == 1 + ] for i in all_thai_words_dict: if kv.is_sumpus(word, i) and i != word: list_sumpus.append(i) diff --git a/setup.cfg b/setup.cfg index cde6f1d7a..0f9349051 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 5.0.0 +current_version = 5.0.1 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 7b979b304..34c22c684 100644 --- a/setup.py +++ b/setup.py @@ -161,7 +161,7 @@ setup( name="pythainlp", - version="5.0.0", + version="5.0.1", description="Thai Natural Language Processing library", long_description=readme, long_description_content_type="text/markdown", @@ -210,7 +210,7 @@ ], }, project_urls={ - "Documentation": "https://pythainlp.github.io/docs/4.0/", + "Documentation": "https://pythainlp.github.io/docs/5.0/", "Tutorials": "https://pythainlp.github.io/tutorials/", "Source Code": "https://github.com/PyThaiNLP/pythainlp", "Bug Tracker": "https://github.com/PyThaiNLP/pythainlp/issues",