You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo LanguageDetector::detect(
'My tailor is rich and Alison is in the kitchen with Bob.',
['en', 'de', 'fr', 'es']
);
PHP Fatal error: Uncaught Error: Call to a member function getLanguages() on null in PATH/LanguageDetector/LanguageDetector.php:104
Stack trace:
#0 PATH(31): LanguageDetector\LanguageDetector::detect('My tailor is ri...', Array)
publicstaticfunctiondetect($text, array$languages = []): self
{
// All specified models have been loaded$diff = count($languages)
? array_diff(
self::$detector->getLanguages(),
$languages
)
: [];
if (is_null(self::$detector) || count($diff)) {
self::$detector = newself(null, $languages);
}
returnself::$detector->evaluate($text);
}
Error on line self::$detector->getLanguages(),
Maybe before need to add:
if (is_null(self::$detector)) {
self::$detector = newself(null, $languages);
}
The text was updated successfully, but these errors were encountered:
Code from README.md
Error on line
self::$detector->getLanguages(),
Maybe before need to add:
The text was updated successfully, but these errors were encountered: