Skip to content

Instantly share code, notes, and snippets.

@mdebbar
Created November 4, 2022 20:34
Show Gist options
  • Select an option

  • Save mdebbar/aa7a7c6e32bee5d345ea709593cd638e to your computer and use it in GitHub Desktop.

Select an option

Save mdebbar/aa7a7c6e32bee5d345ea709593cd638e to your computer and use it in GitHub Desktop.
JS API to be used with ICU4X
function getLineBreaks(text) {
// Returns a list of indices of line breaks in the
// text along with the type of each break (soft or hard).
}
function getBidiRegions(text) {
// Returns a list of BiDi regions, where each region contains:
// 1. A range (start and end).
// 2. BiDi level.
}
function getGraphemes(text) {
// Returns a list of indices representing the end of each grapheme.
}
function getWords(text) {
// Returns a list of indices representing the end of each word.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment