GithubHelp home page GithubHelp logo

newmoonxx / chinesetopinyin Goto Github PK

View Code? Open in Web Editor NEW
51.0 1.0 18.0 234 KB

汉字转拼音 自适应多音字处理 姓名自动切分 c++,c#,js开源代码

C++ 39.95% C# 29.82% C 1.09% JavaScript 29.14%

chinesetopinyin's People

Contributors

newmoonxx avatar softworm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

chinesetopinyin's Issues

使用的是QString文件,转换后打印仍然是汉字

问题描述

我是想用 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);
    }
}

图片

汉字转拼音问题

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.