2017-02-24

I have a text, let’s say with 5 sentences:

Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing.
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Using python, how can I convert it to a two demensianal array, where each sentence is splitted in separated words?

If we take a first sentence as an example, here is what I need to be a first element of an array:

['lorem', 'ipsum', 'is', 'simply', 'dummy', 'text', 'of', 'the', 'printing', 'and', 'typesetting', 'industry']

I can make it with the following commands:

But how can I make the array of such elements by looping through the text of sentences?

Thanks in advance!

Show more