[url=http://code.google.com/p/httpcws/]官方程序地址[/url]
安装在ubuntu9.10上:
cd /usr/localsudo wget http://httpcws.googlecode.com/files/httpcws-1.0.0-i386-bin.tar.gzsudo sutar zxvf httpcws-1.0.0-i386-bin.tar.gzcd httpcws-1.0.0-i386-binulimit -SHn 65535/usr/local/httpcws-1.0.0-i386-bin/httpcws -d -x /usr/local/httpcws-1.0.0-i386-bin/dict/ -p 2009
测试效果:
#!/usr/bin/env python# encoding: utf-8import urllibdef main(): title = u'基于HTTP协议的开源中文分词系统'.encode('gbk','replace') data = urllib.urlencode({'w':title}) url = 'http://192.168.15.50:2009/?%s'%data body = urllib.urlopen(url) print body.read().decode('gbk','replace')if __name__ == '__main__': main()
输出结果:基于 HTTP 协议 的 开源 中文 分词 系统
相关资源:敏捷开发V1.0.pptx