nrm

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: 8 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormList

func FormList() []string

FormList returns list of Unicode normalization form

func FormOf

func FormOf(name string) (norm.Form, error)

FormOf returns Unicode normalization form type from name string

func NormKangxiRadicals

func NormKangxiRadicals(writer io.Writer, txt io.Reader) error

NormKangxiRadicals dose Unicode normalization kangxi radicals only

func NormKangxiRadicalsBytes

func NormKangxiRadicalsBytes(txt []byte) ([]byte, error)

NormKangxiRadicalsBytes dose Unicode normalization kangxi radicals only

func Normalize

func Normalize(formName string, writer io.Writer, txt io.Reader, krFlag bool) error

Normalize function normalize Unicode text

Example
package main

import (
	"bytes"
	"fmt"
	"os"
	"strings"

	"github.com/goark/gnkf/dump"
	"github.com/goark/gnkf/nrm"
)

func main() {
	buf := &bytes.Buffer{}
	if err := nrm.Normalize("nfkc", buf, strings.NewReader("ペンギン"), false); err != nil {
		fmt.Fprintln(os.Stderr, err)
	}
	if err := dump.UnicodePoint(os.Stdout, buf); err != nil {
		fmt.Fprintln(os.Stderr, err)
	}
}
Output:

0x30da, 0x30f3, 0x30ae, 0x30f3

Types

This section is empty.

Jump to

Keyboard shortcuts

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