A Tour of Python
摘要
All the programs in this book use Python. This chapter gives an introduction to this language with a specific focus on text processing. This will enable us to touch all the data structures and programming constructs we need to implement our algorithms. Large collections of texts form the raw material of natural language processing. This chapter describes the different kinds of corpora and how we can use them in applications. It introduces regular expressions, a ubiquitous tool to process text. We then move on to Python programming and its regular expression module to match patterns in text and apply some transformations. We finally review techniques to carry out approximate string matching.