An experimental tool to transcribe Udmurt into Japanese katakana. May be useful if you have a Japanese voice model at hand and want to make it speak in Udmurt. Designed to be compiled to WebAssembly for use in the Web.
Currently, supports basic transcribing with devoicing and lengthening the last syllable.
Warning
This tool does not aim to provide an accurate transcription for Udmurt learners. Be careful if you try to use this for creating teaching material.
To build the WebAssembly module, use the following command:
cargo build --release --target=wasm32-unknown-unknown --libTo test the resulting WASM at once, you can execute the run.js script in
Node.js or a compatible environment. Pass the Udmurt text to transcribe as the
arguments.
$ node run.js Шунды сиос ӝуато палэзез
シュンドゥー シオース ジュアトー パレジェースThe WebAssembly module provides the following interface. The memory management is fully manual. The user is the “owner” of all the dynamically allocated memory passed in and out and should free it using free (see below).
-
init
Initializes the module. Should be called first prior to any processing.
-
process(input: i32, input_len: u32, output: i32) -> u32
Converts the provided Udmurt text (written in Cyrillic) into Japanese katakana.
Arguments:
- input: pointer to the input text encoded in UTF-8.
- input_len: length of the input text in bytes.
- output: the place where the memory address of the output text will be written. The user needs to allocate a 32-bit number beforehand using malloc (see below).
Return value: the length of the resulting text.
-
malloc(len: u32) -> i32
Allocates len bytes an returns a pointer to the allocated memory inside the WebAssembly memory buffer.
-
free(ptr: i32, len: u32)
Frees the previously allocated memory space beginning at ptr and having the size of len bytes.