• <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)  編輯 收藏 引用
            亚洲精品午夜国产va久久| 亚洲欧美另类日本久久国产真实乱对白| 精品久久久久久无码人妻热| 91性高湖久久久久| 亚洲欧美日韩精品久久亚洲区| 久久亚洲精品中文字幕| 国产精品久久波多野结衣| 久久久久久A亚洲欧洲AV冫| 国内精品九九久久精品| 国产91久久综合| 无码超乳爆乳中文字幕久久| 国産精品久久久久久久| 亚洲精品蜜桃久久久久久| 久久99久久成人免费播放| 亚洲精品蜜桃久久久久久| 久久天天日天天操综合伊人av| 久久亚洲精精品中文字幕| 久久亚洲欧洲国产综合| 久久r热这里有精品视频| 久久综合久久美利坚合众国| 国产精品久久久久一区二区三区 | 麻豆国内精品久久久久久| 久久伊人五月丁香狠狠色| 成人精品一区二区久久| 九九久久自然熟的香蕉图片| 无码国内精品久久人妻麻豆按摩| 伊人久久综在合线亚洲2019| 久久青青草原精品国产| 免费精品久久天干天干| 久久人人超碰精品CAOPOREN| 一本久久久久久久| 国产精品伊人久久伊人电影| 亚洲国产精品人久久| 久久国产精品久久久| 久久九九有精品国产23百花影院| 97超级碰碰碰久久久久| 99久久免费国产特黄| 99精品久久精品一区二区| 国产精品久久久天天影视| 久久99国产精品99久久| 久久综合综合久久狠狠狠97色88|