braille-codec 0.0.1-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +80 -0
- package/LICENSE +201 -0
- package/README.md +10 -0
- package/bin/braille-decode +66 -0
- package/dist/decoder/constants/char_english.d.ts +1 -0
- package/dist/decoder/constants/char_shortcut.d.ts +1 -0
- package/dist/decoder/constants/choseong.d.ts +1 -0
- package/dist/decoder/constants/index.d.ts +10 -0
- package/dist/decoder/constants/indicators.d.ts +6 -0
- package/dist/decoder/constants/jongseong.d.ts +1 -0
- package/dist/decoder/constants/jungsong.d.ts +1 -0
- package/dist/decoder/constants/number.d.ts +1 -0
- package/dist/decoder/constants/symbol.d.ts +1 -0
- package/dist/decoder/constants/utils.d.ts +3 -0
- package/dist/decoder/index.d.ts +51 -0
- package/dist/decoder/index.test.d.ts +1 -0
- package/dist/index.cjs +770 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.mjs +768 -0
- package/package.json +38 -0
- package/rollup.config.js +18 -0
- package/src/decoder/constants/char_english.ts +30 -0
- package/src/decoder/constants/char_shortcut.ts +33 -0
- package/src/decoder/constants/choseong.ts +18 -0
- package/src/decoder/constants/index.ts +110 -0
- package/src/decoder/constants/indicators.ts +8 -0
- package/src/decoder/constants/jongseong.ts +19 -0
- package/src/decoder/constants/jungsong.ts +25 -0
- package/src/decoder/constants/number.ts +14 -0
- package/src/decoder/constants/symbol.ts +34 -0
- package/src/decoder/constants/utils.ts +14 -0
- package/src/decoder/index.test.ts +77 -0
- package/src/decoder/index.ts +527 -0
- package/src/index.ts +3 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +8 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Braille Decoder
|
|
3
|
+
* Supports English, Special Characters, and Korean.
|
|
4
|
+
* Reference: braillify/libs/braillify/src
|
|
5
|
+
*/
|
|
6
|
+
declare class Decoder {
|
|
7
|
+
private jungseongMap;
|
|
8
|
+
private shortcutMap;
|
|
9
|
+
private symbolMap;
|
|
10
|
+
private readonly CHOSEONG;
|
|
11
|
+
private readonly JUNGSEONG;
|
|
12
|
+
private readonly JONGSEONG;
|
|
13
|
+
private choMap;
|
|
14
|
+
private jungMap;
|
|
15
|
+
private jongMap;
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Initialize lookup tables from constants for efficient decoding
|
|
19
|
+
*/
|
|
20
|
+
private initializeLookupTables;
|
|
21
|
+
/**
|
|
22
|
+
* Converts ASCII Braille (BRL) to Unicode Braille.
|
|
23
|
+
* Example: asciiBrailleToUnicode('abcd') -> '⠁⠃⠉⠙'
|
|
24
|
+
*/
|
|
25
|
+
asciiBrailleToUnicode(input: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Translates Unicode Braille to Text.
|
|
28
|
+
* Supports Korean, English, Numbers, and Symbols.
|
|
29
|
+
*/
|
|
30
|
+
translateToText(input: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Compose Korean syllable from jamo
|
|
33
|
+
*/
|
|
34
|
+
private composeKoreanSyllable;
|
|
35
|
+
/**
|
|
36
|
+
* Decompose Korean syllable to jamo
|
|
37
|
+
*/
|
|
38
|
+
private decomposeSyllable;
|
|
39
|
+
/**
|
|
40
|
+
* Add jongseong to existing syllable
|
|
41
|
+
*/
|
|
42
|
+
private addJongseongToSyllable;
|
|
43
|
+
/**
|
|
44
|
+
* Translates Unicode Braille to Text (single line).
|
|
45
|
+
* Supports Korean, English, Numbers, and Symbols.
|
|
46
|
+
*/
|
|
47
|
+
translateToTextOneLine(input: string): string;
|
|
48
|
+
private matchJungseong;
|
|
49
|
+
private matchShortcut;
|
|
50
|
+
private matchSymbol;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Decoder };
|