Detects language of given text. Returns detected language codes and scores.
- Create an account at loque.la http://loque.la/signup/ And get your api key
- Copy loquela.php on your web server
- require the file require_once("/path/to/file/loquela.php");
$l = new Loquela( 'YOUR-API-KEY' );
$result = $l->Detect( 'Hello world' );
$l = new Loquela( 'YOUR-API-KEY' );
$result = $l->Detect( array( 'If we have no peace, it is because we have forgotten that we belong to each other.',
'Be faithful in small things because it is in them that your strength lies.' );
$l = new Loquela( 'YOUR-API-KEY' );
$result = $l->Status();
(object) {
->data (object) {
->detections (array(1)) {
['0'] (array(1)) {
['0'] (object) {
->language (string) = "en"
->confidence (double) = 1
}
}
}
}
}
(object) {
->requests (string) = "140"
->bytes (string) = "18443"
}
(object) {
->data (object) {
->detections (array(1)) {
['0'] (object) {
->error (object) {
->code (integer) = 3
->message (string) = "Daily limit reached."
}
}
}
}
}
This is free software, and may be redistributed as you please as long as you include this readme file.