Blog RSS Feed

Archive for the ‘Visualizations’ Category

New Tool: Bible Word Locator

Monday, September 3rd, 2007

Try it out.

Screenshots

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

See ‘father’ and ‘son.’
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.

See ‘Moses,’ ‘David,’ and ‘Jesus.’
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.

Visualization: Genesis Word Trees

Saturday, September 1st, 2007

From Many Eyes (Java required), a word tree of “God said” from Genesis:

Many Eyes is a data-visualization site. They just introduced a word-tree visualization, which takes a body of text and lets you find phrases surrounding a word. One of the creators of the site uploaded this data set for Genesis (KJV). Create your own visualizations (like the one above) from this data at the site.

An interesting addition would be to let you enter more than one node. For example, entering “God” and “Abraham” would show you all the different words and phrases that connect those two words.

Visualization: Character Relationships across Religions

Friday, August 31st, 2007

From SimilarDiversity.net:

A list of characters (‘Lord,’ ‘God’, and ‘You,’ are the most prominent) runs along the bottom, with arcs connecting them.

This visualization, by Philipp Steinweber and Andreas Koller, comes from the textual analysis of different religions’ holy books (red = Hinduism, yellow = Buddhism, green = Islam, blue = Judaism, purple = Christianity). Below each character is a list of verbs associated with him or her in each religion.

Their intent is (presumably) to show the commonalities among the different religions; I’m more interested in the technique behind the visualization itself. You could, for example, apply the technique to just the Bible and end up with a similar visualization. You could even do a similar color-coding, except with the Old and New Testaments.

Via Infosthetics, which has a few more examples of biblical visualizations in the comments. Tim Regan of Microsoft notes, “The whole area of abstract visualizations of books seems to be growing, and the bible seems to be a good testbed for these projects.”