• <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)  編輯 收藏 引用
            性高湖久久久久久久久AAAAA| 国产婷婷成人久久Av免费高清| 97久久久久人妻精品专区 | 久久亚洲天堂| 精品熟女少妇AV免费久久| 99久久99久久精品免费看蜜桃| 精品国产热久久久福利| 亚洲日本久久久午夜精品| 精品久久久久久无码专区| 欧美日韩成人精品久久久免费看| 中文字幕久久波多野结衣av| 亚洲国产二区三区久久| 亚洲综合伊人久久大杳蕉| 国产精品一区二区久久精品无码| 99精品久久久久久久婷婷 | 久久九九兔免费精品6| 久久99国产乱子伦精品免费| 亚洲精品无码久久毛片| 狠狠干狠狠久久| 久久综合香蕉国产蜜臀AV| 亚洲七七久久精品中文国产| 伊人久久免费视频| 国产亚洲精品自在久久| 亚洲综合熟女久久久30p| 久久无码一区二区三区少妇| 久久久久国产精品| 久久青草国产精品一区| 久久久久亚洲AV无码永不| 97精品伊人久久大香线蕉| 久久影院午夜理论片无码| 久久久久免费精品国产| 久久精品男人影院| 热久久国产精品| 国产精品永久久久久久久久久| 国产成人精品久久综合| 国产成人香蕉久久久久| 国产成人99久久亚洲综合精品| 亚洲国产成人久久综合一| 91秦先生久久久久久久| 久久青青草原亚洲av无码| 亚洲国产成人久久综合碰|