3.1 Accessing Text from the Web and from Disk
Electronic Books A small sample of texts from Project Gutenberg appears in the NLTK corpus collection. However, you may be interested in analyzing other texts from Project Gutenberg. You can…
Electronic Books A small sample of texts from Project Gutenberg appears in the NLTK corpus collection. However, you may be interested in analyzing other texts from Project Gutenberg. You can…
Senses and SynonymsConsider the sentence in (1a). If we replace the word motorcar in (1a) with automobile, to get (1b), the meaning of the sentence stays pretty much the same:(1)…
A lexicon, or lexical resource, is a collection of words and/or phrases along with associated information, such as part-of-speech and sense definitions. Lexical resources aresecondary to texts, and are usually…
Creating Programs with a Text EditorThe Python interactive interpreter performs your instructions as soon as you type them.Often, it is better to compose a multiline program using a text editor,…
We introduced frequency distributions in Section 1.3. We saw that given some listmylist of words or other items, FreqDist(mylist) would compute the number ofoccurrences of each item in the list.…
Gutenberg CorpusNLTK includes a small selection of texts from the Project Gutenberg electronic textarchive, which contains some 25,000 free electronic books, hosted at http://www.gutenberg.org/. We begin by getting the Python…
We have been exploring language bottom-up, with the help of texts and the Pythonprogramming language. However, we’re also interested in exploiting our knowledge oflanguage and computation by building useful language…
ListsWhat is a text? At one level, it is a sequence of symbols on a page such as this one. Atanother level, it is a sequence of chapters, made up…
We’re all very familiar with text, since we read and write it every day. Here we will treattext as raw data for the programs we write, programs that manipulate and…