• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 224  文章 - 41  trackbacks - 0
            <2011年5月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經(jīng)典c++博客

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

             pymmseg-cpp
            http://code.google.com/p/pymmseg-cpp/

            pymmseg-cpp is a Python port of the rmmseg-cpp project. rmmseg-cpp is a MMSEG Chinese word segmenting algorithm implemented in C++ with a Ruby interface.

            Download the binary release on the right sidebar and copy the pymmseg directory to your Python's path (e.g. /usr/lib/python2.5/site-packages/). Here's an example of usage:

            from pymmseg import mmseg

            mmseg
            .dict_load_defaults()
            text
            = # ...
            algor
            = mmseg.Algorithm(text)
            for tok in algor:
            print '%s [%d..%d]' % (tok.text, tok.start, tok.end)

            Or you can download the source tarball or check out the latest code from the git repo hosted at github. Then you'll need to build the mmseg-cpp module yourself: goto the mmseg-cpp subdirectory and run the build.py script. It will build the native module for you.

            For more information, refer to the README file.


            很多同學(xué)都會(huì)出現(xiàn)亂碼的問(wèn)題??赡苁莔mseg支持的是utf8, windows的本地默認(rèn)編碼是cp936,也就是gbk編碼,所以在控制臺(tái)直接打印utf-8的字符串當(dāng)然是亂碼了。 
            解決方法:
            在控制臺(tái)打印的地方用一個(gè)轉(zhuǎn)碼就ok了,打印的時(shí)候這么寫(xiě):
            print myname.decode('UTF-8').encode('GBK') 


            from pymmseg import mmseg

            mmseg
            .dict_load_defaults()
            text
            = # ...
            algor
            = mmseg.Algorithm(text)
            for tok in algor:
            print '%s [%d..%d]' % (tok.text.decode('UTF-8').encode('GBK') , tok.start, tok.end)

            posted on 2011-05-03 13:27 漂漂 閱讀(1151) 評(píng)論(0)  編輯 收藏 引用
            伊人久久大香线蕉亚洲| 国产综合久久久久久鬼色| 久久久无码精品午夜| 久久久午夜精品| 国产99精品久久| 亚洲?V乱码久久精品蜜桃| 亚洲精品乱码久久久久久蜜桃不卡 | 国内精品久久久久影院日本| 四虎国产精品免费久久久| 麻豆久久久9性大片| 久久国产高清字幕中文| 综合久久一区二区三区| 99久久婷婷免费国产综合精品| 久久久久噜噜噜亚洲熟女综合| 久久久久亚洲AV成人片| 欧美粉嫩小泬久久久久久久| 国产精品久久久久久久久鸭| 影音先锋女人AV鲁色资源网久久| 久久青青草原国产精品免费| 精品久久久无码21p发布| 97精品国产97久久久久久免费| 亚洲色欲久久久综合网| 一97日本道伊人久久综合影院| 久久er国产精品免费观看2| 亚洲国产精品无码久久一区二区| 久久国产精品免费一区| 国产成人99久久亚洲综合精品| 久久久噜噜噜久久熟女AA片| 一本一本久久A久久综合精品| 久久一区二区三区免费| 久久本道久久综合伊人| 成人亚洲欧美久久久久| 99久久综合国产精品二区| 国内精品久久九九国产精品| 国产精品久久毛片完整版| 精品乱码久久久久久久| 成人妇女免费播放久久久| 国产三级久久久精品麻豆三级| 亚洲精品乱码久久久久久自慰| 久久婷婷五月综合色奶水99啪| 国内精品久久人妻互换|