go-mm-nrc-converter

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

Go-mm-nrc-Converter

Go Report Card Build Status GitHub issues GitHub forks GitHub stars GitHub license

Go-mm-nrc-converter is a Burmese National Registration Card(NRC) tool written in Golang. Inspired by NRC-Prefixer and Burther for android.

	nrcConverter := converter.NewNRCConverter()
	nrcConverter.ConvertToEnglishFormat("၁၂/မစသ(သ)၀၈၇၆၄၅"))
	nrcConverter.ConvertToBurmeseFormat("12/MaCaSa(M)087645")

//Output: 12/MaCaSa(M)087645
//Output: ၁၂/မစသ(သ)၀၈၇၆၄၅

go-mm-nrc-converter supports all NRC types with the following pattern

Burmese English
နိုင်ငံသား (နိုင်) Citizen (C)
ဧည့်နိုင်ငံသား (ဧည့်) Associate Citizen (AC)
နိုင်ငံသားပြုခွင့်ရသူ (ပြု) Naturalized Citizen (NC)
နိုင်ငံသားပြုစီစစ်ခံရမည့်သူ (စ) National Verification (V)
သာသနာဝင် (သ) Monk (M)
သာသနာနွယ်ဝင် (သီ) Nun (N)

Getting Started

Add Dependency
go get github.com/ezysign/go-mm-nrc-converter/converter

Features

Validation

go-mm-nrc-converter provide a validation of NRCNumbers in both English & Burmese.

package main

import (
	"fmt"
	"github.com/ezysign/go-mm-nrc-converter/converter"
)

func  main() {
	nrcConverter := converter.NewNRCConverter()
	nrcConverter.ValidateEnglishNRC("12/MaGaTa(နိုင်)198475"))
	nrcConverter.ValidateBurmeseNRC("၁၂/မစလ(နိုင်)၀၈၇၆၄၅"))
}
//Output: false
//Output: true
Conversion

go-mm-nrc-converter provide a conversion of NRCNumbers in both English & Burmese.

package main

import (
	"fmt"
	"github.com/ezysign/go-mm-nrc-converter/converter"
)

func  main() {
	nrcConverter := converter.NewNRCConverter()
	nrcConverter.ConvertToEnglishFormat("၁၂/မစသ(သ)၀၈၇၆၄၅"))
	nrcConverter.ConvertToBurmeseFormat("12/MaCaSa(M)087645")
}
//Output: 12/MaCaSa(M)087645
//Output: ၁၂/မစသ(သ)၀၈၇၆၄၅
Playground

https://play.golang.org/p/DxK_WotOrUy

Contributing

  1. Fork it (https://github.com/ezysign/go-mm-nrc-converter)
  1. Create your feature branch (git checkout -b my-new-feature)
  1. Commit your changes (git commit -am 'Add some feature')
  1. Push to the branch (git push origin my-new-feature)
  1. Create a new Pull Request

License

Copyright 2020 EzySign

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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