易截截图软件、单文件、免安装、纯绿色、仅160KB

[转]使用python调用计算所分词

发信人: TRAD (GFans), 信区: NLP
标  题: 原创:使用python调用计算所分词
发信站: 水木社区 (Mon Nov 23 13:30:46 2009), 站内
代码很简单,但我自己摸索了一下午,发出来共享一下
把这个文件同ICTALAS30.DLL ,DATA文件夹,Configure.xm l放在同一个目录下即可。
python代码
#coding:gb2312 
from ctypes import * 
 
dll=cdll.LoadLibrary("ICTCLAS30.dll") 
dll.ICTCLAS_Init(c_char_p(".")) 
lpText = u"计算所汉语词法分析系统ICTCLAS调用测试" 
bSuccess = dll.ICTCLAS_ParagraphProcess(c_char_p(lpText), 1) 
print c_char_p(bSuccess).value,lpText 
dll.ICTCLAS_Exit() 
--
※ 来源:·水木社区 http://newsmth.net·[from: 203.86.35.*]


相关文档:

python中的exec 函数

      在项目里面一个解析文本的工具里面用到了这个命令来赋值,开始一直知道意思,呵呵 查了下,找到方法如下:
exec
语句用来执行储存在字符串或文件中的Python语句。例如,我们可以在运行时生成一个包含Python代码的字符串,然后使用
exec
语句执行这些语句。下面是一个简单的例子。
> ......

Python 线程池


import Queue, threading, sys
from threading import Thread
import time,urllib
# working thread
class Worker(Thread):
   worker_count = 0
   def __init__( self, workQueue, resultQueue, timeout = 0, **kwds):
       Thread.__init__( self, **kwds ) ......

opencv python cool

当年做毕业论文的时候openCV就像是我的瑞士军刀,太有感情了。如今用了一年多的python,发现openCV也有python版本了,真是太酷了!当然python在处理图像时还可以用其它库例如PIL(Python Imaging Library ),一种轻量级的图像库。目前openCV1.0版本对应的python版本为2.5,openCV2.0对应python 2.6。
附录:
1. 一篇介绍图 ......

深入 GalCon:Python、游戏开发和人工智能

Alex. J. Champandard
赖勇浩(http://laiyonghao.com) 译
原文地址:http://aigamedev.com/open/interviews/inside-galcon-python-ai/
AiGameDev.com在这个周一的 pratical insights 是对Phil Hassey采访。Phil 是一个独立游戏开发者,也是游戏产业社区的活跃分子。他曾赢得2006年4月的 Ludum Dare 比赛(这个比赛关注 ......

Python & XML


Chapter 1
Python and XML
Python and XML are two very different animals, each with a rich
history. Python is a full-scale programming language that has grown
from scripting world roots in a very organic way, through the vision
and guidance of Python's inventor, Guido van Rossum. Guido continue ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号