\Overtrue\PinyinGeneratorFileDictLoader

Summary

Methods
Properties
Constants
__construct()
map()
mapSurname()
No public properties found
No constants found
openFile()
getGenerator()
traversing()
$path
$segmentName
$handles
$surnamesHandle
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

$handles

$handles : array

SplFileObjects.

Type

array

$surnamesHandle

$surnamesHandle : \SplFileObject

surnames.

Type

\SplFileObject —

Methods

__construct()

__construct(string  $path) : mixed

Constructor.

Parameters

string $path

Returns

mixed —

map()

map(\Closure  $callback) : mixed

Load dict.

Parameters

\Closure $callback

Returns

mixed —

mapSurname()

mapSurname(\Closure  $callback) : mixed

Load surname dict.

Parameters

\Closure $callback

Returns

mixed —

openFile()

openFile(string  $filename, string  $mode = 'r') : \SplFileObject

Construct a new file object.

Parameters

string $filename

file path

string $mode

file open mode

Returns

\SplFileObject —

getGenerator()

getGenerator(array  $handles) : \Generator

get Generator syntax.

Parameters

array $handles

SplFileObjects

Returns

\Generator —

traversing()

traversing(\Generator  $generator, \Closure  $callback) : mixed

Traverse the stream.

Parameters

\Generator $generator
\Closure $callback

Returns

mixed —