Skip to content

Commit 89d99f9

Browse files
author
Camilo Lopez
committed
Using autolad, some more README and typos
1 parent 370faf6 commit 89d99f9

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

README.rdoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
= svmredlight
1+
== svmredlight
22
Very partial interface to SVM-light [http://svmlight.joachims.org/] it permits loading a
33
model (pre-created with svm_learn) from a file and using it for classification.
44

55
As of now it's know to work with SVM 6.02.
66

7+
Make sure to build the libsvmlight.o version of svmlight by using
8+
"make libsvmlight_hideo" .
9+
710
== Contributing to svmredlight
811

912
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet

ext/svmredlight.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
#include "svm_light/svm_common.h"
66

77
/* Helper function to determine if a model uses linear kernel, this could be a #define
8-
* macro
9-
*/
8+
* macro */
109
int
1110
is_linear(MODEL *model){
1211
return model->kernel_parm.kernel_type == 0;
1312
}
1413

15-
//Mdule and Classes
14+
//Modules and Classes
1615
static VALUE rb_mSvmLight;
1716
static VALUE rb_cModel;
1817
static VALUE rb_cDocument;
@@ -32,8 +31,7 @@ doc_free(DOC *d){
3231

3332
/* Read a svm_light model from a file generated by svm_learn receives the filename as
3433
* argument do make sure the file exists before calling this! otherwise exit(1) might be
35-
* called and the ruby interpreter will die.
36-
*/
34+
* called and the ruby interpreter will die.*/
3735
static VALUE
3836
model_read_from_file(VALUE klass, VALUE filename){
3937
Check_Type(filename, T_STRING);
@@ -56,7 +54,6 @@ model_classify_example(VALUE self, VALUE example){
5654

5755
Data_Get_Struct(example, DOC, ex);
5856
Data_Get_Struct(self, MODEL, m);
59-
6057

6158
/* Apparently unnecessary code
6259
@@ -67,8 +64,6 @@ model_classify_example(VALUE self, VALUE example){
6764

6865
result = classify_example(m, ex);
6966

70-
//1.9.1
71-
//return DBL2NUM(result);
7267
return rb_float_new((float)result);
7368
}
7469

lib/svmredlight.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
require './ext/svmredlight'
22
require './lib/svmredlight/model'
3+
require './lib/svmredlight/document'
34

test/helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
end
1111
require 'test/unit'
1212
require 'shoulda'
13+
require './lib/svmredlight'
1314

1415
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
1516
$LOAD_PATH.unshift(File.dirname(__FILE__))

test/test_document.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require './test/helper'
2-
require './lib/svmredlight'
32

43
include SVMLight
54

test/test_model.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require './test/helper'
2-
require './lib/svmredlight'
32

43
class TestModel < Test::Unit::TestCase
54
def test_read

0 commit comments

Comments
 (0)