• <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
            <2015年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            享受編程

            常用鏈接

            留言簿(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 漂漂 閱讀(1151) 評論(0)  編輯 收藏 引用
            久久久久久久亚洲Av无码| 99久久久精品免费观看国产| 久久精品二区| 2021最新久久久视精品爱| 久久亚洲精品人成综合网| 久久青青草原国产精品免费| 日本久久久久久久久久| 色偷偷88888欧美精品久久久| 国产69精品久久久久99| 久久精品国产99国产精品亚洲| 国产美女久久久| 久久亚洲精品无码aⅴ大香 | 香蕉久久永久视频| 少妇久久久久久被弄高潮| 久久久噜噜噜久久| 久久99精品久久久久久| 狠狠色婷婷久久综合频道日韩| 国产成人精品综合久久久| 日本人妻丰满熟妇久久久久久| 久久无码精品一区二区三区| 国产精品视频久久久| 亚洲综合日韩久久成人AV| 久久露脸国产精品| 国产精品久久久99| 国产成人精品久久一区二区三区av | 精品国产乱码久久久久久浪潮| 亚洲人成电影网站久久| 国产精品99久久精品| 国内精品人妻无码久久久影院导航| 国产福利电影一区二区三区久久久久成人精品综合 | 久久伊人五月天论坛| 精品久久久久久99人妻| 精品久久一区二区| 久久精品视频网| 9191精品国产免费久久| 嫩草影院久久99| 狠狠色伊人久久精品综合网| 国产亚州精品女人久久久久久| 国产A级毛片久久久精品毛片| 91超碰碰碰碰久久久久久综合| 大美女久久久久久j久久|