Code Monkey home page Code Monkey logo

pinyin4j-multi's Introduction

pinyin4j-multi-ext

Forked from https://github.com/obiteaaron/pinyin4j-multi

多音字识别

在pinyin4j的基础上添加了多音字识别,带近一万个多音词,但是这远远不够,所以用户可设置外挂词库

外挂多音词库

用户配置的外挂词库会覆盖系统中相同词的读音,可用于纠错

配置方式很简单,只需要配置路径即可

MultiPinyinConfig.multiPinyinPath="/Users/yiboliu/my_multi_pinyin.txt"

格式同系统的多音词库,如:

吸血鬼日记 (xi1,xue4,gui3,ri4,ji4)

多音词排列组合,如:

System.out.println(PinyinHelper.Multitone("重庆"));
{simple_spell=[zq][cq], full_spell=[zhongqing][chongqing], full_spell_tone=[zhong4qing4][chong2qing4]}

重庆(zhong4qing4,chong2qing4) 全拼带声调
重庆(zhongqing,chongqing)     全拼不带声调
重庆(zq,cq)                   首字母

中文数字转阿拉伯数字,如:

System.out.println(PinyinHelper.Chinese2Arab("三百五十六万零三百"));
三百五十六万零三百  =》 3560300

(中文+中文数字+字母+阿拉伯数字)排序,如:

我520我的家五十一  =》 wo300520wo3de5jia100051
我71我的家五十二   =》 wo300071wo3de5jia100052

System.out.println(PinyinHelper.getSortNameSpell("我71我的家五十二"));
System.out.println(PinyinHelper.getSortNameSpell("我520我的家五十一"));
        

排序后
wo300071wo3de5jia100052    我71我的家五十二
wo300520wo3de5jia100051    我520我的家五十一

pinyin4j-multi's People

Contributors

obiteaaron avatar belerweb avatar shangzefeng avatar

Stargazers

Billow Drower avatar  avatar

Watchers

James Cloos avatar D avatar V avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.