miguelher

miguelher / LanguageDetector / 0.1.0

README.md

Table of Contents

Language Detector analyses a given text and detects the language it is written in. This algorithm takes an input string (the text to be analysed) and returns the language id and a confidence rank between 0 and 1 (the closer to 1 the higher the confidence).

Input:
  • (Required): text to be analysed.

Output:

  • result: lang id of detected language.
  • confidence: confidence degree of detection between 0 and 1 (the closer to 1 the higher the confidence).

Examples

Example 1


  • Parameter 1: English sentence.
"Small is beautiful for US equity market betting big on Trump - Russell 2000 hits record high, adding 10% since the election as S&P 500 lags behind
"

Output:

{"confidence": 1, "result": "en"}

Example 2


  • Parameter 2: Spanish sentence.
"Utilizamos las cookies para ayudar a personalizar contenido, adaptar y medir los anuncios, y facilitar una experiencia más segura"

Output:

{"confidence": 1, "result": "es"}


Detected Languages

Language Detector detects up to 65 languages (see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes for a list of ISO 639 language codes).