Documentation
¶
Overview ¶
Package beta implements TypeGreek-flavoured and Standard Betacode parsing.
TypeGreek (www.typegreek.com) is a JavaScript implementation of Betacode that relaxes some rules to ease text entry (and implementation). This implementation is independent, but allows the same:
Uppercase Betacode characters form uppercase Greek characters.
The order of diacritics is unimportant.
The diacritics follow the base character.
Whether a sigma is final or not depends on the next character in streaming mode (beta.Writer). When using beta.Sym, we can't know the next character, so this is moot.
When an asterisk is encountered, the symbol is coerced to uppercase and breathing and accent may appear before the base character, emulating Standard Betacode as used by the Perseus Project.
Index ¶
Constants ¶
const (
// Vowels in Betacode. Most diacritics apply to vowels only.
Vowels = "aehowiu"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sym ¶
type Sym struct {
Base rune // Betacode character (A-Z, a-z)
Accent rune // none, /, \, =
Spiritus rune // Breathing: none, ), (
Iota bool // Iota subscriptum/adscriptum
Trema bool // Diaeresis
// contains filtered or unexported fields
}
A Sym is a parsed Betacode character.
func (*Sym) Add ¶
Add adds r to the symbol if it is a valid Betacode/TypeGreek base character or modifier. It returns true if the character has been added. If it returns false and if sym.Err() is nil, the start of a new symbol was detected. If sym.Err() is not nil, a true error occurred.
func (Sym) Combining ¶
Combining returns the combining diacritics Unicode form as a UTF-8 byte slice.
func (Sym) CombiningString ¶
CombiningString returns the combining diacritics Unicode form as a UTF-8 string.
func (Sym) Err ¶
Err returns the error that caused Add to return false. If !sym.Empty() and sym.Err() == nil, this means the Sym is complete and the start of the next symbol was encountered.
func (Sym) Precombined ¶
Precombined returns the NFC normalised Unicode form (precombined code point) as a UTF-8 byte slice. This is the usual form.
func (Sym) PrecombinedString ¶
PrecombinedString returns the NFC normalised Unicode form (precombined code point) as a UTF-8 string. This is the usual form.