view ttools/templates/api.html @ 0:af2f8fe486f6 default tip

initial
author Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
date Tue, 17 Feb 2015 12:44:40 +0100
parents
children
line wrap: on
line source

<h2>How to use the API</h2>

This service implements a simpler versiom of the API defined at
 <a href="https://dandelion.eu/docs/api/datatxt/nex/v1/">Dandelion.eu for text extraction</a> and was
 mainly designed to serve the needs of Pundit (<a href="https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-content/wiki/pundit">https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-content/wiki/pundit</a>)
 
 
 The call is
 
 <a href="../tt?text=Ego+sum+in+horto&lang=lat">tt?text=Ego+sum+in+horto&lang=lat</a>
 
 <h3>Text</h3>
 
 Text expects plain text. 
 
 <h3>lang</h3>
 Lang can either be "lat" for latin, "gre" for greek or "ita" for (old) Italian.
 
 
 It returns a JSON file with the annotated text as described at  <a href="https://dandelion.eu/docs/api/datatxt/nex/v1/">Dandelion.eu</a>,
 while 
 <ul>
 <li><b>title=label</b> is the main form of the word as can be found in the attached dictionaries.</li>
 
 <li><b>abstract</b> contains an explanation of the term, if available</li>
<li> <b>uri</b> links to the dictionary service</li>
<li><b>confidence</b> is currently an <b>arbitrary</b> value
 </ul>
 
 <p>Currently this service only gives one possible meaning of a word, while the underlying service at <a href="http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/">
 http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/
 </a> gives you all know variant, this is due to the necessary compatibility with the current pundit version.</p>
 
<pre>
{

    "time": 1,
    "lang": "lat",
    "annotations": 

[

{

    "lod": 

{

    "word": "http://purl.org/linguistics/gold/OrthographicWord"

},
"image": { },
"confidence": 0.8,
"label": "Ego",
"spot": "Ego",
"type":
[

    "http://purl.org/linguistics/gold/OrthographicWord"

],
"title": "Ego",
"abstract": "",
"uri": "http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/lt/GetDictionaryEntries?language=lat&outputFormat=html&outputType=morphCompact&outputType=dictFull&query=Ego",
"types":

    [
        "http://purl.org/linguistics/gold/OrthographicWord"
    ],
    "end": 3,
    "start": 0

},
{

    "lod": 

{

    "word": "http://purl.org/linguistics/gold/OrthographicWord"

},
"image": { },
"confidence": 0.8,
"label": "sum",
"spot": "sum",
"type":
[

    "http://purl.org/linguistics/gold/OrthographicWord"

],
"title": "sum",
"abstract": "To be.",
"uri": "http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/lt/GetDictionaryEntries?language=lat&outputFormat=html&outputType=morphCompact&outputType=dictFull&query=sum",
"types":

    [
        "http://purl.org/linguistics/gold/OrthographicWord"
    ],
    "end": 7,
    "start": 4

},
{

    "lod": 

{

    "word": "http://purl.org/linguistics/gold/OrthographicWord"

},
"image": { },
"confidence": 0.8,
"label": "in",
"spot": "in",
"type":
[

    "http://purl.org/linguistics/gold/OrthographicWord"

],
"title": "in",
"abstract": "To admit an accusation broughte against one as lawful.",
"uri": "http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/lt/GetDictionaryEntries?language=lat&outputFormat=html&outputType=morphCompact&outputType=dictFull&query=in",
"types":

    [
        "http://purl.org/linguistics/gold/OrthographicWord"
    ],
    "end": 10,
    "start": 8

},
{

    "lod": 

{

    "word": "http://purl.org/linguistics/gold/OrthographicWord"

},
"image": { },
"confidence": 0.8,
"label": "horto",
"spot": "horto",
"type":
[

    "http://purl.org/linguistics/gold/OrthographicWord"

],
"title": "horto",
"abstract": "A knot gardÊ: a garden for pleasute: an ortharde.",
"uri": "http://mpdl-service.mpiwg-berlin.mpg.de/mpiwg-mpdl-lt-web/lt/GetDictionaryEntries?language=lat&outputFormat=html&outputType=morphCompact&outputType=dictFull&query=horto",
"types":

            [
                "http://purl.org/linguistics/gold/OrthographicWord"
            ],
            "end": 16,
            "start": 11
        }
    ]

}
</pre>