Data::Kanji::KanjiVG - parse KanjiVG kanji data.
parse ( file_name => $file_name, callback => $callback, callback_data => $callback_data, );
Parse the file specified by $file_name. As a complete piece of kanji data is achieved, call $callback in the following form:
$file_name
$callback
&{$callback} ($callback_data, $kanji);
Possible arguments are
Give the name of the file to parse.
Give a function to call back each time a complete piece of kanji information is parsed.
An optional piece of data to pass to the callback function.
A boolean. If it is false (or if it is omitted), the kanji information is sent as a complete hash reference. If it is true, the kanji information is sent as an array reference containing the paths.
If the data is not flattened using flatten, $kanji is a hash reference containing the following fields:
flatten
$kanji
The identification number of the kanji.
A group of strokes of the kanji. This contains the following sub-fields:
An array reference to strokes or groups of strokes. Each element contains its type and attributes.
Each path is a single stroke of the kanji. This hash reference contains the following sub-fields:
The stroke's identification number.
The type of the stroke, a field describing the general shape of the stroke.
The SVG path information. This information is a string. To parse it, the module Image::SVG::Path may be useful.
To install Data::Kanji::KanjiVG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Kanji::KanjiVG
CPAN shell
perl -MCPAN -e shell install Data::Kanji::KanjiVG
For more information on module installation, please visit the detailed CPAN module installation guide.