gomanize

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 3 Imported by: 0

README

Gomanize

CI

A Go library and CLI tool for transliterating Devanagari script (Hindi) to Latin/Roman characters. Designed for practical use cases like song lyrics romanization.

Features

  • Romanize Hindi text from Devanagari script into readable Latin characters
  • CLI tool for quick transliteration
  • Library API for integration into Go projects
  • Follows colloquial/phonetic Hindi romanization (not scholarly IAST)

Installation

# As a library
go get github.com/budhash/gomanize

# Build CLI from source
git clone https://github.com/budhash/gomanize
cd gomanize
make build

Usage

CLI
# Direct argument
./gomanize "नमस्ते भारत"
# Output: namste bharat

# Pipe input
echo "हिंदी गाना" | ./gomanize
# Output: hindi gana

# Version
./gomanize --version
Library
package main

import (
    "fmt"
    gomanize "github.com/budhash/gomanize"
)

func main() {
    g, err := gomanize.New("hindi")
    if err != nil {
        panic(err)
    }

    output := g.Translit("नमस्ते दुनिया")
    fmt.Println(output)  // "namste duniya"
}

Development

# First-time setup
make init

# Development workflow
make dev      # Format, vet, test
make ci       # Full CI pipeline

# Testing
make test           # Run all tests
make test-unit      # Unit tests only (fast)
make test-cover     # Tests with coverage
make test-dakshina  # Dakshina accuracy tests

# See all commands
make help

Transliteration Standards

This project follows colloquial/phonetic Hindi romanization:

  • Aggressive schwa deletion to match spoken Hindi
  • No diacritics (aa not ā, i not ī)
  • Phonetic spelling (kh not ḵẖ)
References

Current Status

Dataset Accuracy
Original (hindi-common.txt) 56.9%
Dakshina (native Hindi) 48.8%
Target 80%+

See Claude.md for detailed failure analysis and roadmap.

License

MIT License - Copyright (c) 2023-2025 Budhaditya

Author

Budhaditya (budhash@gmail.com)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gomanize

type Gomanize struct {
	// contains filtered or unexported fields
}

func New

func New(language string) (*Gomanize, error)

func (Gomanize) Test

func (g Gomanize) Test()

func (Gomanize) Translit

func (g Gomanize) Translit(sentence string) string

type Romanizer

type Romanizer interface {
	Name() string
	Transliterate(word string) string
	Info()
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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