spell 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c75c56dd802edc8ce8503b0f2dea60fa7772c6a
4
- data.tar.gz: a990eb804ea93c0a70286a6591e4216de557f6cb
3
+ metadata.gz: 46f63bb9a50612e34fbd55051fd07eba47d4531d
4
+ data.tar.gz: 0e5cad0b0f7fd20241392b0e73a53a7fe685183b
5
5
  SHA512:
6
- metadata.gz: 3066bc4978257194be0af3b667dbd8a53ab12f18d4ce8a8909723798b72e7291a4f2d8962fdcbac054605618899ed2cef5fce22d212fb2580fbfbcbb1a98adac
7
- data.tar.gz: 2a12cdb8674385cbf0af9717b96f4dffad4d22cad22abb504a58f00eff42353e8b3c9c971988b5bcf8bdcb9375acd593aef74b2bfc95924e3ddbd5aa4d3be337
6
+ metadata.gz: 7cb4aa54f1b23b07fe0a1ce7abb818a4bdcf2526971057550022167437d6279e8a55e9386415265e28856a29e97baceccfb6175f60772c9460bd791e7347d9aa
7
+ data.tar.gz: cef70a9265217215964107ec5737b688b17c390f642d35ca27c9163577729ca60c25dde3dcde5e452d80c14887d2525fbd81c6e43cbc517e4c0051b6d74a8759
data/Rakefile CHANGED
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ RuboCop::RakeTask.new(:rubocop)
7
+
8
+ task :default => [:spec, :rubocop]
@@ -21,7 +21,8 @@ module Spell
21
21
  word_bigrams = bigramate(given_word)
22
22
  word_hash = words.map do |key|
23
23
  [key, bigram_compare(word_bigrams, bigramate(key))]
24
- end.to_h
24
+ end
25
+ word_hash = Hash[*word_hash.flatten]
25
26
 
26
27
  # Weight by word usage, if logical
27
28
  word_hash = apply_usage_weights(word_hash) if @word_list.is_a? Hash
@@ -94,7 +95,7 @@ module Spell
94
95
  [word, (bigram_score * (1 - @alpha)) + (usage_score * @alpha)]
95
96
  end
96
97
 
97
- weighted_array.to_h
98
+ Hash[*weighted_array.flatten]
98
99
  end
99
100
  end
100
101
  end
@@ -1,3 +1,3 @@
1
1
  module Spell
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -19,7 +19,9 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = '>= 2.0'
22
23
  spec.add_development_dependency "bundler", "~> 1.10"
23
24
  spec.add_development_dependency "rake", "~> 10.0"
24
25
  spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "rubocop"
25
27
  end
metadata CHANGED
@@ -1,55 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Arnett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-07 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  description: 'Spell checker written in pure Ruby, implementing a simple bigram comparison
@@ -60,9 +74,9 @@ executables: []
60
74
  extensions: []
61
75
  extra_rdoc_files: []
62
76
  files:
63
- - ".gitignore"
64
- - ".rspec"
65
- - ".travis.yml"
77
+ - .gitignore
78
+ - .rspec
79
+ - .travis.yml
66
80
  - CODE_OF_CONDUCT.md
67
81
  - Gemfile
68
82
  - LICENSE.txt
@@ -84,18 +98,19 @@ require_paths:
84
98
  - lib
85
99
  required_ruby_version: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - ">="
101
+ - - '>='
88
102
  - !ruby/object:Gem::Version
89
- version: '0'
103
+ version: '2.0'
90
104
  required_rubygems_version: !ruby/object:Gem::Requirement
91
105
  requirements:
92
- - - ">="
106
+ - - '>='
93
107
  - !ruby/object:Gem::Version
94
108
  version: '0'
95
109
  requirements: []
96
110
  rubyforge_project:
97
- rubygems_version: 2.4.3
111
+ rubygems_version: 2.0.14
98
112
  signing_key:
99
113
  specification_version: 4
100
114
  summary: A customizable spell checker, written in pure Ruby
101
115
  test_files: []
116
+ has_rdoc: