如果我理解正确,这个小代码可能会有所帮助:(注意在 python 2.7.5 上测试)
paragraph = 'Steps toward this goal include: Increasing efficiency of mobile networks, data centers, data transmission, and spectrum allocation Reducing the amount of data apps have to pull from networks through caching, compression, and futuristic technologies like peer-to-peer data transfer Making investments in accessibility profitable by educating people about the uses of data, creating business models that thrive when free data access is offered initially, and building out credit card infrastructure so carriers can move from pre-paid to post-paid models that facilitate investment If the plan works, mobile operators will gain more customers and invest more in accessibility; phone makers will see people wanting better devices; Internet providers will get to connect more people; and people will receive affordable Internet so they can join the knowledge economy and connect with the people they care about.'
words = []
separators = ['.',',',':',';']
oldValue = 0
for value in range(len(paragraph)):
if paragraph[value] in separators:
words.append(paragraph[oldValue:value+1])
oldValue = value+2
for word in words:
print word
[编辑]
你也可以很容易地添加大写字母检查
if paragraph[value] == paragraph[value].upper():
words.append(paragraph[oldValue:value+1])
...