Permalink
Browse files
Parameterized rebuild_metaphones
- Loading branch information...
Showing
with
10 additions
and
1 deletion.
-
+10
−1
bin/rebuild_metaphones
|
|
@@ -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