Free private sec chat
Instead, you can come up with your own name for a task, like "lexical_diversity" or "percentage", and associate it with a block of code.Now you only have to type a short name instead of one or more complete lines of Python code, and you can re-use it as often as you like.Once the data is downloaded to your machine, you can load some of it using the Python interpreter.The first step is to type a special command at the Python prompt which tells the interpreter to load some texts for us to explore: module contains all the data you will need as you read this chapter.Don't worry if you find it a bit confusing right now.Later we'll see how to use functions when tabulating data, as in 1.1.It consists of about 30 compressed files requiring about 100Mb disk space.
As before, you will jump right in and experiment with the Python interpreter, even though you may not have studied Python systematically yet.
Once you've installed NLTK, start up the Python interpreter as before, and install the data required for the book by typing the following two commands at the Python prompt, then selecting the .
The Collections tab on the downloader shows how the packages are grouped into sets, and you should select the line labeled book to obtain all data required for the examples and exercises in this book.
For example, search Once you've spent a little while examining these texts, we hope you have a new sense of the richness and diversity of language. Each stripe represents an instance of a word, and each row represents the entire text.
In the next chapter you will learn how to access a broader range of text, including text in languages other than English. In 1.2 we see some striking patterns of word usage over the last 220 years (in an artificial text constructed by joining the texts of the Inaugural Address Corpus end-to-end). You might like to try more words (e.g., The most obvious fact about texts that emerges from the preceding examples is that they differ in the vocabulary they use.