# toss/es-hangul architecture

> Architecture diagram of the GitHub repository toss/es-hangul, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/toss/es-hangul
- Repository: https://github.com/toss/es-hangul

## Overview

##### Project Type Analysis
This is an open-source utility library focused on Korean language processing, with a modular architecture and documentation system.

##### Main Components

Core Components:
**A. Core Processing Modules**
- Character Processing
- String Manipulation
- Pronunciation Rules
- Number/Amount Conversion
- Particle (Josa) Processing

**B. Supporting Infrastructure**
- Documentation System
- Testing Framework
- Build System

**Top Layer: Public API Interface**

**Middle Layer: Core Processing Modules**

**Bottom Layer: Internal Utilities and Constants**

##### Specific Component Details

**a. Public API Layer (Entry Points):**
- Show all exposed functions (josa, getChoseong, etc.)
- Group related functions together

**b. Core Processing Modules:**
- Character Manipulation (assemble, disassemble)
- Conversion Functions (numberToHangul, romanize)
- Pronunciation Rules
- Particle Processing

**c. Internal Utilities:**
- Constants
- Shared Functions
- Type Definitions

##### Key Relationships to Highlight

**a. Module Dependencies:**
- Show how high-level functions depend on core utilities
- Indicate shared constant usage

**b. Processing Flow:**
- Illustrate text input/output flow
- Show transformation pipelines

##### Implementation Details

**a. Include these specific modules:**
- Character Processing
- * assemble/disassemble
- * combineCharacter
- * getChoseong
- String Manipulation
- * convertQwertyToHangul
- * romanize
- Number Processing
- * numberToHangul
- * amountToHangul
- Particle Processing
- * josa
- * seosusa

##### Documentation Integration

How the documentation system (in the docs directory) relates to the core library:
**Documentation Layer**

- API Documentation
- Usage Examples
- Internationalization (ko/en)

##### Build and Test Flow

A separate section showing:
**Source Code → TypeScript Compilation → Testing → Build → Distribution**

Remember to:
- Use consistent styling
- A clear hierarchy
- Version information
- Document all abbreviations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Public API Layer"
        API_CHAR["Character Processing API"]:::api
        API_STR["String Manipulation API"]:::api
        API_NUM["Number Processing API"]:::api
        API_PART["Particle Processing API"]:::api
        API_PRON["Pronunciation API"]:::api
    end

    subgraph "Core Processing Modules"
        direction TB
        CHAR["Character Processing"]:::core
        STR["String Manipulation"]:::core
        NUM["Number/Amount Conversion"]:::core
        PART["Particle Processing"]:::core
        PRON["Pronunciation Rules"]:::core
    end

    subgraph "Internal Utilities"
        CONST["Constants"]:::util
        HANGUL["Hangul Utilities"]:::util
    end

    subgraph "Infrastructure"
        direction TB
        BUILD["Build System"]:::infra
        TEST["Testing Framework"]:::infra
        DOCS["Documentation"]:::infra
        CI["CI/CD"]:::infra
    end

    %% Relationships
    API_CHAR --> CHAR
    API_STR --> STR
    API_NUM --> NUM
    API_PART --> PART
    API_PRON --> PRON

    CHAR --> CONST
    STR --> CONST
    NUM --> CONST
    PART --> CONST
    PRON --> CONST

    CHAR --> HANGUL
    STR --> HANGUL
    PRON --> HANGUL

    %% Click events
    click CHAR "https://github.com/toss/es-hangul/tree/main/src/assemble/"
    click STR "https://github.com/toss/es-hangul/tree/main/src/convertQwertyToHangul/"
    click PRON "https://github.com/toss/es-hangul/tree/main/src/standardizePronunciation/"
    click NUM "https://github.com/toss/es-hangul/tree/main/src/numberToHangul/"
    click PART "https://github.com/toss/es-hangul/tree/main/src/josa/"
    click CONST "https://github.com/toss/es-hangul/blob/main/src/_internal/constants.ts"
    click HANGUL "https://github.com/toss/es-hangul/blob/main/src/_internal/hangul.ts"
    click DOCS "https://github.com/toss/es-hangul/tree/main/docs/src/pages/docs/api/"
    click BUILD "https://github.com/toss/es-hangul/blob/main/tsup.config.ts"
    click TEST "https://github.com/toss/es-hangul/blob/main/vitest.config.mts"
    click CI "https://github.com/toss/es-hangul/tree/main/.github/workflows/"

    %% Styling
    classDef api fill:#2196F3,stroke:#1565C0,color:white
    classDef core fill:#4CAF50,stroke:#2E7D32,color:white
    classDef util fill:#9E9E9E,stroke:#616161,color:white
    classDef infra fill:#FF9800,stroke:#F57C00,color:white

    %% Legend
    subgraph Legend
        L_API["API Component"]:::api
        L_CORE["Core Module"]:::core
        L_UTIL["Utility"]:::util
        L_INFRA["Infrastructure"]:::infra
    end
```
