This project has retired. For details please refer to its Attic page.
Apache Stanbol -

RESTful Language Identification Service

STANBOL-894 added a standard RESTful Language Identification service that can be used to integrate NLP processing frameworks that do support Language Identification.

On the Stanbol Enhancer side the service is consumed by the RESTful Language Identification Engine meaning that integrators of the Language Identification functionality do only need to take care of implementing the RESTful service.

This option of integrating an NLP framework with the Stanbol Enhancer should be considered in the following scenarios:

RESTful Service specification

JSON Representation for Detected Languages

The detected languages are encoded as an JSON Array. Each Element of the array needs to define the "lang" attribute with a string value representing the language and an optional "prob" attribute with an numerical value representing the probability.

Example

A POST request with a Content-Language header and plain/text as content

curl -i -X POST -H "Content-Type: text/plain" -T en.txt http://localhost:8080/langident

will return an JSON array with the detected languages

HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Server: Jetty(6.0.x)

[{
    lang:"en",
    prob:0.907
},{
    lang:"fr",
    prob:0.532
},{
    lang:"it",
    prob:0.384
}]