0.0.1 • Published 7 months ago

phonetisaurus v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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' ]]

Reference

0.0.1

7 months ago