• <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
            <2008年11月>
            2627282930311
            2345678
            9101112131415
            16171819202122
            23242526272829
            30123456

            享受編程

            常用鏈接

            留言簿(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.


            很多同學都會出現亂碼的問題。可能是mmseg支持的是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 漂漂 閱讀(1147) 評論(0)  編輯 收藏 引用
            久久夜色精品国产亚洲av| 久久香蕉国产线看观看精品yw | 一本久久久久久久| 久久久精品波多野结衣| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区| 久久精品国产99久久香蕉| 久久人做人爽一区二区三区| 国产午夜精品久久久久免费视| 久久久WWW成人免费毛片| 伊人久久久AV老熟妇色| 久久亚洲国产成人影院网站| 无码人妻少妇久久中文字幕蜜桃| 久久久WWW免费人成精品| 久久精品水蜜桃av综合天堂| 久久九色综合九色99伊人| 久久久久久久97| 99精品国产免费久久久久久下载| 久久青草国产精品一区| 久久久久久精品免费免费自慰| 国产精品免费久久久久电影网| 蜜臀久久99精品久久久久久小说| 99久久综合国产精品二区| 99久久超碰中文字幕伊人| 久久精品日日躁夜夜躁欧美| 久久99精品久久久久久不卡| 国产精品久久久久9999高清| 欧洲精品久久久av无码电影| 伊人久久大香线蕉精品不卡| 精品无码久久久久久久久久| 免费观看成人久久网免费观看| 人妻无码αv中文字幕久久琪琪布| 久久强奷乱码老熟女| 国内精品久久久久久久久| 91麻精品国产91久久久久 | 久久精品亚洲精品国产色婷| 狠狠色丁香婷婷久久综合五月| 伊人久久大香线蕉综合5g| 伊人伊成久久人综合网777| 无码乱码观看精品久久| 久久夜色精品国产| 少妇无套内谢久久久久|