Python:return self._regexp.findall(text)TypeError:期望的字符串或缓冲区

时间:2015-07-27 15:14:45

标签: python nltk tokenize

运行代码时出现此错误 ICommand _saveCommand; public ICommand SaveCommand { get { return this._saveCommand ?? (this._saveCommand = new RelayCommand<IEnumerable<EnumSelection>>(x => this.Save(x))); } } private void Save(IEnumerable<EnumSelection> enums) { }

问题在于return self._regexp.findall(text) TypeError: expected string or buffer.

中的tokenize

我正在传递一个字符串列表,例如words_filtered = [e.lower() for e in WordPunctTokenizer().tokenize(words) if len(e) >= 3] 当我传递这样的元组[('this is a sentence'),('this is also a sentence'),...]时,这是有效的,所以我不确定为什么它没有正确解析列表。任何帮助都会非常感谢!

[('this is a sentence','sentiment'),('this is also a sentence','sentiment'),...]

0 个答案:

没有答案