【发布时间】:2016-01-16 16:47:09
【问题描述】:
我不得不在 Python 中进行文本处理。
于是我创建了一个类TextProcessing:
manipulator = TextProcessing("one two three four four")
repr(manipulator) => "one two three four four"
manipulator["four"] //=> [3, 4] => I made a list for that
但在那之后我不得不做一个这样的函数:
manipulator.two.replace("second") => "one second three four four"
我不知道如何将这两者与我的列表联系起来。
【问题讨论】: