From 30c30d3e4031eff2e5dc37ce4a2fef83229af278 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 14 Jan 2026 16:01:23 +0000 Subject: [PATCH] Remove trailing whitespaces Tidy up docs --- .pyup.yml | 2 +- CONTRIBUTING.md | 2 +- docs/api/soundex.rst | 2 +- docs/api/tokenize.rst | 79 +++++++++++++++++++------------------- docs/api/tools.rst | 8 ++-- docs/api/translate.rst | 14 +++---- docs/api/transliterate.rst | 10 ++--- docs/api/ulmfit.rst | 2 +- docs/index.rst | 2 +- 9 files changed, 60 insertions(+), 61 deletions(-) diff --git a/.pyup.yml b/.pyup.yml index 7063037b3..a4695a469 100644 --- a/.pyup.yml +++ b/.pyup.yml @@ -1,4 +1,4 @@ -# autogenerated pyup.io config file +# autogenerated pyup.io config file # see https://pyup.io/docs/configuration/ for all available options schedule: '' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 667401363..2ec505a53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -161,7 +161,7 @@ This will create distribution packages in the `dist/` directory. bump-my-version bump release #current_version = 2.3.3-beta0 - + bump-my-version bump release #current_version = 2.3.3 diff --git a/docs/api/soundex.rst b/docs/api/soundex.rst index 45bd3dcbd..eaa0eedec 100644 --- a/docs/api/soundex.rst +++ b/docs/api/soundex.rst @@ -90,7 +90,7 @@ 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) `_. diff --git a/docs/api/tokenize.rst b/docs/api/tokenize.rst index 5fe02fdc2..ef9838f35 100644 --- a/docs/api/tokenize.rst +++ b/docs/api/tokenize.rst @@ -8,40 +8,39 @@ The :mod:`pythainlp.tokenize` module contains a comprehensive set of functions a Modules ------- - .. autofunction:: sent_tokenize :noindex: - + Splits Thai text into sentences. This function identifies sentence boundaries, which is essential for text segmentation and analysis. .. autofunction:: paragraph_tokenize :noindex: - + Segments text into paragraphs, which can be valuable for document-level analysis or summarization. .. autofunction:: subword_tokenize :noindex: - + Tokenizes text into subwords, which can be helpful for various NLP tasks, including subword embeddings. .. autofunction:: syllable_tokenize :noindex: - + Divides text into syllables, allowing you to work with individual Thai language phonetic units. .. autofunction:: word_tokenize :noindex: - + Splits text into words. This function is a fundamental tool for Thai language text analysis. .. autofunction:: word_detokenize :noindex: - + Reverses the tokenization process, reconstructing text from tokenized units. Useful for text generation tasks. .. autoclass:: Tokenizer :members: - + The `Tokenizer` class is a versatile tool for customizing tokenization processes and managing tokenization models. It provides various methods and attributes to fine-tune tokenization according to your specific needs. .. autoclass:: display_cell_tokenize @@ -55,119 +54,119 @@ Sentence level -------------- **crfcut** - + .. automodule:: pythainlp.tokenize.crfcut :members: - + A tokenizer that operates at the sentence level using Conditional Random Fields (CRF). It is suitable for segmenting text into sentences accurately. **thaisumcut** - + .. automodule:: pythainlp.tokenize.thaisumcut :members: - + A sentence tokenizer based on a maximum entropy model. It's a great choice for sentence boundary detection in Thai text. Word level ---------- **attacut** - + .. automodule:: pythainlp.tokenize.attacut :members: - + A tokenizer designed for word-level segmentation. It provides accurate word boundary detection in Thai text. **deepcut** - + .. automodule:: pythainlp.tokenize.deepcut :members: - + Utilizes deep learning techniques for word segmentation, achieving high accuracy and performance. **multi_cut** - + .. automodule:: pythainlp.tokenize.multi_cut :members: - + An ensemble tokenizer that combines multiple tokenization strategies for improved word segmentation. **nlpo3** - + .. automodule:: pythainlp.tokenize.nlpo3 :members: - + A word tokenizer based on the NLPO3 model. It offers advanced word boundary detection and is suitable for various NLP tasks. **longest** - + .. automodule:: pythainlp.tokenize.longest :members: - + A tokenizer that identifies word boundaries by selecting the longest possible words in a text. **pyicu** - + .. automodule:: pythainlp.tokenize.pyicu :members: - + An ICU-based word tokenizer offering robust support for Thai text segmentation. **nercut** - + .. automodule:: pythainlp.tokenize.nercut :members: - + A tokenizer optimized for Named Entity Recognition (NER) tasks, ensuring accurate tokenization for entity recognition. **sefr_cut** - + .. automodule:: pythainlp.tokenize.sefr_cut :members: - + An advanced word tokenizer for segmenting Thai text, with a focus on precision. **oskut** - + .. automodule:: pythainlp.tokenize.oskut :members: - + A tokenizer that uses a pre-trained model for word segmentation. It's a reliable choice for general-purpose text analysis. **newmm (Default)** - + .. automodule:: pythainlp.tokenize.newmm :members: - + The default word tokenization engine that provides a balance between accuracy and efficiency for most use cases. Subword level ------------- **tcc** - + .. automodule:: pythainlp.tokenize.tcc :members: - + Tokenizes text into Thai Character Clusters (TCCs), a subword level representation. **tcc+** - + .. automodule:: pythainlp.tokenize.tcc_p :members: - + A subword tokenizer that includes additional rules for more precise subword segmentation. **etcc** - + .. automodule:: pythainlp.tokenize.etcc :members: - + Enhanced Thai Character Clusters (eTCC) tokenizer for subword-level analysis. **han_solo** - + .. automodule:: pythainlp.tokenize.han_solo :members: - + A subword tokenizer specialized for Han characters and mixed scripts, suitable for various text processing scenarios. diff --git a/docs/api/tools.rst b/docs/api/tools.rst index b4448f639..2dd66be25 100644 --- a/docs/api/tools.rst +++ b/docs/api/tools.rst @@ -9,17 +9,17 @@ Modules .. autofunction:: get_full_data_path :noindex: - + Retrieves the full path to the PyThaiNLP data directory. This function is essential for internal data management, enabling PyThaiNLP to locate resources efficiently. .. autofunction:: get_pythainlp_data_path :noindex: - + Obtains the path to the PyThaiNLP data directory. This function is useful for accessing the library's data resources for internal processes. .. autofunction:: get_pythainlp_path :noindex: - + Returns the path to the PyThaiNLP library directory. This function is vital for PyThaiNLP's internal operations and library management. .. autofunction:: safe_print @@ -27,7 +27,7 @@ Modules .. autofunction:: pythainlp.tools.misspell.misspell :noindex: - + This module appears to be related to handling misspellings within PyThaiNLP. While not explicitly documented here, it likely provides functionality for identifying and correcting misspelled words, which can be crucial for text preprocessing and language processing tasks. The `pythainlp.tools` module contains these functions, which are mainly intended for PyThaiNLP's internal workings. While they may not be directly utilized by external users, they play a pivotal role in ensuring the smooth operation of the library. Understanding the purpose of these functions can be valuable for contributors and developers working on PyThaiNLP, as it sheds light on the internal mechanisms and data management within the library. diff --git a/docs/api/translate.rst b/docs/api/translate.rst index 1e3ab315a..44d6f9294 100644 --- a/docs/api/translate.rst +++ b/docs/api/translate.rst @@ -9,7 +9,7 @@ Modules .. autoclass:: Translate :members: - + The `Translate` class is the central component of the module, offering a unified interface for various translation tasks. It acts as a coordinator, directing translation requests to specific language pairs and models. .. autoclass:: word_translate @@ -17,32 +17,32 @@ Modules .. autofunction:: pythainlp.translate.en_th.download_model_all :noindex: - + This function facilitates the download of all available English to Thai translation models. It ensures that the required models are accessible for translation tasks, enhancing the usability of the module. .. autoclass:: pythainlp.translate.en_th.EnThTranslator :members: - + The `EnThTranslator` class specializes in translating text from English to Thai. It offers a range of methods for translating sentences and text, enabling accurate and meaningful translations between these languages. .. autoclass:: pythainlp.translate.en_th.ThEnTranslator :members: - + Conversely, the `ThEnTranslator` class focuses on translating text from Thai to English. It provides functionality for translating Thai text into English, contributing to effective language understanding and communication. .. autoclass:: pythainlp.translate.zh_th.ThZhTranslator :members: - + The `ThZhTranslator` class specializes in translating text from Thai to Chinese (Simplified). This class is valuable for bridging language gaps between these two languages, promoting cross-cultural communication. .. autoclass:: pythainlp.translate.zh_th.ZhThTranslator :members: - + The `ZhThTranslator` class is designed for translating text from Chinese (Simplified) to Thai. It assists in making content accessible to Thai-speaking audiences by converting Chinese text into Thai. .. autoclass:: pythainlp.translate.th_fr.ThFrTranslator :members: - + Lastly, the `ThFrTranslator` class specializes in translating text from Thai to French. It serves as a tool for expanding language accessibility and promoting content sharing in French-speaking communities. .. The `pythainlp.translate` module extends the language processing capabilities of PyThaiNLP, offering machine translation functionality for various language pairs. Whether you need to translate text between English and Thai, Thai and Chinese, or Thai and French, this module provides the necessary tools and classes to facilitate seamless language conversion. The `Translate` class acts as the central coordinator, while language-specific classes ensure accurate and meaningful translations for diverse linguistic scenarios. diff --git a/docs/api/transliterate.rst b/docs/api/transliterate.rst index 6222e9cf7..442bf695b 100644 --- a/docs/api/transliterate.rst +++ b/docs/api/transliterate.rst @@ -29,22 +29,22 @@ Modules .. autoclass:: pythainlp.transliterate.wunsen.WunsenTransliterate :members: - + The `WunsenTransliterate` class represents a transliteration engine known as "Wunsen." It offers specific transliteration methods for rendering Thai text into a phonetic English format. Transliteration Engines ----------------------- **thai2rom** - + .. autofunction:: pythainlp.transliterate.thai2rom.romanize - + The `thai2rom` engine specializes in transliterating Thai text into romanized form. It's particularly useful for rendering Thai words accurately in an English phonetic format. **royin** - + .. autofunction:: pythainlp.transliterate.royin.romanize - + The `royin` engine focuses on transliterating Thai text into English characters. It provides an alternative approach to transliteration, ensuring accurate representation of Thai words. **Transliterate Engines** diff --git a/docs/api/ulmfit.rst b/docs/api/ulmfit.rst index d9b185649..527b99c1b 100644 --- a/docs/api/ulmfit.rst +++ b/docs/api/ulmfit.rst @@ -9,7 +9,7 @@ Modules .. autoclass:: ThaiTokenizer :members: - + The `ThaiTokenizer` class is a critical component of ULMFiT, designed for tokenizing Thai text effectively. Tokenization is the process of breaking down text into individual tokens, and this class allows you to do so with precision and accuracy. .. autofunction:: document_vector diff --git a/docs/index.rst b/docs/index.rst index ce80d16f5..a8f9351b9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,7 @@ PyThaiNLP documentation ===================================== .. figure:: ./images/logo.png :scale: 50 % - + PyThaiNLP is a Python library for Thai natural language processing (NLP). Website: `PyThaiNLP.github.io `_