<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      sunpinyin “二次開發(fā)”

      此貼介紹sunpinyin. 它的用戶詞典是~/.sunpinyin/userdict,下面的程序往里面加詞:

      // -I/usr/include/sunpinyin-2.0 add-word.cpp -lsunpinyin
      
      #include <ime-core/userdict.h>
      #include <pinyin/pinyin_data.h>
      
      TSyllable (*py2i)(const char*) = CPinyinData::encodeSyllable;
      
      int main(int argc, char** argv) {
        if (argc != 2) return 0;
      
        CUserDict ud;
        ud.load(argv[1]); // 文件可以不存在
      
        CSyllables slbs; // typedef vector<TSyllable> CSyllables
        slbs.resize(2);
        slbs[0] = py2i("yi");
        slbs[1] = py2i("er");
      
        // If locale is an empty string, ""... is set according to the environment variables
        setlocale(LC_CTYPE, "");
        unsigned  wcs[3] = {};
        int n = mbstowcs((wchar_t*)wcs, "①②", 2);
      
        ud.addWord(slbs, wcs);
        return 0;
      }
      View Code

      apt install libsunpinyin-dev

      多次加同一個(gè)詞不會(huì)出來n條。

      userdict是個(gè)sqlite數(shù)據(jù)庫,里面有且僅有一張表dict. 下面是常用sqlite 命令:

      導(dǎo)入導(dǎo)出
      
      sqlite3 file.db .dump >dump.sql
      sqlite3 file.db <dump.sql
      
      .tables - 查看所有表名 
      .schema 表名 - 查看特定表結(jié)構(gòu)
      
      select * from dict ;
      View Code

      不用編譯它的源碼,用現(xiàn)成的程序也能訓(xùn)練出online用的數(shù)據(jù)。程序在包sunpinyin-utils里:

      • genpyt - generate the PINYIN lexicon
      • getwordfreq - print word freq information from language model
      • idngram_merge - merge idngram file into one
      • ids2ngram - generate n-gram data file from ids file
      • mmseg - maximum matching segment Chinese text
      • slmbuild - generate language model from idngram file
      • slminfo - get information of a back-off language model
      • slmpack - convert the ARPA format of SunPinyin back-off language model to its binary representation
      • slmprune - prune the back-off language model to a reasonable size
      • slmseg - maximum matching segment Chinese text. slmthread add back-off-state for each slm node in the primitive_slm. Also it compresses 32-bit float into 16 bit representation. These processing speeds up the looking up. The primitive_slm is always generated by slmprune. And the threaded_slm can be used to feed slmseg as a reference to segment Chinese text.
      • slmthread - threads the language model
      • tslmendian - change the byte-order of sunpinyin's threaded back-off language model
      • tslminfo - get information of a threaded back-off language model

      不是所有的程序都要用到。

      在gitee能下載到phrase-pinyin-data-master.zip和chinese-dictionary-main.zip.

      106666 cc_cedict.txt
      6850 di.txt
      411960 large_pinyin.txt
      872 overwrite.txt
      47115 pinyin.txt
      348513 zdic_cibs.txt
      32633 zdic_cybs.txt
      954609 總計(jì)
      
      ?犬: gěng quǎn
      View Code

      iconv可轉(zhuǎn)換文件編碼。

      sunpinyin用上了谷歌的系統(tǒng)詞庫

      posted @ 2025-10-24 19:04  華容道專家  閱讀(3)  評論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 蜜桃久久精品成人无码av | 国产AV无码专区亚洲AWWW| 亚洲二区中文字幕在线| 人妻中文字幕不卡精品| 老妇xxxxx性开放| 天堂一区人妻无码| 美女人妻激情乱人伦| 久久香蕉国产亚洲av麻豆| 亚洲男人天堂2018| 久久国产成人午夜av影院| 亚洲综合精品香蕉久久网| 日本一卡2卡3卡四卡精品网站| 亚洲中文字幕一区精品自 | 亚洲国产精品一区二区第一页| 国产成人AV男人的天堂| 精品国精品国自产在国产| 无码吃奶揉捏奶头高潮视频| 人妻体内射精一区二区三区| 麻豆国产成人AV在线播放| 亚洲综合伊人久久综合| 国产色悠悠综合在线观看| 国产盗摄xxxx视频xxxx| 玩弄人妻少妇500系列| 99久久久无码国产麻豆| 国产精品免费视频不卡| 野花社区在线观看视频| 亚洲成A人片在线观看无码不卡 | 国产精品va在线观看h| 国产乱人伦AV在线麻豆A| 久女女热精品视频在线观看| 国产日韩入口一区二区| 国产97视频人人做人人爱| 国产良妇出轨视频在线观看| 国产精品尤物乱码一区二区| 少妇又爽又刺激视频| 少妇大叫太大太爽受不了| 亚洲 欧美 综合 另类 中字| 免费av深夜在线观看| 欧美日韩中文国产一区| 国产av综合影院| 国产午夜精品福利视频|