KnownWordstype
The words your dictionary confirmed, each with the kinds of word it is. A word with no kinds is
still a match as written; only a conjugated form needs its dictionary form to be the right kind
(wordClassesOf reads the kinds from a dictionary's parts of speech).
Import it
import type { KnownWords } from "@johnmorrisdotca/hikidashi/extract";
Also exported from: @johnmorrisdotca/hikidashi
Definition
type KnownWords = ReadonlyMap<string, readonly WordClass[]>;
Members
| Name | Type | Description |
|---|---|---|
forEach | (callbackfn: (value: readonly WordClass[], key: string, map: ReadonlyMap<string, readonly WordClass[]>) => void, thisArg?: any): void | |
get | (key: string): readonly WordClass[] | undefined | |
has | (key: string): boolean | |
size | number | |
entries | (): MapIterator<[string, readonly WordClass[]]> | Returns an iterable of key, value pairs for every entry in the map. |
keys | (): MapIterator<string> | Returns an iterable of keys in the map |
values | (): MapIterator<readonly WordClass[]> | Returns an iterable of values in the map |
Examples
import type { KnownWords } from "@johnmorrisdotca/hikidashi/extract";
import { wordClassesOf } from "@johnmorrisdotca/hikidashi/deinflect";
const known: KnownWords = new Map([["学校", []], ["行く", wordClassesOf("行く", ["v5k-s"])]]);
console.log([...known]);[ [ '学校', [] ], [ '行く', [ 'godan' ] ] ]What it prints (run when this page was built)