Sunteți pe pagina 1din 3

– Documentation –

HASK HTTP API Documentation

Piotr Pęzik
pelcra.pl

10 grudnia 2012

1 About this document


This document explains the HTTP access to the HASK collocation dictionary service.
Currently, we support basic XML access whereby users specify query parameters in
POST and GET requests which are processed by the server to return XML-encoded
results from the dictionaries.
This document describes the use of three basic HASK API servlets:
1. EntryTypesXML
2. EntryXML

3. CollocationXML
Authentication is very simple at the moment; the correct login credentials are pas-
sed in the user and pass parameters. Demo login details are given below.

user public
pass 6cc8e93f7a657b484aca56d70f9a7f19

2 Naming conventions
• HTTP SERVICE URL is the full HTTP address of the HASK API service, for
example:
– http://pelcra.pl/hask_pl/
– http://pelcra.pl/hask_en/
Piotr Pęzik – Documentation – pelcra.pl

3 EntryXML – retrieving entry information


The following request:

HTTP_SERVICE_URL/EntryTypesXML?user=public&pass=6cc8e93f7a657b484aca56d70f9a7f19

returns an XML version of the current list of collocations in the dictionary. An example
single rule section of the returned XML is given below:

<r u l e n=” 1 ”>


< r u l e i d>1</ r u l e i d>
<r u l e n a m e>N J</ r u l e n a m e>
<n o d e p o s>noun</ n o d e p o s>
<c o l l o c a t e p o s>a d j e c t i v e</ c o l l o c a t e p o s>
< c o l l o c a t e p o s i t i o n s>1</ c o l l o c a t e p o s i t i o n s>
< t o t a l e n t r i e s>16383</ t o t a l e n t r i e s>
< t o t a l c o l l o c a t e s>267587</ t o t a l c o l l o c a t e s>
<d e s c r i p t i o n>Nouns i m m e d i a t e l y p r e c e d e d by a d j e c t i v e s
</ d e s c r i p t i o n>
</ r u l e>

4 EntryXML – retrieving entry information


The following request:

HTTP_SERVICE_URL/EntryXML?user=public
&pass=6cc8e93f7a657b484aca56d70f9a7f19
&entry_node=finger&rule_id=1&offset=0&limit=20

returns an XML list of the first 50 adjectival collocates of the noun finger (rule id=1).

An example single collocate result in the list is shown below:


<c o l hash=” 447 b f e a 7 6 1 1 4 1 2 4 d 3 8 4 1 a a 8 6 e 9 f 8 5 8 8 f ”>
< c o l l o c a t e> l i t t l e </ c o l l o c a t e>
<c f o r m s>
<c f o r m> l i t t l e </ c f o r m>
</ c f o r m s>
<pos>N%</ pos>
<a>1 2 7 7 . 0</ a>
< t t e s t>3 1 . 3 1 5 3 2</ t t e s t>
<mi3>2 3 . 6 5 2 3 7</mi3>
<g2>3 2 1 8 . 6 8 4 3 3 1 8 9 3 9 2</ g2>
<mi>3 . 0 1 5 2 8 5 1 2 4 8 1 4 4</mi>

HASK HTTP API Documentation 2


Piotr Pęzik – Documentation – pelcra.pl

<l o g l o g>3 1 . 1 1 3 3 4 8 6 4 3 8 5 7 2</ l o g l o g>


<c h i s q>8 0 4 1 . 3 6 8 5 7 5 8 5 8 9 1</ c h i s q>
<j d>0 . 7 9 4 5 5</ j d>
<r a n g e>8 2 . 0</ r a n g e>
<awt>5 8 1 9 2 2 . 0</awt>
<fawt>9 3 . 4 1 3 7 1</ fawt>
</ c o l>

Collocation measure Explanation


a plain frequency of co-occurrence
ttest association strength measure
mi3 association strength measure
g2 association strength measure
mi association strength measure
loglog association strength measure
chisq association strength measure
jd dispersion measure (0 to 1)
range dispersion measure (0 to 100)
awt dispersion measure (Average Waiting Time in words)
fawt dispersion measure (frequency scaled by AWT)

5 CollocationXML
The following request:

HTTP_SERVICE_URL/CollocationXML?user=public&pass=6cc8e93f7a657b484aca56d70f9a7f19
&col_hash=447bfea76114124d3841aa86e9f8588f&conc_limit=50

returns a single XML-encoded collocation record. The value of the col hash parame-
ter is obtained through the EntryXML service described above. A maximum of 50
concordances are available for a single collocation entry.

HASK HTTP API Documentation 3

S-ar putea să vă placă și