File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 11// https://www.kreativekorp.com/ucsur/charts/sitelen.html
22
3+ import { WORD_UNIT_RULES } from "./filter.ts" ;
4+
35export const START_OF_CARTOUCHE = "\u{F1990}" ;
46export const END_OF_CARTOUCHE = "\u{F1991}" ;
57export const COMBINING_CARTOUCHE_EXTENSION = "\u{F1992}" ;
@@ -180,11 +182,14 @@ export const KU_LILI = [
180182 "majuna" ,
181183 "powe" ,
182184] ;
183- export const UCSUR_TO_LATIN : Map < string , string > = new Map ( [
184- ...[ ...PU , ...KU_SULI ]
185- . map ( ( latin , i ) => [ String . fromCodePoint ( 0xF1900 + i ) , latin ] as const ) ,
186- ...KU_LILI
187- . map ( ( latin , i ) => [ String . fromCodePoint ( 0xF19A0 + i ) , latin ] as const ) ,
188- ] ) ;
185+ export const UCSUR_TO_LATIN : Map < string , string > = new Map (
186+ [
187+ { start : 0xF1900 , words : [ ...PU , ...KU_SULI ] } as const ,
188+ { start : 0xF19A0 , words : KU_LILI } as const ,
189+ ]
190+ . flatMap ( ( { start, words } ) =>
191+ words . map ( ( latin , i ) => [ String . fromCodePoint ( start + i ) , latin ] as const )
192+ ) ,
193+ ) ;
189194export const UCSUR_CHARACTER_REGEX =
190195 / [ \u{F1900} - \u{F1988} \u{F19A0} - \u{F19A3} ] / u;
You can’t perform that action at this time.
0 commit comments