Chapter 7. 6 text, strings, and heuristics: Putting It All Together

Image
Figure 7-1.  

You’ve already got a lot of superpowers. Now it’s time to use them. In this chapter we’re going to integrate what we’ve learned so far, bringing it all together to build some increasingy cool code. We’re also going to keep adding to your knowledge and coding skills. More specifically, in this chapter we’ll explore how to write code that grabs some text, slices it, dices it, and then does a little data analysis on it. We’re going to find out what a heuristic is too, and implement one. Get ready—this is an all-out, heads-down, pedal-to-the-metal, serious coding chapter!

Note

And by the end of the chapter you’ll realize how much you’ve learned about coding!

Image
Figure 7-2.  

Welcome to the data sciences

Heard of data science? It’s all about extracting insight and knowledge from data, and we’re about to get into the business. Our data? Any text: news articles, blog posts, books, anything written by an author. And what we’re going to do with all that text is tell the world how readable it is. That is, could a 5th grader read it, or does it take a Ph.D.? With our app, we’ll soon know.

Now to perform such an analysis, we’re going to have to dig deep; we’re going to examine, as you’ll soon discover:

every ...

Get Head First Learn to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.