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 +5 -5
- data/lib/chat_correct/corrections_hash.rb +1 -1
- data/lib/chat_correct/version.rb +1 -1
- data/spec/chat_correct/correct_spec.rb +12 -0
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aa2d4b869524c85df7b0ce4162374ccd13ee9aca0dd07790f0c0a4295b9c092c
|
4
|
+
data.tar.gz: 81cd90af36bfe8718265759f624821541d9b9a151a6d802e7e1c50eb48bac7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
data/lib/chat_correct/version.rb
CHANGED
@@ -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.
|
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:
|
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
|
-
|
181
|
-
|
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.
|