• <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)  編輯 收藏 引用
            无码国内精品久久人妻麻豆按摩 | 色欲av伊人久久大香线蕉影院| 久久综合视频网站| 久久精品免费全国观看国产| 亚洲AV无码一区东京热久久| 国产日韩久久免费影院| 国内精品久久久久影院优| 欧美精品国产综合久久| 久久久WWW免费人成精品| 亚洲一区中文字幕久久| 精品熟女少妇a∨免费久久| 久久伊人亚洲AV无码网站| 国产午夜久久影院| 国产一区二区精品久久岳| 国产精品成人99久久久久91gav| 久久亚洲精品国产精品| 久久久噜噜噜久久中文字幕色伊伊| 久久99精品国产麻豆婷婷| 国产精品女同久久久久电影院| 色老头网站久久网| 亚洲中文字幕久久精品无码喷水| 久久久久久伊人高潮影院| 亚洲国产日韩欧美久久| 色婷婷综合久久久中文字幕| 少妇内射兰兰久久| 久久精品国产精品亚洲精品| 久久777国产线看观看精品| 久久本道久久综合伊人| 久久综合亚洲鲁鲁五月天| 国内精品久久久久影院一蜜桃| 国产日韩久久免费影院| 亚洲成色WWW久久网站| 大香网伊人久久综合网2020| 欧美熟妇另类久久久久久不卡| 久久久久九国产精品| 国产精品久久久久无码av| 精品久久久无码人妻中文字幕 | 情人伊人久久综合亚洲| 一级a性色生活片久久无少妇一级婬片免费放| 久久最新免费视频| 久久久WWW成人免费精品|