WLAPI is a programmatic API for web services provided by the project Wortschatz, University of Leipzig. These services are a great source of linguistic knowledge for morphological, syntactic and semantic analysis of German both for traditional and Computational Linguistics (CL).
Use this API to gain data on word frequencies, left and right neighbours, collocations and semantic similarity. Check it out if you are interested in Natural Language Processing (NLP) and Human Language Technology (HLT).
You can use the following search methods:
The services NGrams and NGramReferences are under development and will be available soon. Both methods throw an NotImplementedError for now.
The interface will be slightly changed in the version 1.0 to be more readable. For example, #cooccurrences_all will become #all_cooccurrences.
There are two additional services by Wortschatz Leipzig: MARS and Kookurrenzschnitt. They will not be implemented due to internal restrictions of the service provider.
WLAPI is provided as a .gem package. Simply install it via RubyGems.
To install WLAPI ussue the following command:
$ gem install wlapi
You might want to install versions prior to 0.8.0, if you are bound on the old implementations of savon:
$ gem install wlapi -v 0.7.4
If you want to do a system wide installation, do this as root (possibly using sudo).
Alternatively use your Gemfile for dependency management.
Basic usage is very simple:
$ require 'wlapi' $ api = WLAPI::API.new $ api.synonyms('Haus', 15) # returns an array with string values (UTF8 encoded) $ api.domain('Auto') # => Array
If you are going to send mass requests, please contact the support team of the project Wortschatz, get your private credentials and instantiate an authenticated client:
$ require 'wlapi' $ api = WLAPI::API.new(username, password)
See documentation in the WLAPI::API class for details on particular search methods.
While using WLAPI you can face following errors:
The errors here are presented in the order they may occur during WLAPI's work.
First WLAPI checks the user input and throws a WLAPI::UserError if the arguments are not appropriate.
Then it fetches a response from a remote server, it can result in a WLAPI::ExternalError. In most cases it will be a simple wrapper around other errors, e.g. Savon::SOAP::Fault.
All of them are subcalsses of WLAPI::Error which is in turn a subclass of the standard RuntimeError.
If you want to intercept any and every exception thrown by WLAPI simply rescue WLAPI::Error.
If you have question, bug reports or any suggestions, please drop me an email :) Any help is deeply appreciated!
If you need some new functionality please contact me or provide a pull request. You code should be complete and tested. Please use local_* and remote_* naming convention for your tests.
For details on future plan and working progress see CHANGELOG.
This library is work in process! Though the interface is mostly complete, you might face some not implemented features.
Please contact me with your suggestions, bug reports and feature requests.
WLAPI is a copyrighted software by Andrei Beliankou, 2010-2013
You may use, redistribute and change it under the terms provided in the LICENSE file.