fuzzy_matcher 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +30 -2
- data/lib/fuzzy_matcher/version.rb +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# FuzzyMatcher
|
2
2
|
|
3
|
-
|
3
|
+
Gem for fuzzy searching with FQA algorithm.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -16,9 +16,37 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install fuzzy_matcher
|
18
18
|
|
19
|
+
## Avalable databases
|
20
|
+
|
21
|
+
Currently supported Postgresql('pg') and Mysql('mysql')
|
22
|
+
|
23
|
+
## Requirements
|
24
|
+
|
25
|
+
Tested in ruby 1.9.2.
|
26
|
+
Gems needed - pg, mysql2.
|
27
|
+
In DB you should have metric calculation function (f.e. 'levenshtein' in pg and 'damlev' in mysql).
|
28
|
+
In Mysql you should compile damlev.so
|
29
|
+
In Postgre you have function fuzzystrmatch
|
30
|
+
|
19
31
|
## Usage
|
20
32
|
|
21
|
-
|
33
|
+
First add require if you use it in separate script:
|
34
|
+
require 'fuzzy_matcher'
|
35
|
+
|
36
|
+
Next you should create connection:
|
37
|
+
conn = FuzzyMatcher::Adapter.new(db_type, db_name, username, password)
|
38
|
+
F.e.
|
39
|
+
conn = FuzzyMatcher::Adapter.new('pg','dip_lib','postgres','password')
|
40
|
+
|
41
|
+
Next step is taking node values:
|
42
|
+
values = FuzzyMatcher::Indexer.index!(connection, distance_methic_name, height)
|
43
|
+
F.e.
|
44
|
+
values = FuzzyMatcher::Indexer.index!(conn, 'levenshtein', 2)
|
45
|
+
|
46
|
+
Last is searching:
|
47
|
+
FuzzyMatcher::Searcher.find(values, connection, distance_methic_name, height, accuracy, aim)
|
48
|
+
F.e. if you looking for words like 'barrels' and accuracy of searching is 3, you should write like that:
|
49
|
+
FuzzyMatcher::Searcher.find(values, conn, 'levenshtein', 2, 3, 'barrels')
|
22
50
|
|
23
51
|
## Contributing
|
24
52
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuzzy_matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-03 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pg
|
16
|
-
requirement: &
|
16
|
+
requirement: &2157390740 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2157390740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mysql2
|
27
|
-
requirement: &
|
27
|
+
requirement: &2157423080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2157423080
|
36
36
|
description: fuzzy matcher
|
37
37
|
email:
|
38
38
|
- graffzon@gmail.com
|