Git Product home page Git Product logo

phonetisaurus-js's Introduction

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

Examples


Building

We are using Emscripten to compile to WebAssembly. Here is the version info:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.33 (c1927f22708aa9a26a5956bab61de083e8d3e463)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To compile the project, run

cd build/

./build.sh

This will output two files such as

  • phonetisaurus.mjs
  • phonetisaurus.wasm

Reference

phonetisaurus-js's People

Contributors

seanghay avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.