The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.

The author of this module has nothing to do with the University of Leipzig or the Wortschatz project.

This module allows to perform automated queries with perl scripts. It can be used from the command line, too. There is no GUI.

This program will run on Windows if Perl is installed.

FUNCTIONS

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

use_service($name,@args)

Uses the webservice named $name with arguments @args. Returns a result object that is described below. Returns undef if an insufficient number of arguments for the desired service is supplied.

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 named $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 is short and it works. It's a hack.

SEE ALSO

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

AUTHOR/COPYRIGHT

This is $Id: Wortschatz.pm 1151 2008-10-05 20:57:26Z schroeer $.

Copyright 2005 - 2008 Daniel Schröer (schroeer@cpan.org). Any feedback is appreciated.

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 325:

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