Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated readme

  • Loading branch information...
commit 90ff806595b201b58bcf161d14876e56b7d64ab4 1 parent e8b61e2
@dedeibel authored
Showing with 128 additions and 0 deletions.
  1. +57 −0 README-webstart.txt
  2. +71 −0 README.txt
View
57 README-webstart.txt
@@ -0,0 +1,57 @@
+
+UNTESTED, Flemming Frandsen from the hunspell jna lib writes:
+
+
+* Building the Java API for use via webstart
+
+If you plan on using hyphen.jar from a webstart application run:
+"ant webstart".
+
+This will produce two native jar files per supported platform (one for JNA
+and one for hunspell) as well as pure java jna-jws.jar and hyphen-jws.jar
+in build/jar.
+
+Include jna-jws.jar and hyphen-jws.jar in the common resources section in
+normal jar tags, the platform specific binaries must go into platform specific
+resource sections as nativelib entries.
+
+
+* Working around a bug in nativelib handling of webstart
+
+I had great trouble getting nativelib with more than one jar file to work on
+osx and linux (it worked fine on windows), there are two workarounds:
+
+1) Use plain <jar/> tags in stead of <nativelib/> this will cause both JNA and
+ hunspell to search the classpath for the needed binaries and they will then
+ extract the binaries and load them as usual.
+ This approach might leak a binary each run on windows because of
+ the mandatory file locking used on that platform.
+
+2) Consolidate all your nativelib files for each platform into one.
+ This looks slightly less pretty, but it works and is slightly faster during
+ download as well.
+
+
+* Output
+
+The output of "ant" is one large jar file containing binaries for all the
+supported platforms, it's about 800k, so it's not very nice for folks who
+have to download it though:
+
+hunspell.jar : The Java API + all binaries
+
+hunspell-jws.jar : Just the Java API, for use in webstart.
+hunspell-darwin-i386.jar : Binaries for use as OS specific resoruces
+hunspell-darwin-ppc.jar :
+hunspell-linux-amd64.jar :
+hunspell-linux-i386.jar :
+hunspell-win32-x86.jar :
+
+I've parted out the lib/jna.jar file in the same manner, also for use in
+webstart:
+jna-jws.jar : The Java API for JNA.
+jna-darwin.jar
+jna-linux-amd64.jar
+jna-linux-i386.jar
+jna-win32-x86.jar
+
View
71 README.txt
@@ -0,0 +1,71 @@
+
+ README
+
+** JNA based Java API for hyphen
+
+This package contains the JNA based Java bindings for the hyphen, see:
+http://sourceforge.net/projects/hunspell/files/Hyphen/
+for details.
+
+This java wrapper lives at:
+https://github.com/dedeibel/libhyphenjna
+
+See this page for dictionaries:
+http://wiki.services.openoffice.org/wiki/Dictionaries
+
+
+* Building the native binaries
+
+Before using the java API you must build some native binaries to include
+in the jar, to make things easy I've included the binaries from the platforms
+that I care about in native-lib.
+
+The binaries in native-lib were built on the various platforms using the
+native-build.pl script, the source for the native libs is in native-src and
+consists of an unmodified hunspell source tar ball and any needed diffs.
+
+I've included a script called native-build.pl which might help to build
+on at least Linux and Mac and 32 and 64 bit, for windows you
+can take it as a hint of what to do.
+
+
+* Building the Java API
+
+To build hyphen.jar simply run "ant" this will produce
+build/jar/hyphen.jar which contains everything a standalone application
+could want (aside from jna.jar which can be found on the JNA page or in lib)
+
+
+* API
+
+See HyphenMain.java for a very simple example of how to use the API, it
+boils down to:
+
+Hyphen.Dictionary dictionary = Hyphen.getInstance().getDictionary(dictPath);
+String hyphenated = dictionary.hyphenate(word);
+
+Hyphen.getInstance() caches the loaded hunspell library, so there is no
+overhead in calling it more than once.
+
+getDictionary() is also internally cached, so it costs no more than a hash
+lookup when calling the second time.
+
+
+* Thanks
+
+To Flemming Frandsen who build HunspellJNA which was mostly copied here,
+https://github.com/dren-dk/HunspellJNA
+
+Andrzej Zydron figured out how to build libhunspell for 64 bit OSX.
+
+
+* Misc
+
+At the moment the package contains copies of:
+* jna.jar version 3.4.0
+* hyphen version 3.8.3
+
+
+
+Benjamin Peter <benjaminpeter@arcor.de>
+
Please sign in to comment.
Something went wrong with that request. Please try again.