\Overtrue\PinyinMemoryFileDictLoader

Memory Dict File loader.

Summary

Methods
Properties
Constants
__construct()
map()
mapSurname()
No public properties found
No constants found
No protected methods found
$path
$segmentName
$segments
$surnames
N/A
No private methods found
No private properties found
N/A

Properties

$path

$path : string

Data directory.

Type

string

$segmentName

$segmentName : string

Words segment name.

Type

string

$segments

$segments : array

Segment files.

Type

array

$surnames

$surnames : array

Surname cache.

Type

array

Methods

__construct()

__construct(string  $path) 

Constructor.

Parameters

string $path

map()

map(\Closure  $callback) 

Load dict.

[
    '响应时间' => "[\t]xiǎng[\t]yìng[\t]shí[\t]jiān",
    '长篇连载' => '[\t]cháng[\t]piān[\t]lián[\t]zǎi',
    //...
]

Parameters

\Closure $callback

mapSurname()

mapSurname(\Closure  $callback) 

Load surname dict.

Parameters

\Closure $callback