Show / Hide Table of Contents

Multi Language identification for text

This call will allow the user to identify the source language of a given input.

Linux

curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"input": "A mountain is generally steeper than a hill"}, \
"inputFormat": "PLAIN"}' \
'https://api.languageweaver.com/v4/multi-language-identification'
Windows

curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
 \"input\": \"A mountain is generally steeper than a hill\",^
 \"inputFormat\": \"PLAIN\"^
}" https://api.languageweaver.com/v4/multi-language-identification

Access token type
User credentials - Allowed User Roles: Admin, Linguist, Translator
API credentials

HTTP Request
POST /v4/multi-language-identification

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Request JSON:

{
   "input": "A mountain is generally steeper than a hill",
   "inputFormat": "PLAIN"
}

Request Parameters

Format
JSON

Name Type Mandatory Default value Description
input string yes The source text for which we want to identify the language
inputFormat string no PLAIN Format of input content

Text Input formats

Name Description
HTML HTML
PLAIN Plain text (UTF8)
XLINE Plain text, one sentence per line
TMX Translation Memory eXchange
XLIFF XML Localization Interchange File Format
BCM Proprietary format
XML Extensible Markup Language
SDLXML Treats every closing XML tag in the input as the end of a segment. The XML format in contrast does not make this assumption.

Response JSON:

{
  "encoding": "utf8",
  "languages": [
    {
      "code": "eng",
      "name": "English",
      "languageTag": "en",
      "score": 0.99
    }
  ],
  "scripts": [
    {
      "code": "Latn",
      "name": "Latin",
      "percent": 80.6
    },
    {
      "code": "Zyyy",
      "name": "Common",
      "percent": 19.4
    }
  ]
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
encoding string Source content encoding
languages array Array of detected languages, sorted in descending order of their score
code string Detected language code. See Languages Table.
languageTag string Detected language tag
name string Detected language full name. See Languages Table.
score float A value between 0 and 1; the closer the value is to 1, the greater the association between the detected language and source content
scripts array Array of scripts that constitute the input text, sorted in descending order of the percentage of characters using that script.
code string ISO-15924 code of detected script. See Script Codes.
name string Name of detected script
percent float Percentage of source content using specific script
{
    "errors": [{
        "code": 41,
        "description": "Language detection failed"
    }]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When languages are successfully detected
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error
In This Page
Back to top