ingreedyfork 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.rspec +1 -0
- data/.rubocop.yml +601 -0
- data/.travis.yml +16 -0
- data/Gemfile +3 -0
- data/README.md +67 -0
- data/Rakefile +5 -0
- data/ingreedy.gemspec +27 -0
- data/lib/ingreedy/amount_parser.rb +69 -0
- data/lib/ingreedy/case_insensitive_parser.rb +12 -0
- data/lib/ingreedy/dictionaries/en.yml +147 -0
- data/lib/ingreedy/dictionaries/pl.yml +230 -0
- data/lib/ingreedy/dictionary.rb +35 -0
- data/lib/ingreedy/dictionary_collection.rb +37 -0
- data/lib/ingreedy/ingreedy_parser.rb +80 -0
- data/lib/ingreedy/rationalizer.rb +54 -0
- data/lib/ingreedy/root_parser.rb +122 -0
- data/lib/ingreedy/unit_variation_mapper.rb +39 -0
- data/lib/ingreedy/version.rb +3 -0
- data/lib/ingreedy.rb +24 -0
- data/spec/ingreedy/amount_parser_spec.rb +99 -0
- data/spec/ingreedy/rationalizer_spec.rb +56 -0
- data/spec/ingreedy/unit_variation_mapper_spec.rb +13 -0
- data/spec/ingreedy_spec.rb +508 -0
- data/spec/spec_helper.rb +34 -0
- metadata +185 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
if ENV["CI"]
|
2
|
+
require "coveralls"
|
3
|
+
Coveralls.wear!
|
4
|
+
end
|
5
|
+
|
6
|
+
require "ingreedy"
|
7
|
+
require "parslet/rig/rspec"
|
8
|
+
require "pry"
|
9
|
+
|
10
|
+
RSpec::Matchers.define :parse_the_unit do |unit|
|
11
|
+
match do |ingreedy_output|
|
12
|
+
ingreedy_output.unit == unit
|
13
|
+
end
|
14
|
+
failure_message do |ingreedy_output|
|
15
|
+
<<-MSG
|
16
|
+
expected to parse the unit #{unit} from the query
|
17
|
+
'#{ingreedy_output.original_query}.'
|
18
|
+
got '#{ingreedy_output.unit}' instead
|
19
|
+
MSG
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
RSpec::Matchers.define :parse_the_amount do |amount|
|
24
|
+
match do |ingreedy_output|
|
25
|
+
ingreedy_output.amount == amount
|
26
|
+
end
|
27
|
+
failure_message do |ingreedy_output|
|
28
|
+
<<-MSG
|
29
|
+
expected to parse the amount #{amount} from the query
|
30
|
+
'#{ingreedy_output.original_query}.'
|
31
|
+
got '#{ingreedy_output.amount}' instead
|
32
|
+
MSG
|
33
|
+
end
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ingreedyfork
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.10
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- 'Ian C. Anderson, support for Polish added by Mateusz Konieczny '
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-07-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: parslet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.8.0
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.8.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.8.0
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.8.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: unicode
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.4.4
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.4.4
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.4.4
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.4.4
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rake
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.9'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0.9'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.9'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0.9'
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: rspec
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 3.3.0
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.3.0
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.3.0
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 3.3.0
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: coveralls
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.7.0
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.7.0
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.7.0
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 0.7.0
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: pry
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - "~>"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
description: |2
|
128
|
+
Natural language recipe ingredient parser that supports numeric amount,
|
129
|
+
units, and ingredient
|
130
|
+
email:
|
131
|
+
- matkoniecz@gmail.com
|
132
|
+
executables: []
|
133
|
+
extensions: []
|
134
|
+
extra_rdoc_files: []
|
135
|
+
files:
|
136
|
+
- ".gitignore"
|
137
|
+
- ".rspec"
|
138
|
+
- ".rubocop.yml"
|
139
|
+
- ".travis.yml"
|
140
|
+
- Gemfile
|
141
|
+
- README.md
|
142
|
+
- Rakefile
|
143
|
+
- ingreedy.gemspec
|
144
|
+
- lib/ingreedy.rb
|
145
|
+
- lib/ingreedy/amount_parser.rb
|
146
|
+
- lib/ingreedy/case_insensitive_parser.rb
|
147
|
+
- lib/ingreedy/dictionaries/en.yml
|
148
|
+
- lib/ingreedy/dictionaries/pl.yml
|
149
|
+
- lib/ingreedy/dictionary.rb
|
150
|
+
- lib/ingreedy/dictionary_collection.rb
|
151
|
+
- lib/ingreedy/ingreedy_parser.rb
|
152
|
+
- lib/ingreedy/rationalizer.rb
|
153
|
+
- lib/ingreedy/root_parser.rb
|
154
|
+
- lib/ingreedy/unit_variation_mapper.rb
|
155
|
+
- lib/ingreedy/version.rb
|
156
|
+
- spec/ingreedy/amount_parser_spec.rb
|
157
|
+
- spec/ingreedy/rationalizer_spec.rb
|
158
|
+
- spec/ingreedy/unit_variation_mapper_spec.rb
|
159
|
+
- spec/ingreedy_spec.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
homepage: http://github.com/matkoniecz/ingreedy-fork
|
162
|
+
licenses:
|
163
|
+
- MIT
|
164
|
+
metadata: {}
|
165
|
+
post_install_message:
|
166
|
+
rdoc_options: []
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
179
|
+
requirements: []
|
180
|
+
rubyforge_project:
|
181
|
+
rubygems_version: 2.5.1
|
182
|
+
signing_key:
|
183
|
+
specification_version: 4
|
184
|
+
summary: Recipe parser (fork of ingreedy)
|
185
|
+
test_files: []
|