NAME

Lingua::DE::Wortschatz - wortschatz.uni-leipzig.de webservice client

SYNOPSIS

use Lingua::DE::Wortschatz;
# use Lingua::DE::Wortschatz ':all'; # import all functions

my $result=Lingua::DE::Wortschatz::use_service('T','toll');
# my $result=use_service('T','toll'); # with imported functions

$result->dump;

@lines=$result->hashrefs();
for (@lines) {
    print $_->{Synonym},"\n";
}

print Lingua::DE::Wortschatz::help('T');
print Lingua::DE::Wortschatz::help('full');

$result->dump;

DESCRIPTION

This is a full featured client for the webservices at http://wortschatz.uni-leipzig.de. The script wsws.pl is a command line client that uses this lib. It is contained in this distribution.

The webservices at http://wortschatz.uni-leipzig.de provide access to a database of the german word pool. Available services include tools to reduce words to base form, find synonyms, significant neighbours, example sentences and more. All public services at http://wortschatz.uni-leipzig.de are available through this client. See the detailed list below.

I have nothing to do with the University of Leipzig and the Wortschatz project. Personally, I'm just an average german native speaker and can only guess on questions related to the german language. Further answers to frequent questions are that this program will really run on Windows, provided that Perl is installed. The program will indeed allow to perform automated queries with perl scripts. It can be used from the command line, too. There is no GUI.

FUNCTIONS

The following functions can be exported or used via the full name.

use_service($name,@args)

Uses the webservice named $name with the arguments @args. Returns undef if not enough arguments for the desired service are supplied. Otherwise it returns a result object (see below).

All public services at http://wortschatz.uni-leipzig.de are available. Below is a list of service names and their parameters. Any parameter with = is optional and defaults to the given value. Service names can be abbreviated to the shortest unique form.

* ServiceOverview Name=
* Cooccurrences Wort Mindestsignifikanz=1 Limit=10
* Baseform Wort
* Sentences Wort Limit=10
* RightNeighbours Wort Limit=10
* LeftNeighbours Wort Limit=10
* Frequencies Wort Limit=10
* Synonyms Wort Limit=10
* Thesaurus Wort Limit=10
* Wordforms Word Limit=10
* Similarity Wort Limit=10
* LeftCollocationFinder Wort Wortart Limit=10
* RightCollocationFinder Wort Wortart Limit=10
* Sachgebiet Wort  
* Kreuzwortraetsel Wort Wortlaenge Limit=10

A full list of available services, their parameters and additional information on what each service does can be obtained with the help function.

For the Kreuzwortraetsel service, use % as a placeholder in parameter Wort.

help(?$service)

Returns a string containing information about the service with name $service. If no service name is given, a short list of all available services is returned. If $service eq 'full', a more detailed list is created.

THE RESULT OBJECT

The use_service function returns a result object of class Lingua::DE::Wortschatz::Result that holds the results.

This object offers methods to conveniently access the data.

dump()

$result->dump();

Pretty prints the data to STDOUT.

service()

$service_name=$result->service();

Returns the name of the service that was used to obtain the data.

names()

@column_headers=$result->names();

Returns a list of the names of the data columns.

data()

@rows=$result->data();

Returns a list of datasets. Each dataset is a reference to a list of values.

hashrefs()

@lines=$result->hashrefs();

Returns a list of datasets. Each dataset is a references to a hash. The hashkeys are the names of the return values and the values are the data.

CAVEATS/BUGS

I wrote this to understand SOAP better. It took me way too long, due to the lack of documentation.

I couldn't figure out how to make SOAP::Lite and SOAP::Data create the request parameters in the correct way. It appears to me that this would require me to create custom as_Datatype functions for all the used types.

I could neither make it work using the WSDL file. I think with the data format that wortschatz.u-l requires, WSDL is pretty useless.

So I decided to use a straightforward approach and create the XML request parameters myself. This is probably not the idea of that whole SOAP thing, but it's short and it works. But see it as a hack.

SEE ALSO

http://wortschatz.uni-leipzig.de
SOAP::Lite

AUTHOR/COPYRIGHT

This is $Id: Wortschatz.pm 1057 2008-02-28 17:54:09Z schroeer $.

Copyright 2005 - 2008 Daniel Schröer (schroeer@cpan.org).

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 274:

Non-ASCII character seen before =encoding in 'Schröer'. Assuming CP1252