# overtrue/pinyin

🇨🇳 基于词库的中文转拼音优质解决方案

Repository: https://github.com/overtrue/pinyin
Canonical: https://ross.abutalabs.com/products/overtrue-pinyin
Homepage: https://github.com/overtrue/pinyin
Language: PHP
License: MIT
License Family: permissive
Topics: pinyin, php
Last push: 2026-05-07T13:51:15+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 81, release rhythm 49, longevity 100
- inputs: {"age_days": 4432, "days_push": 118, "days_rel": 180, "gap_med": 177.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4461, forks 761 (observed 2026-08-28T04:08:50.713264+00:00)

## What it is
A PHP library that converts Chinese text to pinyin using the mozillazg/pinyin-data dictionary, with accurate handling of polyphonic characters. It supports multiple tone styles, surname recognition, and permalink/abbreviation generation.

## Use cases
- convert Chinese sentences to pinyin with tone marks
- generate pinyin slugs for article URLs
- get pinyin abbreviations for search indexing
- handle polyphonic Chinese characters correctly
- convert Chinese names to pinyin with surname detection
- output pinyin without tones or with numeric tones

## When to choose
- you need accurate Chinese-to-pinyin conversion in a PHP project
- you need polyphonic character (多音字) disambiguation
- you want pinyin-based URL slugs or search indexes

## When to avoid
- your project is not in PHP
- you need Chinese-to-English translation rather than romanization
- you need pinyin conversion for other Sinitic languages like Cantonese

## Facets
- artifact type: library
- maturity: stable
- function: nlp, parser, internationalization
- domain: developer-tools
- platform: php, cross-platform
- tags: pinyin, chinese, transliteration, composer, polyphonic-characters, natural-language-processing, localization

## Member repositories
- overtrue/pinyin (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:50.713264+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:42.268689+00:00, confidence not recorded.
  - readme: https://github.com/overtrue/pinyin (fetched 2026-08-28T04:08:50.713264+00:00, sha 412b6911267c)
  - homepage: https://github.com/overtrue/pinyin (fetched 2026-08-29T09:07:23.033779+00:00, sha 0b388762b422)
- Data as of 2026-08-30T08:39:29.467469+00:00.
