Reference · Look words up by reading, written form, English meaning, kanji or romaji
hasMarksfunction
Whether a word has a sense that carries any of some marks. JMdict gives a sense marks such as vulg, col, sl, arch, a
field such as food or med, and a dialect such as ksb.
Import it
import { hasMarks } from "@johnmorrisdotca/jisho/words";
Definition
function hasMarks(word: Word, marks: readonly string[]): boolean
Parameters
| Name | Type | Description |
|---|---|---|
word | Word | A word a lookup returned. |
marks | readonly string[] | The marks to look for. |
Returns
boolean
True when any sense of the word carries any of the marks.
Examples
import { hasMarks } from "@johnmorrisdotca/jisho/words";
const word = { written: "紙", reading: "かみ", forms: ["紙"], meaning: "paper", senses: [{ marks: ["col"], glosses: ["paper"] }], kinds: "", common: true, rank: 1250, priority: ["news1"] };
console.log(hasMarks(word, ["col", "sl"])); // truetrueWhat it prints (run when this page was built)