摘要: Chapter 4 Writing Structured Programs编写结构化程序 By now you will have a sense of the capabilities of the Python programming language for processing natural language. However, if you're new to Python or to programming, you may still be wrestling with(努力对付) Python and not feel like you are in full con 阅读全文
posted @ 2011-08-11 22:34 牛皮糖NewPtone 阅读(904) 评论(0) 推荐(0) 编辑
摘要: 3.12Exercises 练习 ☼ Define a string s = 'colorless'. Write a Python statement that changes this to "colourless" using only the slice and concatenation operations. ☼ We can use the slice notation to remove morphological endings on words. For example, 'dogs'[:-1] removes the l 阅读全文
posted @ 2011-08-11 22:25 牛皮糖NewPtone 阅读(2475) 评论(0) 推荐(0) 编辑
摘要: 3.11Further Reading深入阅读 Extra materials for this chapter are posted at http://www.nltk.org/ , including links to freely available resources on the Web. Remember to consult the Python reference materials at http://docs.python.org/ . (For example, this documentation covers “universal newline support,” 阅读全文
posted @ 2011-08-11 22:21 牛皮糖NewPtone 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 3.10Summary小结 • In this book we view a text as a list of words. A “raw text” is a potentially long string containing words and whitespace formatting, and is how we typically store and visualize a text. • A string is specified in Python using single or double quotes:'Monty Python', "Mont 阅读全文
posted @ 2011-08-11 22:20 牛皮糖NewPtone 阅读(719) 评论(0) 推荐(0) 编辑