This plugin is a wrapper for the whatlanggo natural language detection library.
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-language-detection
yum install halon-extras-language-detection
These functions needs to be imported from the extras://language-detection module path.
Detect the language of a string.
Params
- text
string- The text
Returns
The language as a string. On error an exception will be thrown.
Example
import { detect_language } from "extras://language-detection";
echo detect_language("This is a text in English"); // "English"