{"id":28,"date":"2007-09-03T09:28:31","date_gmt":"2007-09-03T13:28:31","guid":{"rendered":"http:\/\/www.openbible.info\/blog\/2007\/09\/new-tool-bible-word-locator\/"},"modified":"2016-02-06T11:15:54","modified_gmt":"2016-02-06T15:15:54","slug":"new-tool-bible-word-locator","status":"publish","type":"post","link":"https:\/\/www.openbible.info\/blog\/2007\/09\/new-tool-bible-word-locator\/","title":{"rendered":"New Tool: Bible Word Locator"},"content":{"rendered":"<p><a href=\"https:\/\/www.openbible.info\/labs\/word-locator\/\">Try it out<\/a>.<\/p>\n<h3>Screenshots<\/h3>\n<p><a href=\"https:\/\/www.openbible.info\/labs\/word-locator\/?q=said\"><img loading=\"lazy\" src=\"https:\/\/www.openbible.info\/labs\/word-locator\/images\/said.png\" width=\"568\" height=\"370\" alt=\"See \u2018said.\u2019\" \/><\/a><br \/>\nAll the occurrences of the word <em>said<\/em> in the Bible. Note the narrative bands in Genesis, the Old Testament history books, and the gospels.<\/p>\n<p><a href=\"https:\/\/www.openbible.info\/labs\/word-locator\/?q=father+son\"><img loading=\"lazy\" src=\"https:\/\/www.openbible.info\/labs\/word-locator\/images\/father_son.png\" width=\"568\" height=\"370\" alt=\"See \u2018father\u2019 and \u2018son.\u2019\" \/><\/a><br \/>\nOccurrences of the words <em>father<\/em> and <em>son<\/em>. Clusters in Chronicles and a couple of places in the New Testament show where to find the genealogies.<\/p>\n<p><a href=\"https:\/\/www.openbible.info\/labs\/word-locator\/?q=Moses+David+Jesus\"><img loading=\"lazy\" src=\"https:\/\/www.openbible.info\/labs\/word-locator\/images\/moses_david_jesus.png\" width=\"568\" height=\"370\" alt=\"See \u2018Moses,\u2019 \u2018David,\u2019 and \u2018Jesus.\u2019\" \/><\/a><br \/>\nOccurrences of the words <em>Moses<\/em>, <em>David<\/em>, and <em>Jesus<\/em>. It\u2019s easy to tell where the main stories about each person are.<\/p>\n<h3>Background<\/h3>\n<p>Part of the <a href=\"https:\/\/www.openbible.info\/blog\/2007\/08\/visualization-character-relationships-across-religions\/\">Similar Diversity<\/a> work includes a visualization of the word <em>you<\/em> in various holy books. This visualization provided me the impetus to produce something more interactive for the Bible.<\/p>\n<h3>How It Works<\/h3>\n<p>First, I counted the number of words in the ESV Bible (767,847, including headings but excluding footnotes, if you\u2019re interested).<\/p>\n<p>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: <em>word<\/em> (varchar(18)) and <em>positions<\/em> (mediumtext). The <em>positions<\/em> column consists of a space-separated string of numbers.<\/p>\n<p>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&times;709 pixels at a one-pixel-per-word ratio.)<\/p>\n<h3>The Code<\/h3>\n<p>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.<\/p>\n<h3>Limitations<\/h3>\n<p>Since the chart is 1\/4 full-size, each pixel represents four words, and each dot occupies nine pixels. Given the coarse resolution, it\u2019s best to use the locator to identify trends and then switch to the Bible text for further analysis.<\/p>\n<p>It doesn\u2019t do exact matches, only beginning-of-word matches. Only want to search for <em>Eve<\/em>, omitting results for <em>evening<\/em>? You\u2019re out of luck.<\/p>\n<p>It would be interesting to be able to click a dot and see the context of each occurrence.<\/p>\n<h3>Introducing Labs<\/h3>\n<p>Launching this tool gives me an excuse to launch the new <a href=\"https:\/\/www.openbible.info\/labs\/\">Labs<\/a> section of this site, which houses small, one-off experiments like this one and the <a href=\"https:\/\/www.openbible.info\/blog\/2007\/08\/experimental-interface-for-browsing-chapters-in-the-bible\/\">Chapter Browser<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Try it out. 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/posts\/28"}],"collection":[{"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":2,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions\/1197"}],"wp:attachment":[{"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.openbible.info\/blog\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}