protocol

language_detector_protocol

Language detection protocol.

Availability:
logtalk_load(language_detection(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-09-08
Compilation flags:
static
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

detect/2

Detects the most likely language and returns its ISO 639-1 code.

Compilation flags:
static
Template:
detect(Text,Language)
Mode and number of proofs:
detect(+text,-atom) - zero_or_one_or_error
Exceptions:
The Representation parameter is a variable:
instantiation_error
The Representation parameter neither a variable nor atom, chars, or codes:
domain_error(text_representation,Representation)
The Strategy parameter is a variable:
instantiation_error
The Strategy parameter neither a variable nor an object identifier:
type_error(object_identifier,Strategy)
The Strategy parameter is an object identifier but not an object conforming to language_detection_strategy_protocol:
domain_error(language_detection_strategy_protocol,Strategy)

detect/3

Detects the most likely language and returns its ISO 639-1 code and relative detection score.

Compilation flags:
static
Template:
detect(Text,Language,Score)
Mode and number of proofs:
detect(+text,-atom,-float) - zero_or_one_or_error
Exceptions:
The Representation parameter is a variable:
instantiation_error
The Representation parameter neither a variable nor atom, chars, or codes:
domain_error(text_representation,Representation)
The Strategy parameter is a variable:
instantiation_error
The Strategy parameter neither a variable nor an object identifier:
type_error(object_identifier,Strategy)
The Strategy parameter is an object identifier but not an object conforming to language_detection_strategy_protocol:
domain_error(language_detection_strategy_protocol,Strategy)

detect/4

Detects the most likely language using the given options and returns its ISO 639-1 code and relative detection score.

Compilation flags:
static
Template:
detect(Text,Language,Score,Options)
Mode and number of proofs:
detect(+text,-atom,-float,+list(compound)) - zero_or_one_or_error
Exceptions:
The Representation parameter is a variable:
instantiation_error
The Representation parameter neither a variable nor atom, chars, or codes:
domain_error(text_representation,Representation)
The Strategy parameter is a variable:
instantiation_error
The Strategy parameter neither a variable nor an object identifier:
type_error(object_identifier,Strategy)
The Strategy parameter is an object identifier but not an object conforming to language_detection_strategy_protocol:
domain_error(language_detection_strategy_protocol,Strategy)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
An element Option of the list Options is neither a variable nor a compound term:
type_error(compound,Option)
An element Option of the list Options is a compound term but not a valid option:
domain_error(option,Option)

detect_all/2

Returns candidate languages ranked by descending relative detection score or an empty list when there is insufficient evidence.

Compilation flags:
static
Template:
detect_all(Text,ScoredLanguages)
Mode and number of proofs:
detect_all(+text,-list(pair(atom,float))) - one_or_error
Exceptions:
The Representation parameter is a variable:
instantiation_error
The Representation parameter neither a variable nor atom, chars, or codes:
domain_error(text_representation,Representation)
The Strategy parameter is a variable:
instantiation_error
The Strategy parameter neither a variable nor an object identifier:
type_error(object_identifier,Strategy)
The Strategy parameter is an object identifier but not an object conforming to language_detection_strategy_protocol:
domain_error(language_detection_strategy_protocol,Strategy)

detect_all/3

Returns candidate languages ranked by descending relative detection score using the given options or an empty list when there is insufficient evidence.

Compilation flags:
static
Template:
detect_all(Text,ScoredLanguages,Options)
Mode and number of proofs:
detect_all(+text,-list(pair(atom,float)),+list(compound)) - one_or_error
Exceptions:
The Representation parameter is a variable:
instantiation_error
The Representation parameter neither a variable nor atom, chars, or codes:
domain_error(text_representation,Representation)
The Strategy parameter is a variable:
instantiation_error
The Strategy parameter neither a variable nor an object identifier:
type_error(object_identifier,Strategy)
The Strategy parameter is an object identifier but not an object conforming to language_detection_strategy_protocol:
domain_error(language_detection_strategy_protocol,Strategy)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
An element Option of the list Options is neither a variable nor a compound term:
type_error(compound,Option)
An element Option of the list Options is a compound term but not a valid option:
domain_error(option,Option)

Protected predicates

(none)

Private predicates

(none)

Operators

(none)