Skip to Content
Dive Into Algorithms
book

Dive Into Algorithms

by Bradford Tuckfield
January 2021
Beginner to intermediate
248 pages
7h 2m
English
No Starch Press
Content preview from Dive Into Algorithms

8 Language

In this chapter, we step into the messy world of human language. We’ll start by discussing the differences between language and math that make language algorithms difficult. We’ll continue by building a space insertion algorithm that can take any text in any language and insert spaces wherever they’re missing. After that, we’ll build a phrase completion algorithm that can imitate the style of a writer and find the most fitting next word in a phrase.

The algorithms in this chapter rely heavily on two tools that we haven’t used before: list comprehensions and corpuses. List comprehensions enable us to quickly generate lists using ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Algorithms

Learning Algorithms

George Heineman
Grokking Algorithms

Grokking Algorithms

Aditya Bhargava
Graph Algorithms

Graph Algorithms

Mark Needham, Amy E. Hodler
Algorithms in a Nutshell, 2nd Edition

Algorithms in a Nutshell, 2nd Edition

George T. Heineman, Gary Pollice, Stanley Selkow

Publisher Resources

ISBN: 9781098128210Errata Page