go-pinyin alternatives and similar packages
Based on the "Natural Language Processing" category.
Alternatively, view go-pinyin alternatives based on common mentions on social networks and blogs.
-
prose
:book: A Golang library for text processing, including tokenization, part-of-speech tagging, and named-entity extraction. -
gse
Go efficient multilingual NLP and text segmentation; support English, Chinese, Japanese and others. -
spaGO
Self-contained Machine Learning and Natural Language Processing library in Go -
kagome
Self-contained Japanese Morphological Analyzer written in pure Go -
nlp
[UNMANTEINED] Extract values from strings and fill your structs with nlp. -
universal-translator
:speech_balloon: i18n Translator for Go/Golang using CLDR data + pluralization rules -
locales
:earth_americas: a set of locales generated from the CLDR Project which can be used independently or within an i18n package; these were built for use with, but not exclusive to https://github.com/go-playground/universal-translator -
RAKE.go
A Go port of the Rapid Automatic Keyword Extraction algorithm (RAKE) -
go-nlp
Utilities for working with discrete probability distributions and other tools useful for doing NLP work. -
segment
A Go library for performing Unicode Text Segmentation as described in Unicode Standard Annex #29 -
textcat
A Go package for n-gram based text categorization, with support for utf-8 and raw text -
go-localize
i18n (Internationalization and localization) engine written in Go, used for translating locale strings. -
stemmer
Stemmer packages for Go programming language. Includes English, German and Dutch stemmers. -
petrovich
Golang port of Petrovich - an inflector for Russian anthroponyms. -
go-tinydate
A tiny date object in Go. Tinydate uses only 4 bytes of memory -
golibstemmer
Go bindings for the snowball libstemmer library including porter 2 -
gotokenizer
A tokenizer based on the dictionary and Bigram language models for Go. (Now only support chinese segmentation) -
spreak
Flexible translation and humanization library for Go, based on the concepts behind gettext. -
gosentiwordnet
💬 Sentiment analyzer library using SentiWordnet in Go
ONLYOFFICE Docs — document collaboration in your environment
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of go-pinyin or a related project?
README
go-pinyin
汉语拼音转换工具 Go 版。
Installation
go get -u github.com/mozillazg/go-pinyin
install CLI tool:
go get -u github.com/mozillazg/go-pinyin/cmd/pinyin
$ pinyin 中国人
zhōng guó rén
Documentation
API documentation can be found here: https://godoc.org/github.com/mozillazg/go-pinyin
Usage
package main
import (
"fmt"
"github.com/mozillazg/go-pinyin"
)
func main() {
hans := "中国人"
// 默认
a := pinyin.NewArgs()
fmt.Println(pinyin.Pinyin(hans, a))
// [[zhong] [guo] [ren]]
// 包含声调
a.Style = pinyin.Tone
fmt.Println(pinyin.Pinyin(hans, a))
// [[zhōng] [guó] [rén]]
// 声调用数字表示
a.Style = pinyin.Tone2
fmt.Println(pinyin.Pinyin(hans, a))
// [[zho1ng] [guo2] [re2n]]
// 开启多音字模式
a = pinyin.NewArgs()
a.Heteronym = true
fmt.Println(pinyin.Pinyin(hans, a))
// [[zhong zhong] [guo] [ren]]
a.Style = pinyin.Tone2
fmt.Println(pinyin.Pinyin(hans, a))
// [[zho1ng zho4ng] [guo2] [re2n]]
fmt.Println(pinyin.LazyPinyin(hans, pinyin.NewArgs()))
// [zhong guo ren]
fmt.Println(pinyin.Convert(hans, nil))
// [[zhong] [guo] [ren]]
fmt.Println(pinyin.LazyConvert(hans, nil))
// [zhong guo ren]
}
注意:
- 默认情况下会忽略没有拼音的字符(可以通过自定义
Fallback
参数的值来自定义如何处理没有拼音的字符, 详见 示例)。 - 根据 《汉语拼音方案》 y,w,ü (yu) 都不是声母,
以及不是所有拼音都有声母,如果这不是你预期的话,你可能需要的是首字母风格
FirstLetter
( 详细信息 )。
Related Projects
- hotoo/pinyin: 汉语拼音转换工具 Node.js/JavaScript 版。
- mozillazg/python-pinyin: 汉语拼音转换工具 Python 版。
- mozillazg/rust-pinyin: 汉语拼音转换工具 Rust 版。
pinyin data
- 使用 pinyin-data 的拼音数据
License
Under the MIT License.
*Note that all licence references and agreements mentioned in the go-pinyin README section above
are relevant to that project's source code only.