phonetisaurus
v0.0.1
Published
Grapheme to Phoneme on the Web powered by WebAssembly
Downloads
1
Readme
Phonetisaurus.js
Grapheme to Phoneme on the Web powered by WebAssembly.
import phonetisaurus from 'phonetisaurus'
// download the remote model file
const res = await fetch("https://example.com/model.fst")
const buffer = await res.arrayBuffer();
// write to a virtual file system
phonetisaurus.FS.writeFile("/model.fst", buffer)
// create phonemizer instance
const phonemizer = new phonetisaurus.Phonemizer("/model.fst", "")
const result = phonemizer.phoneticize("hello", 10, 500, 10, false, false, 0.0)
// => [[ 'h', 'ɛɛ', 'l', 'oo' ]]