• <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
            <2011年5月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經(jīng)典c++博客

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

             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.


            很多同學(xué)都會(huì)出現(xiàn)亂碼的問(wèn)題??赡苁莔mseg支持的是utf8, windows的本地默認(rèn)編碼是cp936,也就是gbk編碼,所以在控制臺(tái)直接打印utf-8的字符串當(dāng)然是亂碼了。 
            解決方法:
            在控制臺(tái)打印的地方用一個(gè)轉(zhuǎn)碼就ok了,打印的時(shí)候這么寫(xiě):
            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) 評(píng)論(0)  編輯 收藏 引用
            久久久91精品国产一区二区三区 | 99久久精品免费看国产一区二区三区| 99久久99久久精品国产| 大蕉久久伊人中文字幕| 亚洲欧美日韩精品久久| 伊人久久大香线蕉AV一区二区| 国产毛片欧美毛片久久久| 99久久99这里只有免费的精品| 91精品免费久久久久久久久| 久久久精品人妻无码专区不卡| 久久久久久无码国产精品中文字幕 | 思思久久99热只有频精品66| 人妻无码αv中文字幕久久| 99国内精品久久久久久久 | 久久久噜噜噜久久中文福利| 久久国产免费直播| 久久99精品久久久久久| 一本色道久久HEZYO无码| 久久99精品国产99久久6| 国产精品久久久久久吹潮| 国内精品久久久久影院老司| 久久婷婷综合中文字幕| 乱亲女H秽乱长久久久| 大香伊人久久精品一区二区| 国产午夜精品久久久久九九电影| 97久久国产综合精品女不卡 | 国产99精品久久| 久久久久成人精品无码中文字幕| 欧洲国产伦久久久久久久| 国产精品成人久久久久久久| 久久久久亚洲Av无码专| 久久SE精品一区二区| 国产日韩久久久精品影院首页| av国内精品久久久久影院| 久久99热这里只有精品国产| 色青青草原桃花久久综合| 日韩十八禁一区二区久久 | 男女久久久国产一区二区三区| 精品国产乱码久久久久久呢| 少妇内射兰兰久久| 国产成人久久AV免费|