goruut

module
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2025 License: MIT

README

Goruut

A tokenizer, text cleaner, and IPA phonemizer/dephonemizer/transphonemizer for several human languages.

Try it online

It is possible to try this software live at hashtron.cloud or at hugging face.

Features

  • Phone set: IPA
  • Supported languages: 139
  • Processing speed: fast
  • Phone tokens: yes
  • Syllable tokens: no
  • Word tokens: yes
  • Punctuation preservation: yes
  • Stressed phones: yes
  • Tonal phones: yes, 5 tones (˥ ˦ ˧ ˨ ˩)
  • Tie: no

Installation

go install github.com/neurlang/goruut/cmd/goruut@latest

Docker Compose installation

Clone the repo and then run in root directory this command:

sudo docker compose up -d --force-recreate --build

Supported Languages

  • Afrikaans
  • Albanian
  • Amharic
  • Arabic
  • Aragonese
  • Armenian
  • Assamese
  • Azerbaijani
  • Bashkir
  • Basque
  • Belarusian
  • Bengali
  • Bengali Dhaka
  • Bengali Rahr
  • Bishnupriya Manipuri
  • Bosnian
  • Bulgarian
  • Burmese
  • Cantonese
  • Catalan
  • Cebuano
  • Chechen
  • Cherokee
  • Chichewa
  • Chinese Mandarin
  • Chuvash
  • Croatian
  • Czech
  • Danish
  • Dutch
  • Dzongkha
  • English
  • English American
  • English British
  • Esperanto
  • Estonian
  • Farsi
  • Finnish
  • French
  • Gaelic Irish
  • Gaelic Scottish
  • Galician
  • Georgian
  • German
  • Greek
  • Greenlandic
  • Guarani
  • Gujarati
  • Haitian Creole
  • Hausa
  • Hawaiian
  • Hebrew
  • Hindi
  • Hungarian
  • Icelandic
  • Ido
  • Indonesian
  • Interlingua
  • Isan
  • Italian
  • Jamaican
  • Japanese
  • Javanese
  • Kannada
  • Kazakh
  • Khmer Central
  • Kiche
  • Konkani
  • Korean
  • Kurdish
  • Kyrgyz
  • Lang Belta
  • Lao
  • Latgalian
  • Latin Classical
  • Latin Ecclesiastical
  • Latvian
  • Lingua Franca Nova
  • Lithuanian
  • Lojban
  • Lule Saami
  • Luxembourgish
  • Macedonian
  • Malayalam
  • Malay Arab
  • Malay Latin
  • Maltese
  • Maori
  • Marathi
  • Minnan Hokkien
  • Minnan Taiwanese
  • Mongolian
  • Nahuatl Central
  • Nahuatl Classical
  • Nahuatl Mecayapan
  • Nahuatl Tetelcingo
  • Nepali
  • Nogai
  • Norwegian
  • Oromo
  • Papiamento
  • Pashto
  • Polish
  • Portuguese
  • Punjabi
  • Quechua
  • Quenya
  • Romanian
  • Russian
  • Serbian
  • Setswana
  • Shan Tai Yai
  • Sindarin
  • Sindhi
  • Sinhala
  • Slovak
  • Slovenian
  • Spanish
  • Swahili
  • Swedish
  • Tagalog
  • Tamil
  • Tatar
  • Telugu
  • Thai
  • Tibetan
  • Turkish
  • Turkmen
  • Ukrainian
  • Urdu
  • Uyghur
  • Uzbek
  • Vietnamese Central
  • Vietnamese Northern
  • Vietnamese Southern
  • Welsh North
  • Welsh South
  • Yoruba
  • Zulu

The goal to support all of voice2json's languages has been met. However, please add a language if you have the necessary data.

Listening to the generated speech

There are currently 3 target languages (IPA flavors). They are:

  • IPA - Copy the output into ipa-reader.xyz and pick a correct language voice
  • Espeak - Copy the output into espeak. For example czech: espeak -v cs "[[ru:Zovi: ku:n^]]"
  • Antvaset - Copy the output into antvaset.com and pick a correct language voice

Dependencies

See go.mod file for an up-to-date list of depended-on projects. Minimum supported version of golang is go 1.19 (project uses type parameters).

Numbers, Dates, and More

Unsupported. Please write them using words.

Command-Line Usage

To start, launch the server using the example config (in configs dir):

./goruut -configfile configs/config.json

This will launch the server at a specific http port. You should see the port which you specified in the config file:

INFO[0000] Binding port: 18080

Then you can run queries:

POST http://127.0.0.1:18080/tts/phonemize/sentence

{
	"Language": "Czech",
	"Sentence": "jsem supr"	
}

Output should be:

{
	"Words": [
		{
			"Linguistic": "jsem",
			"Phonetic": "jsɛm"
		},
		{
			"Linguistic": "supr",
			"Phonetic": "supr"
		}
	]
}

Intended Audience

goruut is useful for transforming raw text into phonetic pronunciations, similar to phonemizer. Unlike phonemizer, goruut looks up words in a pre-built lexicon (pronunciation dictionary) or guesses word pronunciations with a pre-trained transformer-based grapheme-to-phoneme model.

Discord Invite

https://discord.gg/HWZ47pCBaH

Directories

Path Synopsis
Package app manages application lifecycle, configuration, and shared dependencies.
Package app manages application lifecycle, configuration, and shared dependencies.
cmd
analysis2 command
Package analysis2 provides CLI tools for phonetic analysis and batch processing.
Package analysis2 provides CLI tools for phonetic analysis and batch processing.
backtest command
Package backtest implements benchmarking for phonemization quality on the entire lexicon.
Package backtest implements benchmarking for phonemization quality on the entire lexicon.
dicttomap command
Package dicttomap converts algned dictionary files into language.json phonetic mappings.
Package dicttomap converts algned dictionary files into language.json phonetic mappings.
goruut command
Main is the main production package for the application executable
Main is the main production package for the application executable
homotest command
phondephontest command
Package backtest implements benchmarking for phonemization on unlabelled data.
Package backtest implements benchmarking for phonemization on unlabelled data.
solver1 command
Package controllers handles HTTP request routing and API layer logic.
Package controllers handles HTTP request routing and API layer logic.
v0
Package v0 implements version 0 of the public-facing REST API.
Package v0 implements version 0 of the public-facing REST API.
Package dicts provides multilingual language data for phonemization.
Package dicts provides multilingual language data for phonemization.
ido
lao
Package helpers contains common utilities (JSON, logging, etc.) for internal use.
Package helpers contains common utilities (JSON, logging, etc.) for internal use.
log
Package log provides structured logging/error handling by logging support.
Package log provides structured logging/error handling by logging support.
Package lib implements G2P (grapheme-to-phoneme) IPA phonemizer/dephonemizer for 136+ human languages, including validation and normalization.
Package lib implements G2P (grapheme-to-phoneme) IPA phonemizer/dephonemizer for 136+ human languages, including validation and normalization.
Package loader implements an external language model loader based on zip files
Package loader implements an external language model loader based on zip files
Package models defines shared data structures and DTOs.
Package models defines shared data structures and DTOs.
requests
Package requests contains API request payload models.
Package requests contains API request payload models.
responses
Package responses contains API response payload models.
Package responses contains API response payload models.
Package repo manages phonemization/dephonemization backend for the system.
Package repo manages phonemization/dephonemization backend for the system.
interfaces
Package interfaces defines repository contracts
Package interfaces defines repository contracts
services
Package services encapsulates business logic and domain operations.
Package services encapsulates business logic and domain operations.
Package usecases orchestrates business workflows between controllers and services.
Package usecases orchestrates business workflows between controllers and services.
Package views renders frontend interfaces (HTML, templates, or static assets).
Package views renders frontend interfaces (HTML, templates, or static assets).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL