Documentation
¶
Overview ¶
Package script tells which writing system text is in, as the translation checks (transcheck) and the apps' text code need it: the scripts written without spaces between words, word characters, the script most of a text's letters are in, and the script a language is written in.
Script names here are coarse, one per writing system the checks tell apart (Han, Japanese, Hangul, Cyrillic, Arabic, Hebrew, Thai, Devanagari, Greek, Latin), not ISO 15924 codes: Japanese is kana with or without Han, and every other script counts as Latin.
Index ¶
Constants ¶
const ( Han = "Han" Japanese = "Japanese" Hangul = "Hangul" Cyrillic = "Cyrillic" Arabic = "Arabic" Hebrew = "Hebrew" Thai = "Thai" Devanagari = "Devanagari" Greek = "Greek" Latin = "Latin" )
The script names Dominant, Has and Of use.
Variables ¶
This section is empty.
Functions ¶
func Dominant ¶
Dominant is the script most letters of s are in, "" when s has fewer than two letters. Kana weigh double, and Han with any kana is Japanese; a tie goes to the name first in alphabetical order.
func Has ¶
Has reports whether s has a letter of script (one of the names above; Japanese takes kana or Han, an unknown name Latin).
func IsUnspaced ¶
IsUnspaced reports whether r belongs to a script written without spaces between words (Han, kana, Thai, Lao, Khmer, Myanmar, Tibetan, Bopomofo, CJK punctuation and full-width forms), where a term may match anywhere instead of only at word boundaries. Hangul is spaced and is not included.
func IsWordRune ¶
IsWordRune reports whether r is part of a word: a letter, a digit or a combining mark.
Types ¶
This section is empty.