O'Reilly logo

Head First Learn to Code by Eric Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

Image

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

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 sentence

and every word ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required