hexgnu-libsvm-ruby-swig 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +4 -0
- data/COPYING +24 -0
- data/History.txt +4 -0
- data/Manifest.txt +11 -0
- data/README.rdoc +22 -0
- data/Rakefile +38 -0
- data/ext/extconf.rb +7 -0
- data/ext/libsvm_wrap.cxx +4387 -0
- data/ext/svm.cpp +3072 -0
- data/ext/svm.h +76 -0
- data/lib/svm.rb +124 -0
- metadata +97 -0
data/AUTHORS
ADDED
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
data/Manifest.txt
ADDED
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
|