Screenshots

All the occurrences of the word said in the Bible. Note the narrative bands in Genesis, the Old Testament history books, and the gospels.

Occurrences of the words father and son. Clusters in Chronicles and a couple of places in the New Testament show where to find the genealogies.

Occurrences of the words Moses, David, and Jesus. It’s easy to tell where the main stories about each person are.
Background
Part of the Similar Diversity work includes a visualization of the word you in various holy books. This visualization provided me the impetus to produce something more interactive for the Bible.
How It Works
First, I counted the number of words in the ESV Bible (767,847, including headings but excluding footnotes, if you’re interested).
Next I assigned each word in the Bible a unique, incremented number. Then it was just a matter of going through the positions and grouping them by word. The result is a database table with two columns: word (varchar(18)) and positions (mediumtext). The positions column consists of a space-separated string of numbers.
When you enter a search query, the program finds the positions of words matching your query and then plots those positions on a chart. (The chart is 1/4 the size it would be if each word position got one pixel; it would have to be 1,083×709 pixels at a one-pixel-per-word ratio.)
The Code
The code is in PHP, using the GD library. I decided this project would be a good time to try out the SQLite database that comes with PHP instead of going with MySQL. I have no complaints, though Perl creates incompatible tables with current PHP versions (5.2.4) unless you use PDO in PHP to access the tables. It worked fine after a bit of Googling revealed the workaround.
Limitations
Since the chart is 1/4 full-size, each pixel represents four words, and each dot occupies nine pixels. Given the coarse resolution, it’s best to use the locator to identify trends and then switch to the Bible text for further analysis.
It doesn’t do exact matches, only beginning-of-word matches. Only want to search for Eve, omitting results for evening? You’re out of luck.
It would be interesting to be able to click a dot and see the context of each occurrence.
Introducing Labs
Launching this tool gives me an excuse to launch the new Labs section of this site, which houses small, one-off experiments like this one and the Chapter Browser.

