私があなたを正しく理解していれば、この小さなコードが役に立ちます:(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])
...