goospell 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/goospell.rb +2 -1
- data/lib/goospell/version.rb +1 -1
- data/test/test_goospell.rb +6 -0
- metadata +2 -2
data/lib/goospell.rb
CHANGED
@@ -30,7 +30,8 @@ module Goospell
|
|
30
30
|
doc.elements.each('spellresult/c') do |correction|
|
31
31
|
#string = "asdfasf tehes"
|
32
32
|
#format is <c o="8" l="5">these the theory</c>
|
33
|
-
|
33
|
+
variants = correction.text ? correction.text.split("\t") : []
|
34
|
+
out.merge!({ full_text[correction.attributes['o'].to_i,correction.attributes['l'].to_i] => variants })
|
34
35
|
end
|
35
36
|
end
|
36
37
|
out
|
data/lib/goospell/version.rb
CHANGED
data/test/test_goospell.rb
CHANGED
@@ -11,4 +11,10 @@ class GoospellTest < Test::Unit::TestCase
|
|
11
11
|
corrections = Goospell::spell('teh')
|
12
12
|
assert corrections['teh'].include?('the')
|
13
13
|
end
|
14
|
+
|
15
|
+
def test_returns_empty_list_of_variants_if_none_found
|
16
|
+
example = 'm'*10
|
17
|
+
corrections = Goospell::spell(example)
|
18
|
+
assert corrections[example].empty?
|
19
|
+
end
|
14
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goospell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: to_xml
|