Coder Social home page Coder Social logo

go-avro-phonetic's Introduction

go-avro-phonetic

Go port of the popular Bengali phonetic-typing software Avro Phonetic. website

Overview

go-avro-phonetic provides a go package which includes a text parser that converts Bangla written in Roman script to its phonetic equivalent in Bangla. It implements the Avro Phonetic Dictionary Search Library by Mehdi Hasan Khan.

In addition this library provides a cli to parse text file or text via console.

Inspirations

This package is inspired from Rifat Nabi's jsAvroPhonetic. So far, the code is a go port of jsAvroPhonetic.

And acknowledges Kaustav Das Modak for pyAvroPhonetic.

Installation

$ go get -u -v github.com/sadlil/go-avro-phonetic/...

Usage

Import the library as

import (
    avro "github.com/sadlil/go-avro-phonetic"
)

With Built in Rules:

// Parse() tries to parse the given string
// In case of failure it returns an erros
text, err := avro.Parse("ami banglay gan gai")
if err != nil {
    // Handle error
}

fmt.Println(test) // আমি বাংলায় গান গাই


// MustParse() tries to parse the given string
// In case of failure it panics
text := avro.MustParse("ami banglay gan gai")
fmt.Println(text) // আমি বাংলায় গান গাই

With Custom Rules: avro.ParseWith() receives an plugable Dictionary interface{} to support custom parsing.

data.LoadJSON() provides support for overloading custom dictionary from JSON, which can be used for custom parsing.

customDictonary := []byte("custom dictonary json")

dict, err := data.LoadJSON(customDictonary)
if err == nil {
    text := avro.ParseWith(dict, "ami banglay gan gai")
    fmt.Println(text) // custom parsed text
}

CLI

Avro command line interface to parse data using command line.

Install

$ go get -u -v github.com/sadlil/go-avro-phonetic/avrocli
$ go install github.com/sadlil/go-avro-phonetic/avrocli

Usages

Parse a test:

$ avrocli parse ami banglay gan gai
আমি বাংলায় গান গাই  # this could need font support for cli.

Parse a file:

$ avrocli parse -f my_bangla.txt # this will create a my_bangla.bn.txt file
                                 # in the same directory as the given file
                                 # with parsed bangla texts.

Acknowledgements

  • Mehdi Hasan Khan for originally developing and maintaining Avro Phonetic,
  • Rifat Nabi for porting it to Javascript,
  • Sarim Khan for writing ibus-avro.

License

Licensed under MIT Licence.

go-avro-phonetic's People

Contributors

rafatbiin avatar sadlil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-avro-phonetic's Issues

Can I go backword

Given text in bangla "আমি বাংলায় গান গাই" Is it possible to ouput "ami banglay gan gai"

-Thanks

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.