namen

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

ilo Namen adapts Toki Pona words so that they can be used within a sitelen pona cartouche.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNimiLiPakala means that a word was encountered that does not follow
	// the sound rules of Toki Pona.
	ErrNimiLiPakala = errors.New("nimi li pakala")
)

Functions

func OAnteENimi added in v0.1.2

func OAnteENimi(nimi string, nasin Nasin) (string, error)

OAnteENini adapts Toki Pona words so that they can be used within a sitelen pona cartouche.

The method of generating the glyphs to use is decided by the Nasin provided. If unsure, use NasinPu to follow the rules described in lipu pu.

The algorithm used is deterministic, meaning the same glyphs will always be selected for the same word.

If nimi does not follow the sound rules of Toki Pona, ErrNimiLiPakala is returned.

Types

type Nasin

type Nasin interface {
	// contains filtered or unexported methods
}

Nasin represents the method of chosing which glyphs to use.

var (
	// Using NasinPu, glyphs are chosen using the lipu pu method.
	//
	// For example, "Amoli" becomes "ale mi ona lupa ike".
	NasinPu Nasin = nasinPu{}

	// Using NasinKalama, glyphs are chosen using the [nasin sitelen kalama]
	// method.
	//
	// For example, "Amoli" becomes "ale moli :".
	//
	// [nasin sitelen kalama]: https://sona.pona.la/wiki/nasin_sitelen_kalama
	NasinKalama Nasin = nasinKalama{}
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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