diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ee2b1a7c..fb5c73767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ The minimum requirement is now Python 3.9. - Callers raise `FileNotFoundError` with download instructions when a corpus path cannot be resolved (#1306) - Migrate build backend to `hatchling` (#1311) +- Update HTTP links to HTTPS in source files and documentation ### Deprecated @@ -63,6 +64,8 @@ The minimum requirement is now Python 3.9. - Duplicated entries in Volubilis dictionary (#1200) - Star imports (#1207) - `requests` dependency (#1211) +- `pythainlp.util.is_native_thai` (deprecated since v5.0); + use `pythainlp.morpheme.is_native_thai` instead (#1315) ### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff6776071..aafc44bcf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,21 +44,21 @@ Please refer to our This is [to please Git][empty-line] and [to keep up with POSIX standard][posix]. -[pep8]: http://www.python.org/dev/peps/pep-0008/ +[pep8]: https://peps.python.org/pep-0008/ [black]: https://github.com/ambv/black [naming]: https://namingconvention.org/python/ [pep0498]: https://www.python.org/dev/peps/pep-0498/ -[dead-codes]: http://www.codinghorror.com/blog/2008/07/coding-without-comments.html +[dead-codes]: https://blog.codinghorror.com/coding-without-comments/ [issues]: https://github.com/pythainlp/pythainlp/issues [empty-line]: https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file#5813359 [posix]: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline ### Version Control System -- We use [Git](http://git-scm.com/) as our - [version control system](http://en.wikipedia.org/wiki/Revision_control), +- We use [Git](https://git-scm.com/) as our + [version control system](https://en.wikipedia.org/wiki/Revision_control), so it may be a good idea to familiarize yourself with it. -- You can start with the [Pro Git book](http://git-scm.com/book/) (free!). +- You can start with the [Pro Git book](https://git-scm.com/book/) (free!). ### Commit Message @@ -72,7 +72,7 @@ Please refer to our and several checks automatically. Click the "Details" link at the end of each check to see what needs to be fixed. -[gitflow]: http://nvie.com/posts/a-successful-git-branching-model/ +[gitflow]: https://nvie.com/posts/a-successful-git-branching-model/ ## Documentation @@ -263,7 +263,7 @@ Thanks to all (Selection of Important Sentences in Thai Text Summarization Using a Hierarchical Model). Retrieved from - [http://digi.library.tu.ac.th/thesis/st/0192/](https://digital.library.tu.ac.th/tu_dc/frontend/Info/item/dc:124897) + - **[Thai Discourse Treebank]** -- Ponrawee Prasertsom, Apiwat Jaroonpol, Attapol T. Rutherford; The Thai Discourse Treebank: Annotating and Classifying Thai diff --git a/README.md b/README.md index 3e5c5e0e7..2b1da3e2b 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ please cite the software as follows: > Phatthiyaphaibun, Wannaphong, Korakot Chaovavanich, Charin Polpanumas, > Arthit Suriyawongkul, Lalita Lowphansirikul, and Pattarawat Chormai. > “PyThaiNLP: Thai Natural Language Processing in Python”. -> Zenodo, 2 June 2024. . +> Zenodo, 2 June 2024. . with this BibTeX entry: diff --git a/README_TH.md b/README_TH.md index 8ac38178b..fed42551f 100644 --- a/README_TH.md +++ b/README_TH.md @@ -136,7 +136,7 @@ PyThaiNLP ดาวน์โหลดข้อมูล (ดูแค็ตต > Phatthiyaphaibun, Wannaphong, Korakot Chaovavanich, Charin Polpanumas, > Arthit Suriyawongkul, Lalita Lowphansirikul, and Pattarawat Chormai. > “PyThaiNLP: Thai Natural Language Processing in Python”. -> Zenodo, 2 June 2024. . +> Zenodo, 2 June 2024. . โดยใช้รายการ BibTeX นี้: diff --git a/docs/api/soundex.rst b/docs/api/soundex.rst index eaa0eedec..386ef048d 100644 --- a/docs/api/soundex.rst +++ b/docs/api/soundex.rst @@ -90,9 +90,9 @@ References .. [#metasound] Snae & Brückner. (2009). `Novel Phonetic Name Matching Algorithm with a Statistical Ontology for Analyzing Names Given in Accordance with Thai Astrology `_. -.. [#udom83] Wannee Udompanich (1983). `String searching for Thai alphabet using Soundex compression technique `_. Master Thesis. Chulalongkorn University, Thailand. วรรณี อุดมพาณิชย์. `การใช้หลักคำพ้องเสียง เพื่อค้นหาชุดอักขระภาษาไทยที่ออกเสียงเหมือนกัน `_. วิทยานิพนธ์ (วท.ม.)--จุฬาลงกรณ์มหาวิทยาลัย, 2526. +.. [#udom83] Wannee Udompanich (1983). `String searching for Thai alphabet using Soundex compression technique `_. Master Thesis. Chulalongkorn University, Thailand. วรรณี อุดมพาณิชย์. `การใช้หลักคำพ้องเสียง เพื่อค้นหาชุดอักขระภาษาไทยที่ออกเสียงเหมือนกัน `_. วิทยานิพนธ์ (วท.ม.)--จุฬาลงกรณ์มหาวิทยาลัย, 2526. -.. [#lk82] Vichit Lorchirachoonkul. 1982. `A Thai soundex system `_. Information Processing & Management, 18(5):243–255. วิชิต หล่อจีระชุณห์กุล และ เจริญ คุวินทร์พันธุ์. `โปรแกรมการสืบค้นคำไทยตามเสียงอ่าน (Thai Soundex) `_. +.. [#lk82] Vichit Lorchirachoonkul. 1982. `A Thai soundex system `_. Information Processing & Management, 18(5):243–255. วิชิต หล่อจีระชุณห์กุล และ เจริญ คุวินทร์พันธุ์. `โปรแกรมการสืบค้นคำไทยตามเสียงอ่าน (Thai Soundex) `_. .. [#prayut_and_somchaip] Prayut Suwanvisat, Somchai Prasitjutrakul. Thai-English Cross-Language Transliterated Word Retrieval using Soundex Technique. In 1998 [cited 2022 Sep 8]. Available from: https://www.cp.eng.chula.ac.th/~somchai/spj/papers/ThaiText/ncsec98-clir.pdf. diff --git a/docs/api/spell.rst b/docs/api/spell.rst index b0345219d..eeebb0f2f 100644 --- a/docs/api/spell.rst +++ b/docs/api/spell.rst @@ -48,11 +48,11 @@ The `NorvigSpellChecker` class is a fundamental component of the `pythainlp.spel DEFAULT_SPELL_CHECKER ~~~~~~~~~~~~~~~~~~~~~ .. autodata:: DEFAULT_SPELL_CHECKER - :annotation: = Default reference of the standard NorvigSpellChecker, using word list data from the Thai National Corpus: http://www.arts.chula.ac.th/ling/tnc/ + :annotation: = Default reference of the standard NorvigSpellChecker, using word list data from the Thai National Corpus: https://www.arts.chula.ac.th/ling/tnc3/ The `DEFAULT_SPELL_CHECKER` is an reference to the `NorvigSpellChecker` class with default settings. It is pre-configured to use word list data from the Thai National Corpus, making it a reliable choice for general spell-checking tasks. References ---------- -.. [#norvig_spellchecker] Peter Norvig (2007). `How to Write a Spelling Corrector `_. +.. [#norvig_spellchecker] Peter Norvig (2007). `How to Write a Spelling Corrector `_. diff --git a/docs/api/tag.rst b/docs/api/tag.rst index 437de7a06..46203fa4e 100644 --- a/docs/api/tag.rst +++ b/docs/api/tag.rst @@ -217,7 +217,7 @@ Named Entity tag Examples ORGANIZATION กรมวิทยาศาสตร์การแพทย์, อย. PERSON น.พ.จรัล, นางประนอม ทองจันทร์ PHONE 1200, 0 2670 8888 - URL http://www.bangkokhealth.com/ + URL https://www.bangkokhealth.com/ ZIP 10400, 11130 Money 2.7 ล้านบาท, 2,000 บาท LAW พ.ร.บ.โรคระบาด พ.ศ.2499, รัฐธรรมนูญ diff --git a/docs/api/transliterate.rst b/docs/api/transliterate.rst index 442bf695b..fc5c259c8 100644 --- a/docs/api/transliterate.rst +++ b/docs/api/transliterate.rst @@ -61,7 +61,7 @@ This section includes multiple transliteration engines designed to suit various References ---------- -.. [#rtgs_transcription] Nitaya Kanchanawan. (2006). `Romanization, Transliteration, and Transcription for the Globalization of the Thai Language. `_ +.. [#rtgs_transcription] Nitaya Kanchanawan. (2006). `Romanization, Transliteration, and Transcription for the Globalization of the Thai Language. `_ The Journal of the Royal Institute of Thailand. The `pythainlp.transliterate` module offers a comprehensive set of tools and engines for transliterating Thai text into Romanized form. Whether you need a simple transliteration, specific engines for accurate representation, or phonetic rendering, this module provides a wide range of options. Additionally, the module references a publication that highlights the significance of Romanization, Transliteration, and Transcription in making the Thai language accessible to a global audience. diff --git a/docs/api/wangchanberta.rst b/docs/api/wangchanberta.rst index 11e8f4731..6df28fc01 100644 --- a/docs/api/wangchanberta.rst +++ b/docs/api/wangchanberta.rst @@ -47,4 +47,4 @@ Modules References ---------- -.. [#Lowphansirikul_2021] Lowphansirikul L, Polpanumas C, Jantrakulchai N, Nutanong S. WangchanBERTa: Pretraining transformer-based Thai Language Models. `ArXiv:2101.09635 `_ [Internet]. 2021 Jan 23 [cited 2021 Feb 27]. +.. [#Lowphansirikul_2021] Lowphansirikul L, Polpanumas C, Jantrakulchai N, Nutanong S. WangchanBERTa: Pretraining transformer-based Thai Language Models. `ArXiv:2101.09635 `_ [Internet]. 2021 Jan 23 [cited 2021 Feb 27]. diff --git a/docs/conf.py b/docs/conf.py index 3e3632ebf..53dd76276 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # Configuration file for the Sphinx documentation builder. -# http://www.sphinx-doc.org/en/master/config +# https://www.sphinx-doc.org/en/master/usage/configuration.html import os import sys diff --git a/docs/notes/license.rst b/docs/notes/license.rst index 5123fb75b..ce7b663a5 100644 --- a/docs/notes/license.rst +++ b/docs/notes/license.rst @@ -14,7 +14,7 @@ License you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/pythainlp/corpus/corpus_license.md b/pythainlp/corpus/corpus_license.md index 6094288a4..67c9cee38 100644 --- a/pythainlp/corpus/corpus_license.md +++ b/pythainlp/corpus/corpus_license.md @@ -67,7 +67,7 @@ and released under A Thai word list from ICU (International Components for Unicode) project (icubrk_th.txt) is copyrighted by Unicode, Inc. and others., released under **Unicode License Agreement - Data Files and Software (2016)** - + Original data: diff --git a/pythainlp/corpus/icubrk_th.txt b/pythainlp/corpus/icubrk_th.txt index 3278c1fc2..f818bb77d 100644 --- a/pythainlp/corpus/icubrk_th.txt +++ b/pythainlp/corpus/icubrk_th.txt @@ -1,6 +1,6 @@ # SPDX-FileType: TEXT # SPDX-FileCopyrightText: Copyright (C) 2016 and later: Unicode, Inc. and others. -# SPDX-FileCopyrightText: License & terms of use: http://www.unicode.org/copyright.html +# SPDX-FileCopyrightText: License & terms of use: https://www.unicode.org/copyright.html # SPDX-FileCopyrightText: Copyright (c) 2006-2015 International Business Machines Corporation, # SPDX-FileCopyrightText: Apple Inc., and others. All Rights Reserved. # SPDX-License-Identifier: Unicode-DFS-2016 diff --git a/pythainlp/corpus/wordnet.py b/pythainlp/corpus/wordnet.py index b0a8cec3b..d870ecebb 100644 --- a/pythainlp/corpus/wordnet.py +++ b/pythainlp/corpus/wordnet.py @@ -436,7 +436,7 @@ def morphy(form: str, pos: Optional[str] = None) -> str: def custom_lemmas(tab_file: Union[str, IO[str]], lang: str) -> None: """This function reads a custom tab file - (see: http://compling.hss.ntu.edu.sg/omw/) + (see: https://omwn.org/) containing mappings of lemmas in the given language. :param tab_file: Tab file as a file or file-like object diff --git a/pythainlp/morpheme/thaiwordcheck.py b/pythainlp/morpheme/thaiwordcheck.py index 69e5cd386..a517003f6 100644 --- a/pythainlp/morpheme/thaiwordcheck.py +++ b/pythainlp/morpheme/thaiwordcheck.py @@ -9,7 +9,7 @@ References ---------- - ทีมงานทรูปลูกปัญญา 2015. ลักษณะของคำไทยแท้ \ - http://www.trueplookpanya.com/learning/detail/30589-043067 + https://www.trueplookpanya.com/learning/detail/30589-043067 - วารุณี บำรุงรส 2010. คำไทยแท้ https://www.gotoknow.org/posts/377619 """ diff --git a/pythainlp/soundex/udom83.py b/pythainlp/soundex/udom83.py index 0b0e88d5c..9f4a318a3 100644 --- a/pythainlp/soundex/udom83.py +++ b/pythainlp/soundex/udom83.py @@ -8,7 +8,7 @@ using Soundex compression technique. Master Thesis of Department of Computer Engineering Graduate School, Chulalongkorn University, 1983. -http://cuir.car.chula.ac.th/handle/123456789/48471 +https://cuir.car.chula.ac.th/handle/123456789/48471 Python implementation: by Korakot Chaovavanich diff --git a/pythainlp/spell/pn.py b/pythainlp/spell/pn.py index e63611741..1dd25c8b1 100644 --- a/pythainlp/spell/pn.py +++ b/pythainlp/spell/pn.py @@ -3,7 +3,7 @@ Default spelling dictionary is based on Phupha: Thai Word Frequency Dataset, filtered with Royal Society of Thailand word list. -Based on Peter Norvig's Python code from http://norvig.com/spell-correct.html +Based on Peter Norvig's Python code from https://norvig.com/spell-correct.html """ from __future__ import annotations diff --git a/pythainlp/tag/_tag_perceptron.py b/pythainlp/tag/_tag_perceptron.py index df6f2715b..b39b1da97 100644 --- a/pythainlp/tag/_tag_perceptron.py +++ b/pythainlp/tag/_tag_perceptron.py @@ -29,7 +29,7 @@ class AveragedPerceptron: """An averaged perceptron, as implemented by Matthew Honnibal. See more implementation details here: - http://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/ + https://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/ """ weights: dict[str, dict[str, float]] @@ -104,7 +104,7 @@ class PerceptronTagger: """Greedy Averaged Perceptron tagger, as implemented by Matthew Honnibal. See more implementation details here: - http://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/ + https://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/ >>> from pythainlp.tag import PerceptronTagger >>> tagger = PerceptronTagger() diff --git a/pythainlp/tokenize/tcc.py b/pythainlp/tokenize/tcc.py index 4d921f6d4..935cf4641 100644 --- a/pythainlp/tokenize/tcc.py +++ b/pythainlp/tokenize/tcc.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 """The implementation of tokenizer according to Thai Character Clusters (TCCs) rules proposed by `Theeramunkong et al. 2000. \ - `_ + `_ Credits: * TCC: Jakkrit TeCho diff --git a/pythainlp/tokenize/tcc_p.py b/pythainlp/tokenize/tcc_p.py index 2daec5b02..7f2beae3d 100644 --- a/pythainlp/tokenize/tcc_p.py +++ b/pythainlp/tokenize/tcc_p.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 """The implementation of tokenizer according to Thai Character Clusters (TCCs) rules proposed by `Theeramunkong et al. 2000. \ - `_ + `_ and improved rules that are used in newmm Credits: diff --git a/pythainlp/translate/tokenization_small100.py b/pythainlp/translate/tokenization_small100.py index 979d6491c..125cf3e3c 100644 --- a/pythainlp/translate/tokenization_small100.py +++ b/pythainlp/translate/tokenization_small100.py @@ -2,7 +2,7 @@ # SPDX-FileType: SOURCE # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2022 Idiap Research Institute, http://www.idiap.ch/ +# Copyright (c) 2022 Idiap Research Institute, https://www.idiap.ch/ # Written by Alireza Mohammadshahi # This is a modified version of https://github.com/huggingface/transformers/blob/main/src/transformers/models/m2m_100/tokenization_m2m_100.py # which owns by Fariseq Authors and The HuggingFace Inc. team. @@ -12,7 +12,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/pythainlp/util/__init__.py b/pythainlp/util/__init__.py index 3639b6a8a..305f726ae 100644 --- a/pythainlp/util/__init__.py +++ b/pythainlp/util/__init__.py @@ -24,7 +24,6 @@ "find_keyword", "find_profanity", "ipa_to_rtgs", - "is_native_thai", "isthai", "isthaichar", "longest_common_subsequence", @@ -138,7 +137,6 @@ thai_word_tone_detector, ) from pythainlp.util.thai_lunar_date import th_zodiac, to_lunar_date -from pythainlp.util.thaiwordcheck import is_native_thai from pythainlp.util.time import thaiword_to_time, time_to_thaiword from pythainlp.util.trie import Trie, dict_trie from pythainlp.util.wordtonum import text_to_num, thaiword_to_num, words_to_num diff --git a/pythainlp/util/numtoword.py b/pythainlp/util/numtoword.py index a69a66945..921eec0c2 100644 --- a/pythainlp/util/numtoword.py +++ b/pythainlp/util/numtoword.py @@ -4,7 +4,7 @@ """Convert number value to Thai read out Adapted from -http://justmindthought.blogspot.com/2012/12/code-php.html +https://justmindthought.blogspot.com/2012/12/code-php.html https://suksit.com/post/writing-bahttext-in-php/ """ diff --git a/pythainlp/util/strftime.py b/pythainlp/util/strftime.py index 01ff741fa..e70cf9c7d 100644 --- a/pythainlp/util/strftime.py +++ b/pythainlp/util/strftime.py @@ -186,7 +186,7 @@ def thai_strftime( * Python https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior - * C http://www.cplusplus.com/reference/ctime/strftime/ + * C https://en.cppreference.com/w/cpp/chrono/c/strftime * GNU https://metacpan.org/pod/POSIX::strftime::GNU * Linux https://linux.die.net/man/3/strftime * OpenBSD https://man.openbsd.org/strftime.3 @@ -195,7 +195,7 @@ def thai_strftime( https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/strftime.3.html * PHP https://secure.php.net/manual/en/function.strftime.php * JavaScript's implementation https://github.com/samsonjs/strftime - * strftime() quick reference http://www.strftime.net/ + * strftime() quick reference https://strftime.net/ :param datetime dt_obj: an instantiatetd object of :mod:`datetime.datetime` diff --git a/pythainlp/util/thaiwordcheck.py b/pythainlp/util/thaiwordcheck.py deleted file mode 100644 index 106dfbdf8..000000000 --- a/pythainlp/util/thaiwordcheck.py +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: 2016-2026 PyThaiNLP Project -# SPDX-FileType: SOURCE -# SPDX-License-Identifier: Apache-2.0 -from __future__ import annotations - -from pythainlp.tools import warn_deprecation - - -def is_native_thai(word: str) -> bool: - warn_deprecation( - "pythainlp.util.is_native_thai", - "pythainlp.morpheme.is_native_thai", - "5.0", - "5.1", - ) - - from pythainlp.morpheme import is_native_thai as check - - return check(word)