Permalink
Browse files

Parameterized rebuild_metaphones

  • Loading branch information...
1 parent 02a1195 commit a10054aec67758957872debcdc4cb2827130c219 Dan 'Ducky' Little committed Dec 23, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 bin/rebuild_metaphones
View
@@ -4,7 +4,16 @@ require 'rubygems'
require 'sqlite3'
require 'text'
- @db = SQLite3::Database.new("../geocoderdata/geocoder.db")
+if(ARGV.length < 1)
+print "Missing SQLite file parameter"
+printf "\nUSAGE:\n"
+print """./rebuild_metaphones [SQLite File]
+ [SQLite File] - SQLite file generated by the geocoder.
+"""
+exit
+end
+
+ @db = SQLite3::Database.new(ARGV[0])
@db.create_function("metaphone", 2) do |func, string, len|
test = string.to_s.gsub(/\W/o, "")
if test =~ /^(\d+)/o

0 comments on commit a10054a

Please sign in to comment.