PHP code example of keevitaja / language-detector-socket
1. Go to this page and download the library: Download keevitaja/language-detector-socket library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
keevitaja / language-detector-socket example snippets
use Keevitaja\LanguageDetectorSocket\Server;
$server = new Server([
'socket' => '/tmp/language-detector.sock',
]);
$server->run();
[
// Unix socket path
'socket' => '/tmp/language.detector.sock',
// Number of worker processes
'processes' => 1,
// Connection timeout in seconds
'timeout' => 10,
// Limit detection to specific languages (null = all or ['en', 'nl'])
'locales' => null,
// Language model size (SMALL, MEDIUM, LARGE)
'eldDataFile' => EldDataFile::SMALL,
// Language code format (ISO639_1, ISO639_3)
'eldFormat' => EldFormat::ISO639_1,
// Path to store the worker process ID file
'workerPidFile' => '/tmp/language.detector.worker.pid',
// Path to store the worker log file
'workerLogFile' => '/tmp/language.detector.worker.log',
// Path to store the worker an stdout log file
'workerStdoutFile' => '/tmp/language.detector.worker.stdout.log',
// Whether to run the worker as a daemon process
'workerDemonize' => false,
]
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.