hexgnu-libsvm-ruby-swig 0.1.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.
data/AUTHORS ADDED
@@ -0,0 +1,4 @@
1
+ Matthew Kirk <matt@matthewkirk.com>
2
+ Tom Zeng <tom.z.zeng@mail.com> (Ruby SWIG interface to LIBSVM)
3
+ FeedbackMine <feedbackmine@feedbackmine.com> (gem)
4
+ Chih-Chung Chang and Chih-Jen Lin <cjlin@csie.ntu.edu.tw> (developers of LIBSVM)
data/COPYING ADDED
@@ -0,0 +1,24 @@
1
+ == LICENSE:
2
+
3
+ (The MIT License)
4
+
5
+ Copyright (c) 2009 Tom Zeng
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ 'Software'), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ 2009-03-04 Tom Zeng (tom.z.zeng@gmail.com)
2
+ * adopted the gem spec by feedbackmine.com
3
+ 2009-05-14 Tom Zeng
4
+ * upgrade LIBSVM to 2.89
data/Manifest.txt ADDED
@@ -0,0 +1,11 @@
1
+ History.txt
2
+ COPYING
3
+ AUTHORS
4
+ Manifest.txt
5
+ README.rdoc
6
+ Rakefile
7
+ lib/svm.rb
8
+ ext/libsvm_wrap.cxx
9
+ ext/svm.cpp
10
+ ext/svm.h
11
+ ext/extconf.rb
data/README.rdoc ADDED
@@ -0,0 +1,22 @@
1
+ = libsvm-ruby-swig
2
+
3
+ * Ruby interface to LIBSVM (using SWIG)
4
+ * http://www.tomzconsulting.com
5
+ * http://tweetsentiments.com
6
+
7
+ == DESCRIPTION:
8
+
9
+ This is the Ruby port of the LIBSVM Python SWIG (Simplified Wrapper and
10
+ Interface Generator) interface.
11
+
12
+ A slightly modified version of LIBSVM 2.9 is included, it allows turrning on/off
13
+ the debug log. You don't need your own copy of SWIG to use this library - all
14
+ needed files are generated using SWIG already.
15
+
16
+ Look for the README file in the ruby subdirectory for instructions.
17
+ The binaries included were built under Ubuntu Linux 2.6.28-18-generic x86_64,
18
+ you should run make under the libsvm-2.9 and libsvm-2.9/ruby
19
+ directories to regenerate the executables for your environment.
20
+
21
+ LIBSVM is in use at http://tweetsentiments.com - A Twitter / Tweet sentiment
22
+ analysis application
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ require 'rubygems'
2
+ gem 'hoe', '>=1.8.3','<= 1.12.2'
3
+ require 'hoe'
4
+
5
+ task :default => ["sync_files","make_gem"]
6
+
7
+ EXT = "ext/svm?.#{Hoe::DLEXT}"
8
+
9
+ Hoe.new('libsvm-ruby-swig', '0.4.0') do |p|
10
+ p.author = 'Tom Zeng'
11
+ p.email = 'tom.z.zeng@gmail.com'
12
+ p.url = 'http://www.tomzconsulting.com'
13
+ p.summary = 'Ruby wrapper of LIBSVM using SWIG'
14
+ p.description = 'Ruby wrapper of LIBSVM using SWIG'
15
+
16
+ p.spec_extras[:extensions] = "ext/extconf.rb"
17
+ p.clean_globs << EXT << "ext/*.o" << "ext/Makefile"
18
+ end
19
+
20
+ task :make_gem => EXT
21
+
22
+ file EXT => ["ext/extconf.rb", "ext/libsvm_wrap.cxx", "ext/svm.cpp", "ext/svm.h"] do
23
+ Dir.chdir "ext" do
24
+ ruby "extconf.rb"
25
+ sh "make"
26
+ end
27
+ end
28
+
29
+ task :sync_files do
30
+ cp "libsvm-2.9/svm.h","ext/"
31
+ cp "libsvm-2.9/svm.cpp","ext/"
32
+ cp "libsvm-2.9/ruby/libsvm_wrap.cxx","ext/"
33
+ cp "libsvm-2.9/ruby/svm.rb","lib/"
34
+ end
35
+
36
+ task :test do
37
+ puts "done"
38
+ end
data/ext/extconf.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'mkmf'
2
+ CONFIG["CC"] = "g++"
3
+ $CFLAGS = "#{ENV['CFLAGS']} -Wall -O3 "
4
+ if CONFIG["MAJOR"].to_i >= 1 && CONFIG["MINOR"].to_i >= 8
5
+ $CFLAGS << " -DHAVE_DEFINE_ALLOC_FUNCTION"
6
+ end
7
+ create_makefile('libsvm-ruby-swig/libsvm')