• <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
            <2010年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經典c++博客

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

             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.


            很多同學都會出現亂碼的問題??赡苁莔mseg支持的是utf8, windows的本地默認編碼是cp936,也就是gbk編碼,所以在控制臺直接打印utf-8的字符串當然是亂碼了。 
            解決方法:
            在控制臺打印的地方用一個轉碼就ok了,打印的時候這么寫:
            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) 評論(0)  編輯 收藏 引用
            久久久久久亚洲精品成人| 韩国无遮挡三级久久| 欧美性猛交xxxx免费看久久久| 久久精品免费网站网| 日韩欧美亚洲综合久久| 久久精品人人做人人妻人人玩| 狠狠88综合久久久久综合网| 国产精品成人99久久久久91gav | 精品综合久久久久久98| av国内精品久久久久影院| 无夜精品久久久久久| 久久久久亚洲av无码专区导航| 久久se精品一区二区影院| 天堂久久天堂AV色综合| 久久久久成人精品无码| 2021精品国产综合久久| 久久这里只有精品首页| 99热热久久这里只有精品68| 久久www免费人成看片| 久久久久九国产精品| 久久se精品一区精品二区| 午夜天堂精品久久久久| 欧美成a人片免费看久久| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 久久91精品综合国产首页| 中文字幕无码久久人妻| 精品无码久久久久久久动漫| 日本WV一本一道久久香蕉| 日本精品久久久久久久久免费| 久久精品中文字幕久久| 伊人久久大香线焦AV综合影院| 精品一区二区久久久久久久网站| 亚洲国产精品久久久天堂 | 久久久人妻精品无码一区| 久久99免费视频| 伊人久久综合热线大杳蕉下载| 欧美噜噜久久久XXX| 精品久久久久久无码中文字幕一区| 久久精品久久久久观看99水蜜桃| 一级a性色生活片久久无少妇一级婬片免费放 | 人妻无码αv中文字幕久久琪琪布|