Documentation ¶
Overview ¶
Package jisx4061 implements JIS X 4061 Japanese character string collation order. It is commonly referred to as "辞書順(the dictionary order)", "50音順(the syllabic order), "あいうえお順(the a-i-u-e-o order)".
The collation method is simple collation (単純照合), where comparisons are made according to basic collation rules (基本照合規則). The Latin alphabet is processed, including macronised (マクロン付き文字) and circumflexed characters (サーカムフレックス付き文字). The extended Kanji character class (拡張漢字クラス) is used for the Kanji character class.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Less compares the strings a and b according to JIS X 4061. if a < b it returns -1, if a > b it returns 1, and if a == b it returns 0.
func Sort ¶
func Sort(s []string)
Sort sorts s.
Example ¶
package main import ( "fmt" "github.com/shogo82148/jisx4061" ) func main() { list := []string{ "さどう", "さとうや", "サトー", "さと", "さど", "さとう", "さとおや", } jisx4061.Sort(list) for _, s := range list { fmt.Println(s) } }
Output: さと さど さとう さどう さとうや サトー さとおや