raspell 1.2 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +2 -5
- data/CHANGELOG +1 -0
- data/Rakefile +2 -6
- data/ext/raspell.c +23 -23
- data/raspell.gemspec +11 -12
- metadata +47 -46
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
����ʄ֏ X�XV���U��R�
|
4
|
-
"QR����]h�||���I4G�
|
5
|
-
���J^��Ԏ��1��\m �©�p6���4�i�R<x�3K�(��Y�l��.��\#o�~��������C{�a[Щ��0�_��Na"
|
1
|
+
�sx̌��H�j\��x�sE�*�F]���R8���M:��`p�=De;xa&�/���~���v�%,L�r�l�Q��w�5Hp��w�?.��]7H4��}�|(��b=���Cp|Il�H�bf�r�r��rۀ���c��m}����,"�:r|� w�H`�A�
|
2
|
+
���M�wP(圣������xaV���H>�V�4��<��`�-k�����N��1�� Nms���w�T�+G��|Z��
|
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
|
2
2
|
require 'rubygems'
|
3
|
-
gem 'echoe', '>=2.3'
|
4
3
|
require 'echoe'
|
5
4
|
|
6
|
-
Echoe.new("raspell") do |p|
|
7
|
-
p.
|
5
|
+
Echoe.new("raspell") do |p|
|
6
|
+
p.project = "fauna"
|
8
7
|
p.summary = "An interface binding for the Aspell spelling checker."
|
9
|
-
p.url = "http://blog.evanweaver.com/files/doc/fauna/raspell/"
|
10
|
-
p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
|
11
|
-
p.has_rdoc = false # avoids warnings on gem install
|
12
8
|
p.rdoc_pattern = /CHANGELOG|EXAMPLE|LICENSE|README|lib/
|
13
9
|
p.rdoc_options = [] # don't want to include the stubbed out source
|
14
10
|
p.require_signed = true
|
data/ext/raspell.c
CHANGED
@@ -106,7 +106,7 @@ static void set_options(AspellConfig *config, VALUE hash) {
|
|
106
106
|
VALUE value = rb_funcall(hash, rb_intern("fetch"), 1, option);
|
107
107
|
if (TYPE(option)!=T_STRING) rb_raise(cAspellError, "Given key must be a string.");
|
108
108
|
if (TYPE(value )!=T_STRING) rb_raise(cAspellError, "Given value must be a string.");
|
109
|
-
set_option(config,
|
109
|
+
set_option(config, StringValuePtr(option), StringValuePtr(value));
|
110
110
|
c++;
|
111
111
|
}
|
112
112
|
}
|
@@ -161,7 +161,7 @@ static VALUE get_list(const AspellWordList *list) {
|
|
161
161
|
* @return regular expression, matching exactly the word as whole.
|
162
162
|
*/
|
163
163
|
static VALUE get_wordregexp(VALUE word) {
|
164
|
-
char *cword =
|
164
|
+
char *cword = StringValuePtr(word);
|
165
165
|
char *result = malloc((strlen(cword)+5)*sizeof(char));
|
166
166
|
*result='\0';
|
167
167
|
strcat(result, "\\b");
|
@@ -200,13 +200,13 @@ static VALUE aspell_s_new(int argc, VALUE *argv, VALUE klass) {
|
|
200
200
|
rb_scan_args(argc, argv, "04", &vlang, &vjargon, &vsize, &vencoding);
|
201
201
|
|
202
202
|
//language:
|
203
|
-
if (RTEST(vlang)) set_option(config, "lang",
|
203
|
+
if (RTEST(vlang)) set_option(config, "lang", StringValuePtr(vlang));
|
204
204
|
//jargon:
|
205
|
-
if (RTEST(vjargon)) set_option(config, "jargon",
|
205
|
+
if (RTEST(vjargon)) set_option(config, "jargon", StringValuePtr(vjargon));
|
206
206
|
//size:
|
207
|
-
if (RTEST(vsize)) set_option(config, "size",
|
207
|
+
if (RTEST(vsize)) set_option(config, "size", StringValuePtr(vsize));
|
208
208
|
//encoding:
|
209
|
-
if (RTEST(vencoding)) set_option(config, "encoding",
|
209
|
+
if (RTEST(vencoding)) set_option(config, "encoding", StringValuePtr(vencoding));
|
210
210
|
|
211
211
|
//create speller:
|
212
212
|
ret = new_aspell_speller(config);
|
@@ -293,7 +293,7 @@ static VALUE aspell_s_list_dicts(VALUE klass) {
|
|
293
293
|
*/
|
294
294
|
static VALUE aspell_set_option(VALUE self, VALUE option, VALUE value) {
|
295
295
|
AspellSpeller *speller = get_speller(self);
|
296
|
-
set_option(aspell_speller_config(speller),
|
296
|
+
set_option(aspell_speller_config(speller), StringValuePtr(option), StringValuePtr(value));
|
297
297
|
return self;
|
298
298
|
}
|
299
299
|
|
@@ -304,7 +304,7 @@ static VALUE aspell_set_option(VALUE self, VALUE option, VALUE value) {
|
|
304
304
|
*/
|
305
305
|
static VALUE aspell_remove_option(VALUE self, VALUE option) {
|
306
306
|
AspellSpeller *speller = get_speller(self);
|
307
|
-
aspell_config_remove(aspell_speller_config(speller),
|
307
|
+
aspell_config_remove(aspell_speller_config(speller), StringValuePtr(option));
|
308
308
|
return self;
|
309
309
|
}
|
310
310
|
|
@@ -314,7 +314,7 @@ static VALUE aspell_remove_option(VALUE self, VALUE option) {
|
|
314
314
|
*/
|
315
315
|
static VALUE aspell_set_suggestion_mode(VALUE self, VALUE value) {
|
316
316
|
AspellSpeller *speller = get_speller(self);
|
317
|
-
set_option(aspell_speller_config(speller), "sug-mode",
|
317
|
+
set_option(aspell_speller_config(speller), "sug-mode", StringValuePtr(value));
|
318
318
|
return self;
|
319
319
|
}
|
320
320
|
|
@@ -372,7 +372,7 @@ static VALUE aspell_clear_session(VALUE self) {
|
|
372
372
|
*/
|
373
373
|
static VALUE aspell_suggest(VALUE self, VALUE word) {
|
374
374
|
AspellSpeller *speller = get_speller(self);
|
375
|
-
return get_list(aspell_speller_suggest(speller,
|
375
|
+
return get_list(aspell_speller_suggest(speller, StringValuePtr(word), -1));
|
376
376
|
}
|
377
377
|
|
378
378
|
/**
|
@@ -382,7 +382,7 @@ static VALUE aspell_suggest(VALUE self, VALUE word) {
|
|
382
382
|
*/
|
383
383
|
static VALUE aspell_add_to_personal(VALUE self, VALUE word) {
|
384
384
|
AspellSpeller *speller = get_speller(self);
|
385
|
-
aspell_speller_add_to_personal(speller,
|
385
|
+
aspell_speller_add_to_personal(speller, StringValuePtr(word), -1);
|
386
386
|
check_for_error(speller);
|
387
387
|
return self;
|
388
388
|
}
|
@@ -393,7 +393,7 @@ static VALUE aspell_add_to_personal(VALUE self, VALUE word) {
|
|
393
393
|
*/
|
394
394
|
static VALUE aspell_add_to_session(VALUE self, VALUE word) {
|
395
395
|
AspellSpeller *speller = get_speller(self);
|
396
|
-
aspell_speller_add_to_session(speller,
|
396
|
+
aspell_speller_add_to_session(speller, StringValuePtr(word), -1);
|
397
397
|
check_for_error(speller);
|
398
398
|
return self;
|
399
399
|
}
|
@@ -407,7 +407,7 @@ static VALUE aspell_add_to_session(VALUE self, VALUE word) {
|
|
407
407
|
static VALUE aspell_conf_retrieve(VALUE self, VALUE key) {
|
408
408
|
AspellSpeller *speller = get_speller(self);
|
409
409
|
AspellConfig *config = aspell_speller_config(speller);
|
410
|
-
VALUE result = rb_str_new2(aspell_config_retrieve(config,
|
410
|
+
VALUE result = rb_str_new2(aspell_config_retrieve(config, StringValuePtr(key)));
|
411
411
|
if (aspell_config_error(config) != 0) {
|
412
412
|
rb_raise(cAspellError, aspell_config_error_message(config));
|
413
413
|
}
|
@@ -428,7 +428,7 @@ static VALUE aspell_conf_retrieve_list(VALUE self, VALUE key) {
|
|
428
428
|
const char *option_value;
|
429
429
|
|
430
430
|
//retrieve list
|
431
|
-
aspell_config_retrieve_list(config,
|
431
|
+
aspell_config_retrieve_list(config, StringValuePtr(key), container);
|
432
432
|
//check for error
|
433
433
|
if (aspell_config_error(config) != 0) {
|
434
434
|
char *tmp = strdup(aspell_config_error_message(config));
|
@@ -474,7 +474,7 @@ static VALUE aspell_dump_config(VALUE self) {
|
|
474
474
|
static VALUE aspell_check(VALUE self, VALUE word) {
|
475
475
|
AspellSpeller *speller = get_speller(self);
|
476
476
|
VALUE result = Qfalse;
|
477
|
-
int code = aspell_speller_check(speller,
|
477
|
+
int code = aspell_speller_check(speller, StringValuePtr(word), -1);
|
478
478
|
if (code == 1)
|
479
479
|
result = Qtrue;
|
480
480
|
else if (code == 0)
|
@@ -524,7 +524,7 @@ static VALUE aspell_correct_lines(VALUE self, VALUE ary) {
|
|
524
524
|
//save line
|
525
525
|
sline = rb_funcall(vline, rb_intern("dup"), 0);
|
526
526
|
//c representation
|
527
|
-
line =
|
527
|
+
line = StringValuePtr(vline);
|
528
528
|
//process line
|
529
529
|
aspell_document_checker_process(checker, line, -1);
|
530
530
|
//iterate over all misspelled words
|
@@ -540,14 +540,14 @@ static VALUE aspell_correct_lines(VALUE self, VALUE ary) {
|
|
540
540
|
//chomp the string
|
541
541
|
rb_funcall(rword, rb_intern("chomp!"), 0);
|
542
542
|
//empty string -> do nothing
|
543
|
-
if(strlen(
|
543
|
+
if(strlen(StringValuePtr(rword)) == 0) continue;
|
544
544
|
//remember word for later suggestion
|
545
|
-
aspell_speller_store_replacement(speller,
|
545
|
+
aspell_speller_store_replacement(speller, StringValuePtr(word), -1, StringValuePtr(rword), -1);
|
546
546
|
//substitute the word by replacement
|
547
547
|
rb_funcall(sline, rb_intern("[]="), 3, INT2FIX(token.offset+offset), INT2FIX(token.len), rword);
|
548
548
|
//adjust offset
|
549
|
-
offset += strlen(
|
550
|
-
//printf("replace >%s< with >%s< (offset now %d)\n",
|
549
|
+
offset += strlen(StringValuePtr(rword))-strlen(StringValuePtr(word));
|
550
|
+
//printf("replace >%s< with >%s< (offset now %d)\n", StringValuePtr(word), StringValuePtr(rword), offset);
|
551
551
|
}
|
552
552
|
//push the substituted line to result
|
553
553
|
rb_ary_push(result, sline);
|
@@ -570,7 +570,7 @@ static VALUE aspell_correct_lines(VALUE self, VALUE ary) {
|
|
570
570
|
*/
|
571
571
|
static VALUE aspell_store_replacement(VALUE self, VALUE badword, VALUE rightword) {
|
572
572
|
AspellSpeller *speller = get_speller(self);
|
573
|
-
aspell_speller_store_replacement(speller,
|
573
|
+
aspell_speller_store_replacement(speller, StringValuePtr(badword), -1, StringValuePtr(rightword), -1);
|
574
574
|
return self;
|
575
575
|
}
|
576
576
|
|
@@ -585,7 +585,7 @@ static VALUE aspell_correct_file(VALUE self, VALUE filename) {
|
|
585
585
|
if (rb_block_given_p()) {
|
586
586
|
VALUE content = rb_funcall(rb_cFile, rb_intern("readlines"), 1, filename);
|
587
587
|
VALUE newcontent = aspell_correct_lines(self, content);
|
588
|
-
VALUE file = rb_file_open(
|
588
|
+
VALUE file = rb_file_open(StringValuePtr(filename), "w+");
|
589
589
|
rb_funcall(file, rb_intern("write"), 1, newcontent);
|
590
590
|
rb_funcall(file, rb_intern("close"), 0);
|
591
591
|
} else {
|
@@ -613,7 +613,7 @@ static VALUE aspell_list_misspelled(VALUE self, VALUE ary) {
|
|
613
613
|
while(c<count) {
|
614
614
|
//process line
|
615
615
|
vline = RARRAY_PTR(ary)[c];
|
616
|
-
aspell_document_checker_process(checker,
|
616
|
+
aspell_document_checker_process(checker, StringValuePtr(vline), -1);
|
617
617
|
//iterate over all misspelled words
|
618
618
|
while (token = aspell_document_checker_next_misspelling(checker), token.len != 0) {
|
619
619
|
//extract word by start/length qualifier
|
data/raspell.gemspec
CHANGED
@@ -2,27 +2,26 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{raspell}
|
5
|
-
s.version = "1.2"
|
5
|
+
s.version = "1.2.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.cert_chain = [
|
10
|
-
s.date = %q{2011-
|
8
|
+
s.authors = [%q{}]
|
9
|
+
s.cert_chain = [%q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem}]
|
10
|
+
s.date = %q{2011-08-26}
|
11
11
|
s.description = %q{An interface binding for the Aspell spelling checker.}
|
12
12
|
s.email = %q{}
|
13
|
-
s.extensions = [
|
14
|
-
s.extra_rdoc_files = [
|
15
|
-
s.files = [
|
16
|
-
s.homepage = %q{http://
|
17
|
-
s.require_paths = [
|
13
|
+
s.extensions = [%q{ext/extconf.rb}]
|
14
|
+
s.extra_rdoc_files = [%q{lib/raspell_stub.rb}, %q{README}, %q{LICENSE}, %q{CHANGELOG}]
|
15
|
+
s.files = [%q{test/simple_test.rb}, %q{lib/raspell_stub.rb}, %q{ext/raspell.h}, %q{ext/raspell.c}, %q{ext/extconf.rb}, %q{README}, %q{LICENSE}, %q{CHANGELOG}, %q{raspell.gemspec}, %q{Rakefile}]
|
16
|
+
s.homepage = %q{http://fauna.github.com/fauna/raspell/}
|
17
|
+
s.require_paths = [%q{lib}, %q{ext}]
|
18
18
|
s.rubyforge_project = %q{fauna}
|
19
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.8.6}
|
20
20
|
s.signing_key = %q{/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-private_key.pem}
|
21
21
|
s.summary = %q{An interface binding for the Aspell spelling checker.}
|
22
|
-
s.test_files = [
|
22
|
+
s.test_files = [%q{test/simple_test.rb}]
|
23
23
|
|
24
24
|
if s.respond_to? :specification_version then
|
25
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
25
|
s.specification_version = 3
|
27
26
|
|
28
27
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,56 +1,68 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: raspell
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 2
|
9
|
-
version: "1.2"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.2
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
12
|
-
-
|
7
|
+
authors:
|
8
|
+
- ''
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
|
-
cert_chain:
|
16
|
-
-
|
17
|
-
|
11
|
+
cert_chain:
|
12
|
+
- ! '-----BEGIN CERTIFICATE-----
|
13
|
+
|
18
14
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AwocIPuSRFDGM4B+hgQGVDx8PMGiJKom4qLXjO40UZsR7QyN/u869Vj45LURm6h
|
41
|
+
|
32
42
|
MBcPeqCASI+WNprj9+uZa2kmHiitrFqqfMBNlm5IFbn9XeYSta9AHVvs5QQqV2m5
|
43
|
+
|
33
44
|
hIPfLqCyxsn/YgOGvo6iwyQTWyTswamaAC3HRWZxIS1sfn/Ssqa7E7oQMkv5FAXr
|
45
|
+
|
34
46
|
x5rKePfXINf8XTJczkl9OBEYdE9aNdJsJpXD0asLgGVwBICS5Bjohp6mizJcDC1+
|
47
|
+
|
35
48
|
yZ0=
|
49
|
+
|
36
50
|
-----END CERTIFICATE-----
|
37
51
|
|
38
|
-
|
39
|
-
|
52
|
+
'
|
53
|
+
date: 2011-08-26 00:00:00.000000000Z
|
40
54
|
dependencies: []
|
41
|
-
|
42
55
|
description: An interface binding for the Aspell spelling checker.
|
43
|
-
email:
|
56
|
+
email: ''
|
44
57
|
executables: []
|
45
|
-
|
46
|
-
extensions:
|
58
|
+
extensions:
|
47
59
|
- ext/extconf.rb
|
48
|
-
extra_rdoc_files:
|
60
|
+
extra_rdoc_files:
|
49
61
|
- lib/raspell_stub.rb
|
50
62
|
- README
|
51
63
|
- LICENSE
|
52
64
|
- CHANGELOG
|
53
|
-
files:
|
65
|
+
files:
|
54
66
|
- test/simple_test.rb
|
55
67
|
- lib/raspell_stub.rb
|
56
68
|
- ext/raspell.h
|
@@ -61,41 +73,30 @@ files:
|
|
61
73
|
- CHANGELOG
|
62
74
|
- raspell.gemspec
|
63
75
|
- Rakefile
|
64
|
-
|
65
|
-
homepage: http://blog.evanweaver.com/files/doc/fauna/raspell/
|
76
|
+
homepage: http://fauna.github.com/fauna/raspell/
|
66
77
|
licenses: []
|
67
|
-
|
68
78
|
post_install_message:
|
69
79
|
rdoc_options: []
|
70
|
-
|
71
|
-
require_paths:
|
80
|
+
require_paths:
|
72
81
|
- lib
|
73
82
|
- ext
|
74
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
84
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
81
|
-
- 0
|
82
|
-
version: "0"
|
83
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
90
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
segments:
|
90
|
-
- 1
|
91
|
-
- 2
|
92
|
-
version: "1.2"
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.2'
|
93
95
|
requirements: []
|
94
|
-
|
95
96
|
rubyforge_project: fauna
|
96
|
-
rubygems_version: 1.
|
97
|
+
rubygems_version: 1.8.6
|
97
98
|
signing_key:
|
98
99
|
specification_version: 3
|
99
100
|
summary: An interface binding for the Aspell spelling checker.
|
100
|
-
test_files:
|
101
|
+
test_files:
|
101
102
|
- test/simple_test.rb
|
metadata.gz.sig
CHANGED
Binary file
|