hyphen

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package hyphen hyphenates text using existing Hunspell hyphenation dictionaries.

This is a port of https://github.com/Kozea/Pyphen

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LanguageFallback

func LanguageFallback(lang language.Language) language.Language

Get a fallback language available in our dictionaries.

http://www.unicode.org/reports/tr35/#Locale_Inheritance

We use the normal truncation inheritance. This function needs aliases including scripts for languages with multiple regions available.

Types

type Hyphener

type Hyphener struct {
	// contains filtered or unexported fields
}

func NewHyphener

func NewHyphener(lang language.Language, left, right int) Hyphener

func (Hyphener) Iterate

func (h Hyphener) Iterate(word string) []string

Iterates over all hyphenation possibilities, the longest first, for `word`. The returned slice contains the starts of each possibility.

Jump to

Keyboard shortcuts

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