Diff
Added: trunk/stemmer4jr/LICENSE (0 => 499)
--- trunk/stemmer4jr/LICENSE (rev 0)
+++ trunk/stemmer4jr/LICENSE 2007-04-25 08:18:06 UTC (rev 499)
@@ -0,0 +1,20 @@
+Copyright (c) 2007 Ola Bini <[EMAIL PROTECTED]>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Added: trunk/stemmer4jr/README.txt (0 => 499)
--- trunk/stemmer4jr/README.txt (rev 0)
+++ trunk/stemmer4jr/README.txt 2007-04-25 08:18:06 UTC (rev 499)
@@ -0,0 +1,2 @@
+Stemmer4Jr
+
Added: trunk/stemmer4jr/Rakefile (0 => 499)
--- trunk/stemmer4jr/Rakefile (rev 0)
+++ trunk/stemmer4jr/Rakefile 2007-04-25 08:18:06 UTC (rev 499)
@@ -0,0 +1,50 @@
+require 'rake'
+
+task :default => :package
+
+def java_classpath_arg # myriad of ways to discover JRuby classpath
+ "-cp " + (ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
+ (FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"]+['lib/libstemmer_java.jar']).join(File::PATH_SEPARATOR))
+end
+
+desc "Compile the native Java code."
+task :java_compile do
+ mkdir_p "pkg/classes"
+ sh "javac -target 1.4 -source 1.4 -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}"
+ sh "jar cfm lib/stemmer4r.jar java_manifest -C pkg/classes/ ."
+end
+file "lib/stemmer4r.jar" => :java_compile
+
+task :more_clean do
+ rm_f(FileList['lib/*.jar'] - ['lib/libstemmer_java.jar'])
+end
+
+task :clean => :more_clean
+
+task :filelist do
+ puts FileList['pkg/**/*'].inspect
+end
+
+begin
+ MANIFEST = FileList["Manifest.txt", "README.txt",
+ "Rakefile", "LICENSE", "lib/**/*.rb", "lib/stemmer4r.jar", "lib/libstemmer_java.jar"]
+
+ file "Manifest.txt" => :manifest
+ task :manifest do
+ File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f << "#{n}\n"} }
+ end
+ Rake::Task['manifest'].invoke # Always regen manifest, so Hoe has up-to-date list of files
+
+ require 'hoe'
+ Hoe.new("stemmer4jr", "0.0.1") do |p|
+ p.rubyforge_name = "jruby-extras"
+ p.url = ""
+ p.author = "Ola Bini"
+ p.email = "[EMAIL PROTECTED]"
+ p.summary = "JRuby version of stemmer4r"
+ p.description = p.paragraphs_of('README.txt', 0...1).join("\n\n")
+ p.extra_deps.reject!{|d| d.first == "hoe"}
+ end
+rescue LoadError
+ puts "You really need Hoe installed to be able to package this gem"
+end
Added: trunk/stemmer4jr/java_manifest (0 => 499)
--- trunk/stemmer4jr/java_manifest (rev 0)
+++ trunk/stemmer4jr/java_manifest 2007-04-25 08:18:06 UTC (rev 499)
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Created-By: 1.6.0-b105 (Sun Microsystems Inc.)
+Built-By: olagus
+Class-Path: libstemmer_java.jar
Added: trunk/stemmer4jr/lib/libstemmer_java.jar
(Binary files differ)
Property changes on: trunk/stemmer4jr/lib/libstemmer_java.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/stemmer4jr/src/java/Stemmer4rService.java (0 => 499)
--- trunk/stemmer4jr/src/java/Stemmer4rService.java (rev 0)
+++ trunk/stemmer4jr/src/java/Stemmer4rService.java 2007-04-25 08:18:06 UTC (rev 499)
@@ -0,0 +1,39 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2007 Ola Bini <[EMAIL PROTECTED]>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+import java.io.IOException;
+
+import org.jruby.Ruby;
+import org.jruby.RubyClass;
+import org.jruby.runtime.CallbackFactory;
+import org.jruby.runtime.load.BasicLibraryService;
+
+public class Stemmer4rService implements BasicLibraryService {
+ public boolean basicLoad(final Ruby runtime) throws IOException {
+ return true;
+ }
+}