noodall-core 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/noodall/search.rb +4 -4
- data/noodall-core.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
data/lib/noodall/search.rb
CHANGED
@@ -24,7 +24,7 @@ module Noodall
|
|
24
24
|
def language(lang = 'en')
|
25
25
|
@language ||= lang
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def stemmer
|
29
29
|
@stemmer ||= Lingua::Stemmer.new(:language => language)
|
30
30
|
end
|
@@ -43,7 +43,7 @@ module Noodall
|
|
43
43
|
# Extract words from the query and clean up
|
44
44
|
words = query.downcase.split(/\W/) - STOPWORDS
|
45
45
|
words.reject!{|w| w.length < 3}
|
46
|
-
|
46
|
+
|
47
47
|
# add stemmed words to the array of words
|
48
48
|
words = stem(words) | words
|
49
49
|
|
@@ -71,7 +71,7 @@ module Noodall
|
|
71
71
|
docs.map! { |hash| load(hash['value']) }
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def stem(words)
|
76
76
|
words.map { |word| stemmer.stem(word) }
|
77
77
|
end
|
@@ -84,7 +84,7 @@ module Noodall
|
|
84
84
|
"function(){" +
|
85
85
|
"this.relevance = this._keywords.filter(" +
|
86
86
|
"function(z){" +
|
87
|
-
"return String(z).match(/(#{q})/);" +
|
87
|
+
"return String(z).match(/(#{q})/i);" +
|
88
88
|
"}).length;" +
|
89
89
|
"emit(this._id, this);" +
|
90
90
|
"}"
|
data/noodall-core.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{noodall-core}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Steve England"]
|
12
|
-
s.date = %q{2011-01-
|
12
|
+
s.date = %q{2011-01-28}
|
13
13
|
s.description = %q{Core data objects for Noodall}
|
14
14
|
s.email = %q{steve@wearebeef.co.uk}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noodall-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 7
|
10
|
+
version: 0.4.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-28 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|