version 1.1.2.2, 2006/09/13 08:17:33
|
version 1.1.2.4, 2010/02/15 19:04:24
|
Line 5 name splitter
|
Line 5 name splitter
|
from Products.ZCTextIndex.ISplitter import ISplitter |
from Products.ZCTextIndex.ISplitter import ISplitter |
from Products.ZCTextIndex.PipelineFactory import element_factory |
from Products.ZCTextIndex.PipelineFactory import element_factory |
|
|
import psycopg |
|
|
|
import re |
import re |
from types import StringType |
from types import StringType |
Line 41 class nameSplitter:
|
Line 41 class nameSplitter:
|
default_encoding = "utf-8" |
default_encoding = "utf-8" |
|
|
def process(self, lsttmp): |
def process(self, lsttmp): |
print "XXX" |
import psycopg |
result = [] |
result = [] |
o = psycopg.connect('dbname=authorities user=dwinter password=3333',serialize=0) |
o = psycopg.connect('dbname=authorities user=dwinter password=3333',serialize=0) |
c = o.cursor() |
c = o.cursor() |
Line 73 except:
|
Line 73 except:
|
pass |
pass |
|
|
if __name__ == '__main__': |
if __name__ == '__main__': |
a = 'abc def我们的很 好。' |
a = 'abc def\U00CE\U00D2\U00D3\U00C7\U00B5\U00C4 \U00DC\U00C3\U00A1\U00A3' |
u = unicode(a, 'gbk') |
u = unicode(a, 'gbk') |
s = authorSplitter() |
s = authorSplitter() |
print s.process([u]) |
print s.process([u]) |