@dongsa/conjugation
v1.0.0
Published
Korean action-verb and adjective conjugation, with pronunciation, romanization, and rule traces. MIT licensed. Depends only on `@dongsa/hangeul`.
Downloads
791
Readme
@dongsa/conjugation
Korean action-verb and adjective conjugation, with pronunciation, romanization,
and rule traces. MIT licensed. Depends only on @dongsa/hangeul.
import { Adjective, conjugate } from "@dongsa/conjugation";
const forms = conjugate("예쁘다", { partOfSpeech: Adjective });Install with deno add jsr:@dongsa/conjugation or
npm install @dongsa/conjugation. Both registries expose these entry points:
@dongsa/conjugation: conjugation functions,Action,Adjective, and types.@dongsa/conjugation/pronunciation: pronunciation rules.@dongsa/conjugation/romanization: romanization functions.@dongsa/conjugation/stemmer: stemming and a database-independent lookup adapter.@dongsa/conjugation/compat: the existing website response format, with readable form labels,reasons/romanizedfields, and callback support. New consumers should use the main entry point for typed camelCase form names.
The default action mode returns 39 forms; adjective mode returns 31, omitting ordinary commands and suggestions. It uses -(으)ㄴ for present noun modifiers (with -는 for 있다/없다 compounds) and -았/었던 for past retrospective modifiers.
Results have a typed conjugationName such as adnominalPresent, the
conjugated text, and grammar metadata for kind, mood, tense, formality, and
politeness where applicable. Adjective past modifiers also have
grammar.retrospective: true.
Pronunciation, romanization, and explanations are omitted by default. Request only what your application needs:
const explained = conjugate("걷다", {
regular: false,
pronunciation: true,
romanization: true,
explanations: true,
});
console.log(explained[0].conjugationName, explained[0].explanations);The public API uses camelCase: declarativePresentInformalHigh,
getPronunciation, romanizeCharacter, stemLookup, and baseForms.
conjugate takes an options object and returns an array synchronously. The
unpublished root facade also uses camelCase, including conjugationName. It
retains callbacks and enriched output for the website; snake_case aliases are
not exported. deno task lint and the test suite check every entry point,
conjugation key, result field, and public syllable property. Uppercase constants
remain valid.
Input is normalized to NFC and single spaces, limited to 128 characters, and
must be a nonempty Korean predicate without punctuation. Callers choose the
intended part of speech; this package never imports @dongsa/dictionary.
The npm package is ESM with declarations; it needs no Deno runtime or shims.
For the restricted stems 뵙다, 찾아뵙다, and 몰라뵙다, vowel-ending forms use 뵈다, 찾아뵈다, and 몰라뵈다 instead (for example, 찾아뵈면 and 찾아봬요). Explanation traces identify this substitution; consonant endings retain 뵙/찾아뵙/몰라뵙. This follows the NIKL guidance on 찾아뵙다.
With explanations: true, traces include stem extraction, 아/어 vowel selection
(including ㅡ lookback), irregular changes, contractions, past markers, and
ending choices based on 받침 or adjective/action usage. Steps follow the
generated form; pronunciation rules are separate. The explanations are plain
text, with no HTML or response rendering. Treat their wording as educational
text, not stable identifiers for application logic.
For example, 보다 → 봐요 explains removing 다, selecting 아 because 보 has ㅗ,
contracting ㅗ + ㅏ to ㅘ, and adding 요 for polite speech. The spelling rules
are described in the National Institute of Korean Language's
Korean orthography.
Pronunciation supports final-consonant neutralization, cluster liaison and reduction, aspiration, stop-triggered tensification, and nasal/liquid assimilation. To include boundaries between words:
import { getPronunciation } from "@dongsa/conjugation/pronunciation";
getPronunciation("밥 먹는다", { connectedSpeech: true }); // "밤 멍는다"Spaces are pauses by default; connected speech preserves spaces and stops at punctuation/newlines. Output is Hangul respelling, not IPA or an exhaustive set of pronunciations. Unmarked morpheme boundaries, compound ㄴ insertion, and lexical tensification cannot always be inferred from spelling alone.
Scope
This package conjugates action verbs and adjectives, including 아니다, and
retains the bare copula 이다 (이야, 이에요). It does not infer noun +
copula expressions from arbitrary words ending in 이다. Ordinary verbs such as
움직이다 follow normal verb rules (움직여요). Callers must supply a
predicate; general noun + copula expressions are outside the supported scope.
The legacy regularEes export is retained for compatibility but no longer
controls conjugation.
Lexical variants
regular: true selects a regular lexical variant where one exists (for example,
묻어요 instead of 물어요). It does not disable mandatory ㄹ deletion before
endings such as -ㅂ니다.
Adjective mode selects 이르다 → 일러요 (early) and 누르다 → 누르러요
(yellow). For action 이르다, the default is 이르러요 (arrive/reach); select
{ reuVariant: "reu" } for 일러요 (tell). reuVariant: "reo" selects the 러
paradigm. This option is limited to 이르다 and 누르다; both paradigms are
irregular. The older regular: true spelling of the 이르다 selection remains
compatible, but new callers should use reuVariant.
닫다 defaults to “close” (닫아요). Select { dVariant: "irregular" } for
the rare “run” meaning (달아요). Similarly, 치걷다 defaults to “roll up”
(치걷어요), with { dVariant: "irregular" } selecting “walk upward”
(치걸어요). dVariant: "regular" explicitly selects the default paradigm;
this lexical option takes precedence over regular and is limited to these two
words. Consonant endings such as 닫고 and 닫는 stay unchanged.
Short stems use their full forms where required by vowel endings:
서툴다 →
서툴러요, 머물다 → 머물러요, 서둘다 → 서둘러요, 갖다 → 가져요,
되갖다 → 되가져요. Valid consonant-ending forms such as 서툰, 서툽니다,
and 갖고 remain available.
