newmoonxx / chinesetopinyin Goto Github PK
View Code? Open in Web Editor NEW汉字转拼音 自适应多音字处理 姓名自动切分 c++,c#,js开源代码
汉字转拼音 自适应多音字处理 姓名自动切分 c++,c#,js开源代码
我是想用 qt 的 lineedit 做一个通过拼音就能补全提示人名的功能,所以找到了这个包,但是调用后没法显示拼音,感觉函数是起作用了,因为姓和名的分词效果是有的,就是不知道问题出在哪,而且使用前要将 .cpp 文件改成以 GB2312 编码保存才不会报错。
// 把所有人名按照拼音分类并存入map中
void MainWindow::PreparePinyinData(const QStringList &names)
{
for (auto name : names)
{
QString outFristPy,outFullPy;
getComPingyinForStr(name, outFristPy, outFullPy);
// QString pinyin = GetPinyin(name);
QString pinyin = outFullPy;
// qDebug() <<"FristPy:" << outFristPy << "FullPy:" << outFullPy;
// qDebug() <<"pinyin:" << pinyin;
QString fist, last;
myNameSplit(name, last, fist); // 自动切分 [姓、名]
last = getNamePingyin(last, true); // 获取 [姓] 的拼音
fist = getNamePingyin(fist, false);// 获取 [名] 的拼音
qDebug() << name + " : " + last + " " + fist << endl;
pinyin2NameMap[pinyin.toStdString()].push_back(name);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.