ots 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +13 -0
- data/ext/{extconf.rb → ots/extconf.rb} +1 -2
- data/ext/{libots → ots/libots}/article.c +0 -0
- data/ext/{libots → ots/libots}/dictionary.c +2 -0
- data/ext/{libots → ots/libots}/grader-tc.c +0 -0
- data/ext/{libots → ots/libots}/grader-tc.h +0 -0
- data/ext/{libots → ots/libots}/grader-tf.c +0 -0
- data/ext/{libots → ots/libots}/grader.c +0 -0
- data/ext/{libots → ots/libots}/highlighter.c +0 -0
- data/ext/{libots → ots/libots}/html.c +0 -0
- data/ext/{libots → ots/libots}/libots.h +0 -0
- data/ext/{libots → ots/libots}/parser.c +0 -0
- data/ext/{libots → ots/libots}/relations.c +0 -0
- data/ext/{libots → ots/libots}/stemmer.c +0 -0
- data/ext/{libots → ots/libots}/text.c +0 -0
- data/ext/{libots → ots/libots}/wordlist.c +0 -0
- data/ext/{ots.c → ots/ots.c} +15 -2
- data/ext/{ots.h → ots/ots.h} +0 -0
- data/ext/ots/version.h +2 -0
- data/lib/ots.rb +8 -0
- data/lib/ots/grader.rb +0 -1
- data/test/test_grader.rb +9 -0
- metadata +25 -22
- data/ext/version.h +0 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 0.5.4 (2012-02-03)
|
2
|
+
|
3
|
+
* move extension into subdirectory.
|
4
|
+
* added OTS#set_dictionary_path to avoid compile time path resolution.
|
5
|
+
|
6
|
+
=== 0.5.3 (2012-01-27)
|
7
|
+
|
8
|
+
* cleanup dependencies.
|
9
|
+
|
10
|
+
=== 0.5.2 (2012-01-25)
|
11
|
+
|
12
|
+
* added OTS::Grader
|
13
|
+
|
1
14
|
=== 0.5.1 (2012-01-11)
|
2
15
|
|
3
16
|
* GC bugfix: hang on to encoding index rather than rb_encoding pointer.
|
@@ -15,8 +15,7 @@ if glib_ldflags.empty?
|
|
15
15
|
glib_ldflags = libs.split(/\s+/).map {|lib| "-l#{lib}"}.join(' ')
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
$CFLAGS = glib_cflags + %Q{ -Ilibots -I/usr/include/libxml2 -DDICTIONARY_DIR='"#{dir}/"'}
|
18
|
+
$CFLAGS = glib_cflags + %Q{ -Ilibots -I/usr/include/libxml2}
|
20
19
|
$LDFLAGS = glib_ldflags + %Q{ -Llibots}
|
21
20
|
|
22
21
|
find_library('glib-2.0', 'main') or raise "unable to find glib-2.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/ext/{ots.c → ots/ots.c}
RENAMED
@@ -4,6 +4,7 @@
|
|
4
4
|
#include <errno.h>
|
5
5
|
|
6
6
|
static VALUE mOTS, cArticle;
|
7
|
+
char *DICTIONARY_DIR;
|
7
8
|
|
8
9
|
static void article_free(OtsArticle *article) {
|
9
10
|
if (article)
|
@@ -174,6 +175,16 @@ VALUE ots_languages(VALUE self) {
|
|
174
175
|
return languages;
|
175
176
|
}
|
176
177
|
|
178
|
+
VALUE ots_set_dictionary_path(VALUE self, VALUE path) {
|
179
|
+
char *string = CSTRING(path);
|
180
|
+
if (DICTIONARY_DIR)
|
181
|
+
free(DICTIONARY_DIR);
|
182
|
+
|
183
|
+
DICTIONARY_DIR = (char *)malloc(strlen(string) + 2);
|
184
|
+
sprintf(DICTIONARY_DIR, "%s/", string);
|
185
|
+
return Qnil;
|
186
|
+
}
|
187
|
+
|
177
188
|
/* init */
|
178
189
|
|
179
190
|
void Init_ots(void) {
|
@@ -185,10 +196,12 @@ void Init_ots(void) {
|
|
185
196
|
rb_define_method(cArticle, "topics", RUBY_METHOD_FUNC(article_topics), 0);
|
186
197
|
rb_define_method(cArticle, "keywords", RUBY_METHOD_FUNC(article_keywords), 0);
|
187
198
|
|
188
|
-
rb_define_module_function(mOTS, "parse",
|
189
|
-
rb_define_module_function(mOTS, "languages",
|
199
|
+
rb_define_module_function(mOTS, "parse", RUBY_METHOD_FUNC(ots_parse), -1);
|
200
|
+
rb_define_module_function(mOTS, "languages", RUBY_METHOD_FUNC(ots_languages), 0);
|
201
|
+
rb_define_module_function(mOTS, "set_dictionary_path", RUBY_METHOD_FUNC(ots_set_dictionary_path), 1);
|
190
202
|
|
191
203
|
rb_define_alloc_func(cArticle, article_allocate);
|
192
204
|
|
193
205
|
rb_define_const(mOTS, "VERSION", rb_str_new2(RUBY_OTS_VERSION));
|
206
|
+
DICTIONARY_DIR = 0;
|
194
207
|
}
|
data/ext/{ots.h → ots/ots.h}
RENAMED
File without changes
|
data/ext/ots/version.h
ADDED
data/lib/ots.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
require 'ots/ots'
|
2
|
+
|
3
|
+
module OTS
|
4
|
+
DICTIONARY_PATH = File.absolute_path(File.dirname(__FILE__) + '/../dictionaries')
|
5
|
+
# set the dictionary path, so the c extension can read files.
|
6
|
+
# we can set this at compile time but bundler sometimes compiles the extension inside a temp directory.
|
7
|
+
set_dictionary_path DICTIONARY_PATH
|
8
|
+
end
|
data/lib/ots/grader.rb
CHANGED
data/test/test_grader.rb
ADDED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 4
|
9
|
+
version: 0.5.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bharanee Rathna
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-
|
17
|
+
date: 2012-02-03 00:00:00 +11:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -49,31 +49,33 @@ email:
|
|
49
49
|
executables: []
|
50
50
|
|
51
51
|
extensions:
|
52
|
-
- ext/extconf.rb
|
52
|
+
- ext/ots/extconf.rb
|
53
53
|
extra_rdoc_files: []
|
54
54
|
|
55
55
|
files:
|
56
|
-
- ext/ots.c
|
57
|
-
- ext/libots/text.c
|
58
|
-
- ext/libots/grader-tf.c
|
59
|
-
- ext/libots/stemmer.c
|
60
|
-
- ext/libots/article.c
|
61
|
-
- ext/libots/grader-tc.c
|
62
|
-
- ext/libots/html.c
|
63
|
-
- ext/libots/grader.c
|
64
|
-
- ext/libots/relations.c
|
65
|
-
- ext/libots/parser.c
|
66
|
-
- ext/libots/dictionary.c
|
67
|
-
- ext/libots/highlighter.c
|
68
|
-
- ext/libots/wordlist.c
|
69
|
-
- ext/ots.h
|
70
|
-
- ext/version.h
|
71
|
-
- ext/libots/grader-tc.h
|
72
|
-
- ext/libots/libots.h
|
73
|
-
- ext/extconf.rb
|
56
|
+
- ext/ots/ots.c
|
57
|
+
- ext/ots/libots/text.c
|
58
|
+
- ext/ots/libots/grader-tf.c
|
59
|
+
- ext/ots/libots/stemmer.c
|
60
|
+
- ext/ots/libots/article.c
|
61
|
+
- ext/ots/libots/grader-tc.c
|
62
|
+
- ext/ots/libots/html.c
|
63
|
+
- ext/ots/libots/grader.c
|
64
|
+
- ext/ots/libots/relations.c
|
65
|
+
- ext/ots/libots/parser.c
|
66
|
+
- ext/ots/libots/dictionary.c
|
67
|
+
- ext/ots/libots/highlighter.c
|
68
|
+
- ext/ots/libots/wordlist.c
|
69
|
+
- ext/ots/ots.h
|
70
|
+
- ext/ots/version.h
|
71
|
+
- ext/ots/libots/grader-tc.h
|
72
|
+
- ext/ots/libots/libots.h
|
73
|
+
- ext/ots/extconf.rb
|
74
74
|
- test/test_article.rb
|
75
75
|
- test/test_ots.rb
|
76
76
|
- test/helper.rb
|
77
|
+
- test/test_grader.rb
|
78
|
+
- lib/ots.rb
|
77
79
|
- lib/ots/grader.rb
|
78
80
|
- README.md
|
79
81
|
- CHANGELOG
|
@@ -123,6 +125,7 @@ rdoc_options: []
|
|
123
125
|
|
124
126
|
require_paths:
|
125
127
|
- lib
|
128
|
+
- ext
|
126
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
130
|
none: false
|
128
131
|
requirements:
|
data/ext/version.h
DELETED