PHP Class Overtrue\Pinyin\MemoryFileDictLoader

Inheritance: implements Overtrue\Pinyin\DictLoaderInterface
Show file Open project: overtrue/pinyin

Protected Properties

Property Type Description
$path string Data directory.
$segmentName string Words segment name.
$segments array Segment files.
$surnames array Surname cache.

Public Methods

Method Description
__construct ( string $path ) Constructor.
map ( Closure $callback ) Load dict.
mapSurname ( Closure $callback ) Load surname dict.

Method Details

__construct() public method

Constructor.
public __construct ( string $path )
$path string

map() public method

Load dict.
public map ( Closure $callback )
$callback Closure

mapSurname() public method

Load surname dict.
public mapSurname ( Closure $callback )
$callback Closure

Property Details

$path protected property

Data directory.
protected string $path
return string

$segmentName protected property

Words segment name.
protected string $segmentName
return string

$segments protected property

Segment files.
protected array $segments
return array

$surnames protected property

Surname cache.
protected array $surnames
return array