kana

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(f Form, writer io.Writer, txt io.Reader, foldFlag bool) error

Convert function converts kana character in text stream.

func ConvertString

func ConvertString(f Form, txt string, foldFlag bool) string

ConvertString function converts kana character in text string.

Example
package main

import (
	"fmt"

	"github.com/goark/gnkf/kana"
)

func main() {
	txt := "あいうえおわゐゑをんゔゕゖゝゞアイウエオワヰヱヲンヴヵヶヽヾ"
	fmt.Println(kana.ConvertString(kana.Hiragana, txt, false))
	fmt.Println(kana.ConvertString(kana.Katakana, txt, false))
	fmt.Println(kana.ConvertString(kana.Chokuon, txt, false))
}
Output:

あいうえおわゐゑをんゔゕゖゝゞあいうえおわゐゑをんゔゕゖゝゞ
アイウエオワヰヱヲンヴヵヶヽヾアイウエオワヰヱヲンヴヵヶヽヾ
あいうえおわゐゑをんゔかけゝゞアイウエオワヰヱヲンヴカケヽヾ

func FormList

func FormList() []string

FormList returns list of newline form

Types

type Form

type Form int

Form is type of newline form

const (
	Hiragana Form = iota //Hiragana form
	Katakana             //Katakana form
	Chokuon              //Chokuon (Upper kana) form
)

func FormOf

func FormOf(name string) (Form, error)

FormOf returns newline form name string

func (Form) String

func (f Form) String() string

Jump to

Keyboard shortcuts

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