chat_correct 0.0.7 → 0.0.8

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
- SHA1:
3
- metadata.gz: 17ffe2b9285c07c7ab139279cfcea0d86426d5bc
4
- data.tar.gz: 8fd494fe32c463601b6d80bf897be9be40c7e1f7
2
+ SHA256:
3
+ metadata.gz: aa2d4b869524c85df7b0ce4162374ccd13ee9aca0dd07790f0c0a4295b9c092c
4
+ data.tar.gz: 81cd90af36bfe8718265759f624821541d9b9a151a6d802e7e1c50eb48bac7e7
5
5
  SHA512:
6
- metadata.gz: dd60a9028fb978b9151a840f0d7fb209d50a303efb0baee02038a30cf202abc467ae725cd735cf7a952b9074b624f41dc52af29d3a99fcf7b6ee604674d5cb25
7
- data.tar.gz: 8470a33e6a8dfa6475d0232bac9fa693673628853c0e9e410fc0af57ecdc8f8408432228ce0f204184e0a55ed11490b7f1fb5974e0f421f398ea471c01777933
6
+ metadata.gz: 61cfc522adf14045f991e9e5148e705228e26345471af66473e9c21b8507e114c2670847b4d58ff7f0f01ba3fc6c465f20ba6b0325ae330d437083e9d16a0c8b
7
+ data.tar.gz: b34d98caba93fa929c3001aada68acfba4b01431de89b6cd2cba4d8eedbef8c3f8f21c2876c34c13d2646dd686b0baf81d13c75695e124dfe42537d12c1ff70a
@@ -166,7 +166,7 @@ module ChatCorrect
166
166
  if corrected_sentence_info_hash[@i]['token'].gsub(/[[:punct:]]/, '').eql?('')
167
167
  update_combined_hash_single_mistake_corrected('punctuation_mistake')
168
168
  else
169
- if @j != 0
169
+ if @j != 0 && @i != 0
170
170
  concatenated_corrected_string = corrected_sentence_info_hash[@i - 1]['token'].to_s + corrected_sentence_info_hash[@i]['token'].to_s
171
171
  if ChatCorrect::Possessive.new(token_a: original_sentence_info_hash[@j - 1]['token'], token_b: concatenated_corrected_string).possessive?
172
172
  @mistake_info[original_sentence_info_hash[@j - 1]['token']] = 'possessive_mistake'
@@ -1,3 +1,3 @@
1
1
  module ChatCorrect
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -1888,4 +1888,16 @@ RSpec.describe ChatCorrect::Correct do
1888
1888
  expect { @cc.correct }.to raise_error('You must include a Corrected Sentence')
1889
1889
  end
1890
1890
  end
1891
+
1892
+ context "example correction #085" do
1893
+ before do
1894
+ original_sentence = 'heyz uz guz'
1895
+ corrected_sentence = 'Hey you guys!'
1896
+ @cc = ChatCorrect::Correct.new(original_sentence: original_sentence, corrected_sentence: corrected_sentence)
1897
+ end
1898
+
1899
+ it 'Annotates the corrections' do
1900
+ expect(@cc.correct).to eq({0=>{"token"=>"heyz", "type"=>"unnecessary_word_mistake"}, 1=>{"token"=>"uz", "type"=>"unnecessary_word_mistake"}, 2=>{"token"=>"Hey", "type"=>"missing_word_mistake"}, 3=>{"token"=>"you", "type"=>"missing_word_mistake"}, 4=>{"token"=>"guz", "type"=>"spelling_mistake"}, 5=>{"token"=>"guys", "type"=>"spelling_correction"}, 6=>{"token"=>"!", "type"=>"missing_punctuation_correction"}})
1901
+ end
1902
+ end
1891
1903
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chat_correct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin S. Dias
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-10 00:00:00.000000000 Z
11
+ date: 2021-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,7 +162,7 @@ homepage: ''
162
162
  licenses:
163
163
  - MIT
164
164
  metadata: {}
165
- post_install_message:
165
+ post_install_message:
166
166
  rdoc_options: []
167
167
  require_paths:
168
168
  - lib
@@ -177,9 +177,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubyforge_project:
181
- rubygems_version: 2.4.1
182
- signing_key:
180
+ rubygems_version: 3.1.6
181
+ signing_key:
183
182
  specification_version: 4
184
183
  summary: Returns the errors and error types when an incorrect English sentence is
185
184
  diffed with a correct English sentence.