WordNet on Android part 2
This is part 2 of getting WordNet to work on Android
If you don't read any of the stuff I put on here, www.srinivas-suresh.com/news/getting-wordnet-working-on-android/, was part 1 of a work around to get WordNet working on Android. I recently realised that it may not be the best solution and since I had a lot of free time on my hands today I made a freely distribuitable JAR file that you can add to your Android project's lib folder to get WordNet working on Android.
Now before I describe how it works there are a few things you should know,
- It has KNOWN bugs. It parses parantheses like a motherfucker. Presence of parantheses in the definiton of a work almost always breaks the app. That's why I'm including links to my GitHub repo so that you can come up with a better RegEx to parse parantheses.
- Save the above bug there isn't anything I know of. Email me if you discover anything and maybe we can fix it.
- It connects to a website. So your app will need Internet permissions
The Structure of the WONET JAR is simple. It has 2 classes. WN and Definition. The Definition class has 3 data members.
- 'meaning,' which is a String object and has the definition of the word according to WordNet
- 'type', which is the part of speech that sense of the word belongs to. A String.
- 'synonyms', another string which contains the synonyms of the word separated by commas. Use the split function to extract them if you need to.
Check out this link to see the code, pastebin.com/qW7zqTMR.
If you have rudimentary understanding of Java this should not be too hard to understand.
link1: GitHub of the WONET jar source files: github.com/thewickedaxe/WonetLib
link2: GitHub of an Android project using the WONET jar. github.com/thewickedaxe/WordNetLib
IMPORTANT !!!*** FIND THE JAR IN THE LIBS FOLDER OF THE PROJECT. ***!!! IMPORTANT
IF YOU WANT ONLY THE JAR AND SOME POINTERS ON HOW TO USE IT EMAIL ME !