Uploaded image for project: 'Stanbol'
  1. Stanbol
  2. STANBOL-894

RESTful Language Identification service

    Details

      Description

      This issue will define a RESTful service that can be used to detect the language for parsed text.

        Activity

        Hide
        rwesten Rupert Westenthaler added a comment -
            1. 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)
            1. 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 }

        ]

        Show
        rwesten Rupert Westenthaler added a comment - 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 } ]
        Hide
        rwesten Rupert Westenthaler added a comment -

        specified by the 1st comment to this issue

        Show
        rwesten Rupert Westenthaler added a comment - specified by the 1st comment to this issue

          People

          • Assignee:
            rwesten Rupert Westenthaler
            Reporter:
            rwesten Rupert Westenthaler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development