Skip to content

Conversation

@wannaphong
Copy link
Member

@wannaphong wannaphong commented Sep 28, 2025

    Analyzes a string of Thai text and returns a dictionaries,
    where each values represents a single classified character from the text.

    The function processes the text character by character and maps each Thai
    character to its descriptive name or itself (for consonants and digits).

    :param str text: The Thai text string to be analyzed.
    :rtype: list[dict]
    :return: A dictionaries, with each item containing
                    a single character and a count of 1.

    Examples:
        >>> analyze_thai_text("คนดี")
        {'ค': 1, 'น': 1, 'ด': 1, 'สระ อี': 1}

        >>> analyze_thai_text("เล่น")
        {'สระ เอ': 1, 'ล': 1, 'ไม้เอก': 1, 'น': 1}

Your checklist for this pull request

  • Passed code styles and structures
  • Passed code linting checks and unit test

Added a comprehensive mapping of Thai characters to their descriptive names, including consonants, vowels, tone marks, punctuation, and digits. Implemented the analyze_thai_text function to analyze Thai text and return a list of classified characters.
Added documentation for analyze_thai_text function.
Added unit tests for analyze_thai_text function.
Updated the analyze_thai_text function to return a single dictionary instead of a list of dictionaries, reflecting changes in the return type and documentation.
Corrected the description in the analyze_thai_text function.
@sonarqubecloud
Copy link

@wannaphong wannaphong merged commit c94002a into dev Sep 29, 2025
12 of 42 checks passed
@wannaphong wannaphong deleted the add-analyze_thai_text branch September 29, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants