[ 
https://issues.apache.org/jira/browse/STANBOL-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558785#comment-13558785
 ] 

Rupert Westenthaler commented on STANBOL-894:
---------------------------------------------

### Language Identification Service

* Method: POST {service-baseuri}
* Request Headers:
    * Content-Type: Must be `plain/text; charset={charset}`. If the charset 
parameter is missing that `UTF-8` is used as default.
* Response: The JSON serialized Information about the detected Languages (see 
specification below)

### 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
    }]

                
> RESTful Language Identification service
> ---------------------------------------
>
>                 Key: STANBOL-894
>                 URL: https://issues.apache.org/jira/browse/STANBOL-894
>             Project: Stanbol
>          Issue Type: New Feature
>            Reporter: Rupert Westenthaler
>            Assignee: Rupert Westenthaler
>
> This issue will define a RESTful service that can be used to detect the 
> language for parsed text.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to