picky-generators 4.3.2 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
1
3
|
require 'sinatra/base'
|
2
4
|
require 'i18n'
|
3
5
|
require 'haml'
|
@@ -46,7 +48,7 @@ class BookSearch < Sinatra::Application
|
|
46
48
|
source { Books.new }
|
47
49
|
indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
|
48
50
|
stopwords: /\b(and|the|of|it|in|for)\b/i,
|
49
|
-
splits_text_on: /[\s\/\-\_\:\"
|
51
|
+
splits_text_on: /[\s\/\-\_\:\"\&\.]/
|
50
52
|
category :title,
|
51
53
|
similarity: Similarity::DoubleMetaphone.new(3),
|
52
54
|
partial: Partial::Substring.new(from: 1) # Default is from: -3.
|
@@ -64,7 +66,7 @@ class BookSearch < Sinatra::Application
|
|
64
66
|
#
|
65
67
|
books = Search.new books_index do
|
66
68
|
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
|
67
|
-
removes_characters: /[
|
69
|
+
removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
|
68
70
|
stopwords: /\b(and|the|of|it|in|for)\b/i,
|
69
71
|
splits_text_on: /[\s\/\-\&]+/
|
70
72
|
|
@@ -129,4 +131,4 @@ class BookSearch < Sinatra::Application
|
|
129
131
|
|
130
132
|
end
|
131
133
|
|
132
|
-
end
|
134
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
1
3
|
require 'sinatra/base'
|
2
4
|
require 'csv'
|
3
5
|
require 'picky'
|
@@ -33,7 +35,7 @@ class BookSearch < Sinatra::Application
|
|
33
35
|
source { Books.new }
|
34
36
|
indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
|
35
37
|
stopwords: /\b(and|the|of|it|in|for)\b/i,
|
36
|
-
splits_text_on: /[\s\/\-\_\:\"
|
38
|
+
splits_text_on: /[\s\/\-\_\:\"\&\.]/
|
37
39
|
category :title,
|
38
40
|
similarity: Similarity::DoubleMetaphone.new(3),
|
39
41
|
partial: Partial::Substring.new(from: 1) # Default is from: -3.
|
@@ -51,7 +53,7 @@ class BookSearch < Sinatra::Application
|
|
51
53
|
#
|
52
54
|
books = Search.new books_index do
|
53
55
|
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
|
54
|
-
removes_characters: /[
|
56
|
+
removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
|
55
57
|
stopwords: /\b(and|the|of|it|in|for)\b/i,
|
56
58
|
splits_text_on: /[\s\/\-\&]+/
|
57
59
|
boost [:title, :author] => +3,
|
@@ -66,4 +68,4 @@ class BookSearch < Sinatra::Application
|
|
66
68
|
results.to_json
|
67
69
|
end
|
68
70
|
|
69
|
-
end
|
71
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picky-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70184211701520 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,29 +21,29 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70184211701520
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: picky
|
27
|
-
requirement: &
|
27
|
+
requirement: &70184211698580 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 4.
|
32
|
+
version: 4.4.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70184211698580
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: picky-client
|
38
|
-
requirement: &
|
38
|
+
requirement: &70184208515560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 4.
|
43
|
+
version: 4.4.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70184208515560
|
47
47
|
description: Generators for Picky.
|
48
48
|
email: florian.hanke+picky-generators@gmail.com
|
49
49
|
executables:
|