WordSegment型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One run of a word, and its share of the reading in hiragana: what segmentWord cuts a word into.
インポート
import type { WordSegment } from "@johnmorrisdotca/hikidashi/align";
ほかのエクスポート元: @johnmorrisdotca/hikidashi
定義
type WordSegment = {
text: string;
kind: SegmentKind;
reading: string;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The run as the word writes it: one or more kanji, or kana. |
kind | SegmentKind | Kanji, kana inside the word, or okurigana at its end. |
reading | string | The run's share of the reading, in hiragana. |
例
import { segmentWord, type WordSegment } from "@johnmorrisdotca/hikidashi/align";
const first: WordSegment | undefined = segmentWord("食べる", "たべる")?.[0];
console.log(first);{ text: '食', reading: 'た', kind: 'kanji' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。