【发布时间】:2014-09-18 00:10:10
【问题描述】:
import re, codecs
import string
import sys
stopwords=codecs.open('stopwords_harkat1.txt','r','utf_8')
lines=codecs.open('Corpus_v2.txt','r','utf_8')
for line in lines:
line = line.rstrip().lstrip()
#print line
tokens = line.split('\t')
token=tokens[4]
if token in stopwords:
print token
此代码没有错误,但它不适用于来自不同文件的字符串匹配。任何人都可以帮助我吗?
$我也尝试了方法匹配但不起作用
【问题讨论】:
标签: python python-2.7 unicode unicode-string python-unicode