odphone

package module
v0.0.0-...-369e3b0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

README

ODphone (WIP)

ODphone is a phonetic algorithm for indexing Odia words by their pronunciation, like Metaphone for English. The algorithm generates three Romanized phonetic keys (hashes) of varying phonetic affinities for a given Odia word. This package implements the algorithm in Go.

The algorithm takes into account the context sensitivity of sounds, syntactic and phonetic gemination, compounding, modifiers, and other known exceptions to produce Romanized phonetic hashes of increasing phonetic affinity that are very faithful to the pronunciation of the original Odia word.

  • key0 = a broad phonetic hash comparable to a Metaphone key that doesn't account for hard sounds and phonetic modifiers
  • key1 = is a slightly more inclusive hash that accounts for hard sounds.
  • key2 = highly inclusive and narrow hash that accounts for hard sounds and phonetic modifiers.
Examples
Word Pronunciation key0 key1 key2
ଭ୍ରମର vramara VRMR V2RMR V2RMR
ଭ୍ରମରେ vramarè VRMR V2RMR3 V2RMR3
ଭ୍ରମଣ vramańa VRMN V2RMN V2RMN
Go implementation

Install the package: go get -u github.com/odictly/odphone

package main

import (
	"fmt"

	"github.com/odictly/odphone"
)

func main() {
	od := odphone.New()
	fmt.Println(od.Encode("ଭ୍ରମର"))
	fmt.Println(od.Encode("ଭ୍ରମରେ"))
	fmt.Println(od.Encode("ଭ୍ରମଣ"))
}

License: GPLv3

Documentation

Overview

Package odphone (Odia Phone) is a phonetic algorithm for indexing unicode Odia words by their pronounciation, like Metaphone for English. The algorithm generates three Romanized phonetic keys (hashes) of varying phonetic proximity for a given Odia word.

The algorithm takes into account the context sensitivity of sounds, syntactic and phonetic gemination, compounding, modifiers, and other known exceptions to produce Romanized phonetic hashes of increasing phonetic affinity that are faithful to the pronunciation of the original Odia word.

`key0` = a broad phonetic hash comparable to a Metaphone key that doesn't account for hard sounds or phonetic modifiers

`key1` = is a slightly more inclusive hash that accounts for hard sounds

`key2` = highly inclusive and narrow hash that accounts for hard sounds and phonetic modifiers

odphone was created to aid spelling tolerant Odia word search, but may be useful in tasks like spell checking, word suggestion etc.

This is based on MLphone (https://github.com/knadh/mlphone/) for Malayalam.

Soumendra Kumar Sahoo (c) 2022. https://www.soumendrak.com | License: GPLv3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ODphone

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

ODphone is the Odia-phone tokenizer.

func New

func New() *ODphone

New returns a new instance of the ODphone tokenizer.

func (*ODphone) Encode

func (od *ODphone) Encode(input string) (string, string, string)

Encode encodes a unicode Odia string to its Roman ODphone hash. Ideally, words should be encoded one at a time, and not as phrases or sentences.

Jump to

Keyboard shortcuts

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