越南语发音库 来自prodict 2007

链接:https://pan.baidu.com/s/1QLHO8FmYdMfWu2QiZo5y_Q?pwd=1269
提取码:1269

update4: 修复移动版欧路词典发音错误和ui
update3: 增加男发音。


udate2: 修复发音和查询错误
update:测试下来还是有些问题。。。。。有空再修复了。。。大部分没啥问题

Prodict 2007 là một trong hai bộ từ điển nổi tiếng được VCcorp mua lại phân phối miễn phí đến người dùng, với khoảng 600.000 từ trong gần 20 chuyên ngành phổ biến.

3 Likes

居然遇到学习越南语的,请教下楼主,越南语的词典app,除了Prodict,还有别的app可以推荐吗?

希望能有更多的这种小语种发音库。赞一个

我是初学者哈哈。
这个词库我看到掌上百科09年这个帖子发音库没人做,我就自己提取了。
第一次制作mdx词库,过程满折腾的,记录一下

  1. 这个词库的发音库dat文件是zip压缩文件,用7zip打开即可。
  2. 它的音频文件名映射到词条,并生成词库所用的txt文件,代码如下:
#include <QCoreApplication>
#include <QDebug>
#include <QDir>


QString suffixWithTones(QString vowel,QString suffix,QChar tone)
{
    if( vowel == "a")
    {
        if( suffix == "^") //ă
        {
            switch (tone.unicode()) {
            case '`'    :return "ằ";
            case '3'    :return "ẳ";
            case '~'    :return "ẵ";
            case '\''   :return "ắ";
            case '.'    :return "ặ";
            }
        }
        if( suffix == "(") //â
        {
            switch (tone.unicode()) {
            case '`'    :return "ầ";
            case '3'    :return "ẩ";
            case '~'    :return "ẫ";
            case '\''   :return "ấ";
            case '.'    :return "ậ";
            }
        }
    }

    if( vowel == "o")
    {
        if( suffix == "^") //ô
        {
            switch (tone.unicode()) {
            case '`'    :return "ò";
            case '3'    :return "ỏ";
            case '~'    :return "õ";
            case '\''   :return "ó";
            case '.'    :return "ọ";
            }
        }
        if( suffix == "+") //ơ
        {
            switch (tone.unicode()) {
            case '`'    :return "ờ";
            case '3'    :return "ở";
            case '~'    :return "ỡ";
            case '\''   :return "ớ";
            case '.'    :return "ợ";
            }
        }
    }

    if( vowel == "e")
    {
        if( suffix == "^") //ê
        {
            switch (tone.unicode()) {
            case '`'    :return "ề";
            case '3'    :return "ể";
            case '~'    :return "ễ";
            case '\''   :return "ế";
            case '.'    :return "ệ";
            }
        }
    }

    if( vowel == "u")
    {
        if( suffix == "+") //ư
        {
            switch (tone.unicode()) {
            case '`'    :return "ừ";
            case '3'    :return "ử";
            case '~'    :return "ữ";
            case '\''   :return "ứ";
            case '.'    :return "ự";
            }
        }
    }
}
QString onlySuffix(QString vowel,QChar suffix)
{
    if( vowel == "a")
    {
        switch (suffix.unicode()) {
        case '^':
            return "ă";
            break;
        case '(':
            return "â";
            break;
        default:
            break;
        }
    }
    if( vowel == "o")
    {
        switch (suffix.unicode()) {
        case '+':
            return "ơ";
            break;
        case '^':
            return "ô";
            break;
        default:
            break;
        }
    }
    if( vowel == "e")
    {
        if(suffix == "^")
        {
            return "ê";
        }
    }
    if( vowel == "u")
    {
       if(suffix == "+")
       {
           return "ư";
       }
    }
}
QString onlyTones(QString vowel,QChar tone)
{
    // aeiouy
    if( vowel == "a")
    {
        switch (tone.unicode()) {
            case '`'    :return "à";
            case '3'    :return "ả";
            case '~'    :return "ã";
            case '\''   :return "á";
            case '.'    :return "ạ";
        }
    }
    if( vowel == "e")
    {
        switch (tone.unicode()) {
            case '`'    :return "è";
            case '3'    :return "ẻ";
            case '~'    :return "ẽ";
            case '\''   :return "é";
            case '.'    :return "ẹ";
        }
    }
    if( vowel == "i")
    {
        switch (tone.unicode()) {
            case '`'    :return "ì";
            case '3'    :return "ỉ";
            case '~'    :return "ĩ";
            case '\''   :return "í";
            case '.'    :return "ị";
        }
    }
    if( vowel == "o")
    {
        switch (tone.unicode()) {
            case '`'    :return "ò";
            case '3'    :return "ỏ";
            case '~'    :return "õ";
            case '\''   :return "ó";
            case '.'    :return "ọ";
        }
    }
    if( vowel == "u")
    {
        switch (tone.unicode()) {
            case '`'    :return "ù";
            case '3'    :return "ủ";
            case '~'    :return "ũ";
            case '\''   :return "ú";
            case '.'    :return "ụ";
        }
    }
    if( vowel == "y")
    {
        switch (tone.unicode()) {
            case '`'    :return "ỳ";
            case '3'    :return "ỷ";
            case '~'    :return "ỹ";
            case '\''   :return "ý";
            case '.'    :return "ỵ";
        }
    }
}




QString parseInput(const QString &srcText)
{
    static const QString twoExpectedChars = "aeiouy";
    static const QString tones = "`'~.3";
    static const QString suffixs = "+^(";

    QString textToBeParsed = srcText;


    QString result;
    while( textToBeParsed.size() != 0 )
    {
        QChar c1 = textToBeParsed[0];
        QChar c2 = textToBeParsed[1];
        QChar c3 = textToBeParsed[2];


        if( twoExpectedChars.indexOf(c1) != -1)
        {
            //解释双探测字符

            // contains suffix
            if( suffixs.indexOf(c2) != -1)
            {
                //contains tones
                if( tones.indexOf(c3) != -1)
                {
                    result += suffixWithTones(c1,c2,c3);
                    textToBeParsed = textToBeParsed.mid(3);
                }
                else // not contains tones:mid-level tones
                {
                    result += onlySuffix(c1,c2);
                    textToBeParsed = textToBeParsed.mid(2);
                }
            }
            else // not contains suffix
            {
                if( tones.indexOf(c2) != -1)
                {
                    result += onlyTones(c1,c2);
                    textToBeParsed = textToBeParsed.mid(2);
                }
                else
                {
                    result += c1;
                    textToBeParsed = textToBeParsed.mid(1);
                }

            }


        }
        else if( c1 == "d" )
        {
            //解释单探测字符
            if(textToBeParsed[1] == "d")
            {
                result += "đ";
                textToBeParsed = textToBeParsed.mid(2);
            }
            else
            {
                result += "d";
                textToBeParsed = textToBeParsed.mid(1);
            }
        }
        else{
            // 不用解释
            result += c1;
            textToBeParsed = textToBeParsed.mid(1);
        }
    }
    return result;
}

void testFileName()
{

    QFile file("C:\\Users\\xxx\\Desktop\\testParsed.txt");

     if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
     {
         qDebug() << "fuck";
         return;
     }

    QTextStream out(&file);
    out.setCodec("UTF-8");

    QDir directory("C:\\Users\\gain3\\Desktop\\Voicevn_f");
    try{
        QStringList audios = directory.entryList(QStringList() << "*.wav",QDir::Files);
        foreach(QString filename, audios) {
            auto baseName = filename.mid(0,filename.length() -4);
//            qDebug() << baseName;
            out << baseName << " : " << parseInput(baseName) << "\n";
        }
    }catch(...)
    {
        qDebug() << "exception";
        return ;
    }
}

void genNewNameAndMdx()
{
    QDir directory("C:\\Users\\xxx\\Desktop\\Voicevn_f");
    QDir target("C:\\Users\\xx\\Desktop\\wav");
    QFile file("C:\\Users\\xx\\Desktop\\mdx.txt");


    if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
    {
        qDebug() << "fuck";
        return;
    }

   QTextStream out(&file);
   out.setCodec("UTF-8");
   /**

   ẳâêặ
   <a href="sound://accordeon.wav"><img src="speaker.png"></a>
   </>

    * @brief audios
    */


    QStringList audios = directory.entryList(QStringList() << "*.wav",QDir::Files);
    foreach(QString filename, audios) {
        auto baseName = filename.mid(0,filename.length() -4);
        auto parsedName = parseInput(baseName);
        QFile::copy(directory.absoluteFilePath(filename),target.absoluteFilePath(parsedName+".wav"));
        out << parsedName << "\n"
            << "<a href=\"sound://" + parsedName +".wav\"><img src=\"speaker.png\"></a>"<< "\n"
            << "</>\n";
    }

}



//< vietAudioGen srcDir dstTxt

int main(int argc, char *argv[])
{

//    qDebug() << parseInput("vatica(ng");
//    qDebug() << parseInput("vatica(3ng");
//    qDebug() << parseInput("vatica(~ng");
//    qDebug() << parseInput("vatica('ng");
//    qDebug() << parseInput("vatica^ng");
    genNewNameAndMdx();
    return 0;
}

  1. 将发音文件映射完毕,然后mdxbuilder生成。
    提示信息 - 掌上百科 - PDAWIKI - Powered by Discuz!

目前在线词典。
发音用

释义
https://vdict.com/

http://tratu.coviet.vn/

2 Likes

会写代码,很多越南词典可以自己做了。

提供我知道的有越南语发音的两个网站信息给楼主。
1,https://www.collinsdictionary.com/
有一万多英语单词有多语种的翻译和语音,其中包括越南语。本站collins2020全站mdx分享
有这些语音的链接,可以提取下载。
2,https://chunom.org/
有喃字和词的语音,单字有800多个,还有词。

1 Like

20221105更新,修复部份无法发音的问题

增加男性发音