/** * The order and the group heads of a Japanese back-of-book index (#425). * * A Japanese index files its entries in gojūon order (五十音順) by their * reading (読み), never by the characters written: 東京 files where とうきょう * does. No algorithm reads kanji reliably, so the reading comes from the * author (`:index[東京]{yomi="とうきょう"}`, or the ruby of the marked text); * an entry without one is reported (`indexReadingMissing`) and files after * the kana, by code point. * * The comparison is JIS X 4061 (日本語文字列照合順番), written out here so * that the order does not depend on the ICU data of the browser: * * - Character groups: symbols (space first) < Arabic digits < Latin < kana * < kanji < geta 〓. Digit runs compare as numbers. * - Kana compare first on their base letter in gojūon order (あいうえお … わ * ゐゑをん): katakana as hiragana, a small kana as its large form, a voiced * or semi-voiced one as its plain form (ガ = か, ぱ = は, ぁ = あ). The long * vowel mark ー stands for the vowel of the kana before it (カー = かあ); * the iteration marks ゝゞヽヾ for the kana before them (いすゞ = いすず). * - Ties between equal base letters break, in this order: 清音 < 濁音 < * 半濁音 (は < ば < ぱ); 長音記号 < 小文字 < 繰返し記号 < 大文字 (ー < ぁ < * ゝ < あ); 平仮名 < 片仮名. Last, the code points of the key. * * Kanji compare by code point: JIS X 4061 orders them by their JIS X 0208 * code (level 1 by reading, level 2 by radical), a table the engine does * not ship, and an entry that reaches this comparison lacks a reading * anyway. * * The heads (ja typography §13): `gojuon` files an entry under the row of * its first kana (あ行 か行 さ行 た行 な行 は行 ま行 や行 ら行 わ行; ん under * わ行), the form technical and reference books use, which also says the * group spans a row; `kana` under the first kana itself (か for が, カ and * ヵ), the form of dictionaries and long name indexes. */ /** The base letters in gojūon order: the primary weight of a kana is its * place here. */ export declare const GOJUON = "\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093"; /** The rows of the gojūon table and where each starts in {@link GOJUON}: * や and わ hold fewer letters (やゆよ; わゐゑをん, ん filed with わ). */ export declare const GOJUON_ROWS: readonly { head: string; start: number; }[]; /** JIS X 4061 order of two index keys (readings): negative when `a` files * first. See the module header. */ export declare function compareJapanese(a: string, b: string): number; /** Whether a key's primary weights equal (the base comparison: か = が = * カ = ヵ). */ export declare function sameJapaneseBase(a: string, b: string): boolean; /** What a key files under in a Japanese index: the gojūon place of its * first kana, or the group of its first character. */ export type JapaneseLead = { kind: 'kana'; base: number; } | { kind: 'latin' | 'digit' | 'symbol' | 'kanji'; }; /** The first collation element of `key`, as a {@link JapaneseLead}. A * leading ー or iteration mark repeats nothing: it is a symbol. */ export declare function japaneseLead(key: string): JapaneseLead; /** The row (0 = あ行 … 9 = わ行) of the base letter at `base` in * {@link GOJUON}. */ export declare function gojuonRow(base: number): number; /** The head of gojūon row `row`: あ行 … わ行. */ export declare function gojuonRowLabel(row: number): string; /** The head of the kana group at `base`: the plain hiragana letter (か * for が, カ and ヵ). */ export declare function kanaLabel(base: number): string; /** Whether `text` holds a kanji (a Han character, 々 included): such a * key needs a reading. */ export declare function hasKanji(text: string): boolean; /** Whether `reading` is written in kana alone (see {@link KANA_READING}). */ export declare function isKanaReading(reading: string): boolean; //# sourceMappingURL=indexJapanese.d.ts.map