nihongo

package module
v0.0.0-...-ab7f618 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: BSD-3-Clause Imports: 4 Imported by: 7

README

Package nihongo implements simple transliteration between romaji and the two syllabic Japanese scripts, hiragana and katakana, encoded as UTF-8-encoded Unicode. Romaji output may include injected spaces to separate converted text from unconverted, and other markers. Invalid sequences, such as small kanas with no preceding kana, are passed unaltered. Hiragana and katakana may be inaccurate due to false matches. Katakana may be further inaccurate because of the inability to generate the tsu consonant-extending symbol.

For full documentation, see the godoc page.

Documentation

Overview

Package nihongo implements simple transliteration between romaji and the two syllabic Japanese scripts, hiragana and katakana, encoded as UTF-8-encoded Unicode. Romaji output may include injected spaces to separate converted text from unconverted, and other markers. Invalid sequences, such as small kanas with no preceding kana, are passed unaltered. Hiragana and katakana may be inaccurate due to false matches. Katakana may be further inaccurate because of the inability to generate the tsu consonant-extending symbol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hiragana

func Hiragana(romaji []byte) []byte

Hiragana translates romaji into hiragana and returns the result.

func HiraganaReader

func HiraganaReader(rd io.Reader) io.Reader

HiraganaReader returns an io.Reader that will translate romaji in its input into hiragana.

func HiraganaString

func HiraganaString(romaji string) string

HiraganaString translates romaji into hiragana and returns the result.

func Katakana

func Katakana(romaji []byte) []byte

Katakana translates romaji into katakana and returns the result.

func KatakanaReader

func KatakanaReader(rd io.Reader) io.Reader

KatakanaReader returns an io.Reader that will translate romaji in its input into katakana.

func KatakanaString

func KatakanaString(romaji string) string

KatakanaString translates romaji into katakana and returns the result.

func Romaji

func Romaji(text []byte) []byte

Romaji translates text into romaji and returns the result.

func RomajiReader

func RomajiReader(rd io.Reader) io.Reader

RomajiReader returns an io.Reader that will translate its input into romaji.

func RomajiString

func RomajiString(text string) string

RomajiString translates text into romaji and returns the result.

Types

This section is empty.

Jump to

Keyboard shortcuts

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