https://github.com/chaklim/jyutping-table-parser
just a JPTableFull.pdf parser
https://github.com/chaklim/jyutping-table-parser
jptablefull jyutping parser
Last synced: 4 months ago
JSON representation
just a JPTableFull.pdf parser
- Host: GitHub
- URL: https://github.com/chaklim/jyutping-table-parser
- Owner: chaklim
- License: mit
- Created: 2018-05-05T09:35:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T05:00:52.000Z (over 2 years ago)
- Last Synced: 2025-04-09T14:11:16.515Z (10 months ago)
- Topics: jptablefull, jyutping, parser
- Language: JavaScript
- Size: 471 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jyutping Table Parser
[](https://travis-ci.org/chaklim/jyutping-table-parser)
just a JPTableFull.pdf parser
[JPTableFull PDF Download](http://www.iso10646hk.net/download/jp/doc/JPTableFull.pdf)
## Installation
`npm install jyutping-table-parser`
## Usage
const jyutpingTableParser = require('jyutping-table-parser');
const characters = jyutpingTableParser.parseJyutpingInput();
Output (characters) should be
[
{
type: TYPE,
rg: RG,
rad: RAD,
ucs2: UCS2,
ch: CH,
infoArray: [
{
jyutping: JYUTPING,
en: EN,
pn: PN,
cl: CL,
sc: SC,
ref: [
{
ucs2: UCS2,
ch: CH,
},
...
]
},
...
]
},
...
]
---
## Output Value Description
#### TYPE - Character Type.
- (Optional) Array of string with possible values
'<', '#', '>', 'S', '$', '*', '**', '***', '****'
#### RG
- Number with possible values 1, 2 or 3.
#### RAD - Radical.
- (Optional) Boolean, true if the character is radical
#### UCS2 - UCS-2 encoding value.
- String. Range between '3400' - 'F7EE'
#### CH - The character.
- String. Unicode re-mapped to HKSCS_2016 one.
#### JYUTPING - Jyutping values
- (Optional) Array of String each contains a jyutping value.
#### EN
- (Optional) String with possible values 's', 't'
#### PN - Phonetic.
- Number starts with 1.
#### CL
- (Optional) Boolean.
#### SC
- (Optional) String with value '1.x' or '2'
For more detailed value description, please reference the original PDF section 5.
---
## Output Example
{
"type": [
">"
],
"rg": 1,
"ucs2": "9673",
"ch": "陳",
"infoArray": [
{
"jyutping": [
"can4"
],
"en": "t",
"pn": 1
},
{
"jyutping": [
"can2"
],
"en": "t",
"pn": 2,
"cl": true,
"sc": "2"
},
{
"jyutping": [
"zan6"
],
"en": "t",
"pn": 3
}
]
}
## Tests
`npm test` or `yarn test`
## Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.