greekaccentuation

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 4 Imported by: 0

README

greekaccentuation Go Module

The greekaccentuation go module is a direct port of the python project https://github.com/jtauber/greek-accentuation This is still a work in progress. I will add documentation once the project is in a more complete state.

Design

For now, the principle of this project is to be a rough/approximate file-for-file and function-for-function equivalent between this Go project and the Pythong project. This project is not designed to be idiomatic Go. This is to make it easier to maintain a like-for-like match in functionality.

Credits

The greekaccentuation go module is a direct port of the python project https://github.com/jtauber/greek-accentuation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StripAccents = removeDiacritic(Accents)

Functions

func AddBreathing

func AddBreathing(ch rune, breathing Breathing) rune

AddBreathing attaches the specified breathing to a character

func AddDiacritic

func AddDiacritic(base []rune, diacritic rune) []rune

AddDiacritic attaches the specified diacritic to the specified character

func Base

func Base(ch rune) rune

func DisplayAccentuation

func DisplayAccentuation(accentuation Accentuation) string

func DisplayWord

func DisplayWord(parts []string) string

DisplayWord is a helper function that displays a syllable array as a string.

func IsVowel

func IsVowel(ch rune) bool

IsVowel returns true if a character is a vowel. Accents and iota subscripts are ignored

func MakeOxytone

func MakeOxytone(word string) string

func MakeParoxytone

func MakeParoxytone(word string) string

func MakePerispomenon

func MakePerispomenon(word string) string

func MakeProparoxytone

func MakeProparoxytone(word string) string

func MakeProperispomenon

func MakeProperispomenon(word string) string

func OnPenult

func OnPenult(w string, default_short bool) string

func OnPenult(w, default_short=False) {

func Persistent

func Persistent(word string, lemma string, defaultShort bool) string

Persistent returns the accented form of a word. Returns an empty string if the dictionary entry contains no accent. func Persistent(w string, lemma string, default_short=False) {

func Rebreath added in v0.0.10

func Rebreath(word string) string

func Recessive

func Recessive(w string, treat_final_AI_OI_short bool, default_short bool) string

Recessive does something that I am sure is interesting, but I don't know what. func Recessive(w string, treat_final_AI_OI_short=True, default_short=False)

func RemoveAccentFromRune

func RemoveAccentFromRune(r rune) (rune, bool)

RemoveAccentFromRune strips all accents from a character. Returns true if the character is valid for a standard greek string.

func RemoveAccentsFromString

func RemoveAccentsFromString(s string) string

func Syllabify

func Syllabify(word string) []string

Syllabify splits a word into a string array of syllables.

Types

type Accent

type Accent rune
const (
	NO_ACCENT   Accent = 0
	ACUTE       Accent = '\u0301'
	GRAVE       Accent = '\u0300'
	CIRCUMFLEX  Accent = '\u0342'
	OXIA        Accent = ACUTE
	VARIA       Accent = GRAVE
	PERISPOMENI Accent = CIRCUMFLEX
)

func (Accent) Name

func (e Accent) Name() string

func (Accent) Rune

func (e Accent) Rune() rune

type Accentuation

type Accentuation int
const (
	NO_ACCENTUATION Accentuation = 0
	OXYTONE         Accentuation = 1
	PERISPOMENON    Accentuation = 2
	PAROXYTONE      Accentuation = 3
	PROPERISPOMENON Accentuation = 4
	PROPAROXYTONE   Accentuation = 5
)

func (Accentuation) Character

func (e Accentuation) Character() Accent

func (Accentuation) Name

func (e Accentuation) Name() string

func (Accentuation) Position

func (e Accentuation) Position() int

func (Accentuation) Value

func (e Accentuation) Value() (int, Accent)

type Breathing

type Breathing rune
const (
	NO_BREATHING Breathing = 0
	SMOOTH       Breathing = '\u0313'
	ROUGH        Breathing = '\u0314'
	PSILI        Breathing = SMOOTH //- GO doesnt handle this well
	DASIA        Breathing = ROUGH  //- GO doesnt handle this well
)

func (Breathing) Name

func (e Breathing) Name() string

func (Breathing) Rune

func (e Breathing) Rune() rune

type ByAccentReverse

type ByAccentReverse []Accentuation

func (ByAccentReverse) Len

func (a ByAccentReverse) Len() int

func (ByAccentReverse) Less

func (a ByAccentReverse) Less(i, j int) bool

func (ByAccentReverse) Swap

func (a ByAccentReverse) Swap(i, j int)

type Diacritic

type Diacritic rune
const (
	DIAERESIS Diacritic = '\u0308'
)

func (Diacritic) Name

func (e Diacritic) Name() string

func (Diacritic) Rune

func (e Diacritic) Rune() rune

type ExtractDiacriticFunction

type ExtractDiacriticFunction func(ch rune) RuneInterface

type Length

type Length rune
const (
	SHORT   Length = '\u0306'
	LONG    Length = '\u0304'
	UNKNOWN Length = -1
)

func (Length) Name

func (e Length) Name() string

func (Length) Rune

func (e Length) Rune() rune

type RemoveDiacriticFunction

type RemoveDiacriticFunction func(text []rune) []rune

type RuneInterface

type RuneInterface interface {
	Rune() rune
}

type Subscript

type Subscript rune
const (
	IOTA          Subscript = '\u0345'
	YPOGEGRAMMENI Subscript = IOTA
)

func (Subscript) Name

func (e Subscript) Name() string

func (Subscript) Rune

func (e Subscript) Rune() rune

Jump to

Keyboard shortcuts

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