Splitting on Spaces

Spaces give us an obvious first place to divide a sentence. We will try that rule, then look at what it does with punctuation, repeated whitespace, and writing that does not separate words with spaces.

12 sections · 10 questions · 4 coding challenges

1 / 12

Could the Spaces Do the First Part of the Work?

BOTIE

A search system needs to count and index the items in a document. For much English text, spaces seem to offer a convenient first answer: the stretches between them often resemble the words a reader would look for.

Word-based information retrieval made this apparently simple boundary decision a practical concern. Manning, Raghavan and Schütze's 2008 treatment documents why tokenisation requires decisions even before ranking documents: punctuation, apostrophes, and languages with different writing conventions do not all fit the same space-based rule. There is no single invention date for splitting a string on whitespace.

The attraction is that the rule is easy to explain and reproduce. The limitation is equally concrete. A comma may remain attached to a word, and a writing system without spaces between words supplies no such boundaries. We begin with this baseline so that each later rule can be understood as an answer to something this first attempt leaves unresolved.

Sources for this history