PackageTrack
Sign in Get early access

github.com/mozillazg/go-pinyin

v0.21.0 #902 most downloaded on Go modules mozillazg/go-pinyin

What this package is like to depend on

Last release 1 years ago

19 Jul 2025

Release timing varies

gaps range from 2 months to 2.0 years

Nearly every release is documented

notes for 23 of 23 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

42 releases · first in 2014

0 releases in the last 12 months

see the full history below

Release timeline

42 releases · Nov 2014 to Jul 2025
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 42
  1. v0.21.1-0.20250719031703-0562d652b86d 19 Jul 2025 pre-release

    Nothing published for this version

  2. v0.21.0 19 Jul 2025
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.15.0 的拼音数据。
    • Changed 在启用多音字模式时,去除返回结果中的重复拼音。 (thanks [@cara4e] via [#62][#62])
    Open source →
  3. v0.20.1-0.20230712143255-62a3a65964d3 12 Jul 2023 pre-release

    Nothing published for this version

  4. v0.20.0 14 May 2023
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.13.0 的拼音数据
    Open source →
  5. v0.19.1-0.20230514120159-e3fbf1cbc11b 14 May 2023 pre-release

    Nothing published for this version

  6. v0.19.1-0.20220306140653-8930bc1fcb56 06 Mar 2022 pre-release

    Nothing published for this version

  7. v0.19.1-0.20211211145448-713ca0d94b57 11 Dec 2021 pre-release

    Nothing published for this version

  8. v0.19.0 11 Dec 2021
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.12.0 的拼音数据
    Open source →
  9. v0.18.1-0.20200613093737-9c8aa843ac77 13 Jun 2020 pre-release

    Nothing published for this version

  10. v0.18.0 13 Jun 2020
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.9.0 的拼音数据
    • Bugfixed 修复自定义的 Fallback 函数可能会导致结果乱码的问题 Fixes [#35]
    Open source →
  11. v0.17.0 09 Apr 2020
    Release notes
    • Changed 因为依赖的 gojieba 经常出现安装异常,撤销 v0.16.0 的修改,撤销后 v0.17.0 的代码跟 v0.15.0 基本是一样的。 如果有需要使用 v0.16.0 新增的 func Paragraph(p string) string 功能的请使用 v0.16.0 版本或者通过 v0.16.0 中相关代码实现类似的需求。
    Open source →
  12. v0.16.0 05 Dec 2019
    Release notes
    • NEW 增加 func Paragraph(p string) string 用于便捷处理大段文字 (thanks [@huacnlee] via [#37][#37])
    Open source →
  13. v0.15.0 06 Apr 2019
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.7.0 的拼音数据
    • NEW 添加 go.mod 文件
    Open source →
  14. v0.14.0 05 Aug 2018
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.6.1 的拼音数据
    • Changed 命令行工具移到 cmd/pinyin/ 目录下,现在需要改为使用 go get -u github.com/mozillazg/go-pinyin/cmd/pinyin 来安装命令行工具。
    Open source →
  15. v0.13.0 29 Apr 2018
    Release notes

    Auto merge of #31 - mozillazg:develop, r=mozillazg

    v0.13.0

    Open source →
    Release notes
    • Changed 使用 [pinyin-data][pinyin-data] v0.5.1 的拼音数据 (via [#30])
    • Changed 修改命令行工具 -s 参数的值(thanks [@wdscxsj][@wdscxsj] via [#19][#19]):
      • Normal 改为 zhao
      • Tone 改为 zh4ao
      • Tone2 改为 zha4o
      • Tone3 改为 zhao4
      • Initials 改为 zh
      • FirstLetter 改为 z
      • Finals 改为 ao
      • FinalsTone 改为 4ao
      • FinalsTone2 改为 a4o
      • FinalsTone3 改为 ao4
    • Changed 严格限制命令行参数中 -s 选项的值(thanks [@wdscxsj][@wdscxsj] via [#20][#20]):
    Open source →
  16. v0.12.0 25 Apr 2017
    Release notes

    Auto merge of #27 - mozillazg:new-0.12.0, r=mozillazg

    v0.12.0

    Open source →
    Release notes
    • NEW 命令行程序支持通过 -s 指定新增的 Tone3FinalsTone3 拼音风格

        $ pinyin -s Tone3 请至少输入一个汉字
        qing3 zhi4 shao3 shu1 ru4 yi1 ge4 han4 zi4
      
        $ pinyin -s FinalsTone3 请至少输入一个汉字
        ing3 i4 ao3 u1 u4 i1 e4 an4 i4
      
    • Changed use pinyin-data v0.4.1

    Open source →
  17. v0.11.0 28 Oct 2016
    Release notes
    • Changed 不再使用 0 表示轻声(因为之前并没有正确的实现这个功能, 同时也觉得这个功能没必要)。 顺便修复了 Tone2 中 ü 标轻声的问题(像 侵略 -> qi1n lv0e4

    • NEW 新增 Tone3FinalsTone3 拼音风格。

        hans := "中国人"
        args := pinyin.NewArgs()
        args.Style = pinyin.Tone3
        fmt.Println("Tone3:", pinyin.Pinyin(hans, args))
        // Output: Tone3: [[zhong1] [guo2] [ren2]]
      
        args.Style = pinyin.FinalsTone3
        fmt.Println("FinalsTone3:", pinyin.Pinyin(hans, args))
        // Output: FinalsTone3: [[ong1] [uo2] [en2]]
      
    Open source →
  18. v0.10.0 19 Oct 2016
    Release notes
    Open source →
  19. v0.9.0 04 Sep 2016
    Release notes
    • NEW 新增 func Convert(s string, a *Args) [][]string
    • NEW 新增 func LazyConvert(s string, a *Args) []string

    之所以增加这两个函数是希望 a 参数支持 nil

    Open source →
  20. v0.8.0 19 Aug 2016
    Release notes
    Open source →
  21. v0.7.0 02 Aug 2016
    Release notes
    • Changed use pinyin-data v0.2.0
    • Improved golint and gofmt
    Open source →
  22. v0.6.1-0.20160724125825-4ad9ec76e66f 24 Jul 2016 pre-release

    Nothing published for this version

  23. v0.6.0 16 May 2016
    Release notes
    • NEW 命令行程序支持指定拼音风格:

      $ pinyin -s Normal 你好
      ni hao
      
    • Bugfixed 解决韵母 i, u, ü 的问题:根据以下拼音方案,还原出正确的韵母 #8, python-pinyin#26

      i 行的韵母,前面没有声母的时候,写成:yi(衣),yɑ(呀),ye(耶), yɑo(腰),you(忧),yɑn(烟),yin(因),yɑnɡ(央),yinɡ(英),yonɡ(雍)。

      u 行的韵母,前面没有声母的时候,写成wu(乌),wɑ(蛙),wo(窝), wɑi(歪),wei(威),wɑn(弯),wen(温),wɑnɡ(汪),wenɡ(翁)。

      ü行的韵母跟声母j,q,x拼的时候,写成ju(居),qu(区),xu(虚), ü上两点也省略;但是跟声母l,n拼的时候,仍然写成lü(吕),nü(女)。

      注意 y 既不是声母也不是韵母。详见 汉语拼音方案

    • Bugfixed 解决未正确处理鼻音 ḿ, ń, ň, ǹ 的问题:包含鼻音的拼音不应该有声母

    Open source →
  24. v0.5.0 13 Mar 2016
    Release notes
    • CHANGE 改为使用来自 pinyin-data 的拼音数据。

    • NEW 命令行程序支持从标准输入读取数据(支持管道和重定向输入):

      $ echo "你好" | pinyin
      nǐ hǎo
      $ pinyin < hello.txt
      nǐ hǎo
      
    Open source →
  25. v0.4.0 29 Jan 2016
    Release notes
    • NEW Args 结构体新增 field: Fallback func(r rune, a Args) []string 用于处理没有拼音的字符(默认忽略没有拼音的字符):
      a := pinyin.NewArgs()
      a.Fallback = func(r rune, a pinyin.Args) []string {
          return []string{string(r + 1)}
      }
      fmt.Println(pinyin.Pinyin("中国人abc", a))
      // Output: [[zhong] [guo] [ren] [b] [c] [d]]
      
      // or
      pinyin.Fallback = func(r rune, a pinyin.Args) []string {
          return []string{string(r)}
      }
      fmt.Println(pinyin.Pinyin("中国人abc", pinyin.NewArgs()))
      // Output: [[zhong] [guo] [ren] [a] [b] [c]]
      
    Open source →
  26. v0.3.0 29 Dec 2015
    Release notes
    • fix "当字符串中有非中文的时候,会出现下标越界的情况"(影响 pinyin.LazyPinyinpinyin.Slug (#1))
    • 调整对非中文字符的处理:当遇到没有拼音的字符时,直接忽略
      // before
      fmt.Println(pinyin.Pinyin("中国人abc", pinyin.NewArgs()))
      [[zhong] [guo] [ren] [] [] []]
      
      // after
      fmt.Println(pinyin.Pinyin("中国人abc", pinyin.NewArgs()))
      [[zhong] [guo] [ren]]
      
    Open source →
  27. v0.2.2-0.20160128150700-e6080b6d2c1d 28 Jan 2016 pre-release

    Nothing published for this version

  28. v0.2.1 26 Aug 2015
    Release notes
    • yu, y, w 不是声母
    Open source →
  29. v0.2.0 04 Jan 2015
    Release notes
    • 新增 func NewArgs() Args
    • 解决 Args.Separator 无法赋值为 "" 的 BUG
    • 规范命名:
      • NORMAL -> Normal
      • TONE -> Tone
      • TONE2 -> Tone2
      • INITIALS -> Initials
      • FIRST_LETTER -> FirstLetter
      • FINALS -> Finals
      • FINALS_TONE -> FinalsTone
      • FINALS_TONE2 -> FinalsTone2
    Open source →
  30. v0.1.1 07 Dec 2014
    Release notes
    • 更新拼音库
    Open source →
  31. v0.1.0 23 Nov 2014
    Release notes
    • Initial Release
    Open source →
  32. v0.0.0-20250719031703-0562d652b86d 19 Jul 2025 pre-release

    Nothing published for this version

  33. v0.0.0-20230514120159-e3fbf1cbc11b 14 May 2023 pre-release

    Nothing published for this version

  34. v0.0.0-20200613093737-9c8aa843ac77 13 Jun 2020 pre-release

    Nothing published for this version

  35. v0.0.0-20200613092941-6973274cf21d 13 Jun 2020 pre-release

    Nothing published for this version

  36. v0.0.0-20200409145323-63be21f8a330 09 Apr 2020 pre-release

    Nothing published for this version

  37. v0.0.0-20191205134927-c9122b83263b 05 Dec 2019 pre-release

    Nothing published for this version

  38. v0.0.0-20190406141855-a1cd0b7f540a 06 Apr 2019 pre-release

    Nothing published for this version

  39. v0.0.0-20180805132345-b950aaffc7bf 05 Aug 2018 pre-release

    Nothing published for this version

  40. v0.0.0-20170425122650-ff1ea6f92b18 25 Apr 2017 pre-release

    Nothing published for this version

  41. v0.0.0-20161028140724-127001a9d785 28 Oct 2016 pre-release

    Nothing published for this version

  42. v0.0.0-20160129124619-0fee16eed53b 29 Jan 2016 pre-release

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive