\Horde_Core_Factory_LanguageDetect

A Horde_Injector:: based Text_LanguageDetect:: factory.

Copyright 2011-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
create()
getLanguageCode()
No public properties found
No constants found
_getDriverName()
$_injector
$_detect
$_langmap
N/A
No private methods found
No private properties found
N/A

Properties

$_injector

$_injector : \Horde_Injector

The injector.

Type

\Horde_Injector

$_detect

$_detect : \Text_LanguageDetect

A Text_LanguageDetect instance.

Type

\Text_LanguageDetect

$_langmap

$_langmap : array

Mapping of language -> ISO 639 language codes.

Language list accurate as of Text_LanguageDetect v0.2.3.

Type

array

Methods

__construct()

__construct(\Horde_Injector  $injector) 

Constructor.

Parameters

\Horde_Injector $injector

The injector to use.

create()

create() : \Text_LanguageDetect

Return a Text_LanguageDetect instance.

Throws

\Horde_Exception

Returns

\Text_LanguageDetect —

Detection object.

getLanguageCode()

getLanguageCode(string  $text) : string

Utility method to scan a string and return the appropriate langauge code of the detected language.

Parameters

string $text

Input text.

Returns

string —

The ISO 639 language code (or null if it could not be determined).

_getDriverName()

_getDriverName(string  $driver, string  $base) : string

Return the classname of the driver to load.

Parameters

string $driver

Driver name.

string $base

The base classname.

Throws

\Horde_Exception

Returns

string —

Classname.