translit

package module
v0.0.0-...-5528f11 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2011 License: MIT Imports: 2 Imported by: 0

README

PACKAGE

package translit

Package translit implements non-standard one-way string transliteration from Cyrillic to Latin.


VARIABLES

// Mapping of Russian Cyrillic characters to ASCII Latin.
var RussianASCII map[int]string

// Mapping of Cyrillic characters to (Czech/Serbian) Latin.
var CyrillicLatin map[int]string


FUNCTIONS

func ToLatin(s string, table map[int]string) string

ToLatin returns a string transliterated using provided mapping table.
Runes that cannot be transliterated inserted as-is.


EXAMPLE

translit.ToLatin("Привет, Человек", translit.RussianASCII)
// Privet, Chelovek

Documentation

Overview

Package translit implements non-standard one-way string transliteration from Cyrillic to Latin.

Index

Constants

This section is empty.

Variables

View Source
var CyrillicLatin = map[int]string{
	'а': "a",
	'б': "b",
	'в': "v",
	'г': "g",
	'ґ': "g",
	'ѓ': "ǵ",
	'д': "d",
	'ђ': "đ",
	'е': "e",
	'ё': "ë",
	'ж': "ž",
	'з': "z",
	'ѕ': "ẑ",
	'и': "i",
	'і': "ì",
	'ї': "ï",
	'й': "j",
	'ј': "j",
	'к': "k",
	'л': "l",
	'љ': "lj",
	'м': "m",
	'н': "n",
	'њ': "nj",
	'о': "o",
	'п': "p",
	'р': "r",
	'с': "s",
	'т': "t",
	'ћ': "ć",
	'у': "u",
	'ф': "f",
	'х': "h",
	'ц': "c",
	'ч': "č",
	'џ': "dž",
	'ш': "š",
	'щ': "šč",
	'ъ': "'",
	'ы': "y",
	'ь': "",
	'ѣ': "ě",
	'э': "e",
	'є': "ê",
	'ю': "ju",
	'я': "ja",
}

Mapping of Cyrillic characters to (Czech/Serbian) Latin.

View Source
var RussianASCII = map[int]string{
	'а': "a",
	'б': "b",
	'в': "v",
	'г': "g",
	'д': "d",
	'е': "e",
	'ё': "yo",
	'ж': "zh",
	'з': "z",
	'и': "i",
	'й': "j",
	'к': "k",
	'л': "l",
	'м': "m",
	'н': "n",
	'о': "o",
	'п': "p",
	'р': "r",
	'с': "s",
	'т': "t",
	'у': "u",
	'ф': "f",
	'х': "h",
	'ц': "c",
	'ч': "ch",
	'ш': "sh",
	'щ': "sch",
	'ъ': "'",
	'ы': "y",
	'ь': "",
	'э': "e",
	'ю': "ju",
	'я': "ja",
}

Mapping of Russian Cyrillic characters to ASCII Latin.

Functions

func ToLatin

func ToLatin(s string, table map[int]string) string

ToLatin returns a string transliterated using provided mapping table. Runes that cannot be transliterated inserted as-is.

Types

This section is empty.

Jump to

Keyboard shortcuts

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