0.0.2 • Published 10 years ago
unilities v0.0.2
_uni
Installation
npm install unilities
Creating a block
Instantiate a Unicode block
var _uni = require('./lib.js'); // 2688, start of Gujarati Unicode block // 128, length of Gujarati Unicode block var _gu = new _uni ( 2688, 128, 'Gujarati' );
Check if a character belongs to the block
_gu.isGujarati('ક');
Check if a character (by charcode) belongs to the block
_gu.isGujarati(2709);
Enlist the block
_gu.getGujaratiList();
Enlist the block as charcode
_gu.getGujaratiCodeList();
Adding subsets
Add a subset
Digit
by providing name and an array that represents a subset._gu.addSubset('Digit', [2790,2791,2792,2793,2794,2795,2796,2797,2798,2799]); // or _gu.addSubset('Digit', _gu.charcodes(2790,2799));
Here.
_gu.charcodes()
just returns a range of integers as array;With
Digit
subset added, following enlisting and querying is possible, automatically._gu.getDigitCodeList(); _gu.getDigitList(); _gu.isDigit('૯');
Thanks
- Konarak Ratnakar