google_spell_checker 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/README.md +20 -3
- data/lib/google_spell_checker/config.rb +4 -1
- data/lib/google_spell_checker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fb22fc9d237e6512c1f12e03d89bc5af244ca08
|
4
|
+
data.tar.gz: 0e56310d8ee8c1f6d90ba870c737719e43d939ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01788cac9769c25eee1628adc769c5f1a93dd870bd0c31b3436e9a6205c26a0c9685def75a2a55a5d87fa466b6afb89757b5bc88e2c5904cf21694c7eea99070
|
7
|
+
data.tar.gz: 718e93471c116cd68d452a7a469d3c9c3fad07a59e65c69dcc2191cd3e059bb4e3d5fb5db1c20205fcfa34256d0a00329b673bcac41946d7405c150c7e0a2edb
|
data/README.md
CHANGED
@@ -9,16 +9,33 @@ This gem is using google to check word's spelling.
|
|
9
9
|
###Installation
|
10
10
|
|
11
11
|
```
|
12
|
-
gem 'google_spell_checker','0.
|
12
|
+
gem 'google_spell_checker','0.1.0'
|
13
13
|
```
|
14
14
|
|
15
15
|
and run the `bundle` command.
|
16
16
|
|
17
|
-
|
17
|
+
####Examples
|
18
18
|
|
19
19
|
```
|
20
20
|
GoogleSpellChecker.check 'take m to your heatr'
|
21
|
-
=> "take <
|
21
|
+
=> "take <b><i>me</i></b> to your <b><i>heart</i></b>"
|
22
22
|
```
|
23
23
|
|
24
24
|
If there is no incorrect word, it will output void character.
|
25
|
+
|
26
|
+
### Using 'google.com.hk'
|
27
|
+
|
28
|
+
If you can access fluently "google.com.hk" rather than "google.com", you can run the following generator command:
|
29
|
+
|
30
|
+
```
|
31
|
+
% rails g google_spell_checker:config
|
32
|
+
```
|
33
|
+
|
34
|
+
Then uncommented the third line of the generated file 'config/initializers/google_spell_checker_config.rb'.
|
35
|
+
|
36
|
+
####Examples
|
37
|
+
|
38
|
+
```
|
39
|
+
GoogleSpellChecker.check 'take m to your heatr'
|
40
|
+
=> "take <em>me</em> to your <em>heart</em>"
|
41
|
+
```
|
@@ -13,7 +13,6 @@ module GoogleSpellChecker
|
|
13
13
|
class Configuration
|
14
14
|
include ActiveSupport::Configurable
|
15
15
|
config_accessor :using_hk
|
16
|
-
config.using_hk = false
|
17
16
|
end
|
18
17
|
|
19
18
|
def param_name
|
@@ -24,4 +23,8 @@ module GoogleSpellChecker
|
|
24
23
|
writer, line = 'def param_name=(value); config.param_name = value; end', __LINE__
|
25
24
|
singleton_class.class_eval writer, __FILE__, line
|
26
25
|
class_eval writer, __FILE__, line
|
26
|
+
|
27
|
+
configure do |config|
|
28
|
+
config.using_hk = false
|
29
|
+
end
|
27
30
|
end
|