$ account overtrue
This is a mature PHP library for converting Chinese characters (simplified and traditional) to pinyin romanization. It provides a clean facade (`Pinyin` class) with static methods for common conversions (sentence, phrase, name, heteronym, permalink, abbreviation) and supports multiple output tone styles (symbol, number, none). The architecture employs the strategy pattern via a `ConverterFactory` that selects among three converter implementations: `MemoryOptimizedConverter` (~400KB memory), `CachedConverter` (~4MB, faster), and `SmartConverter` (adaptive). An abstract base class (`AbstractConverter`) handles shared preprocessing, tone formatting, and dictionary loading. The library includes a CLI tool (`bin/pinyin`) for command-line use, comprehensive test coverage, static analysis at PHPStan level 9, and a data generation pipeline (`bin/build`) that downloads and patches dictionary data from external sources. The dictionary is split across multiple PHP array files in `data/`, covering characters, surnames, and multi-word phrases with polyphone disambiguation. The codebase is well-structured, follows modern PHP practices (8.1+ enums, typed properties), and is actively maintained with CI and dependabot.