@gukhanmun/types 0.1.0-dev.16 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/index.d.ts +27 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
@gukhanmun/types
|
|
2
2
|
================
|
|
3
3
|
|
|
4
|
+
[![JSR][JSR badge]][JSR]
|
|
5
|
+
[![npm][npm badge]][npm]
|
|
6
|
+
[![License: GPL-3.0-only][GPL badge]][GPL]
|
|
7
|
+
|
|
4
8
|
TypeScript type declarations for the Gukhanmun JavaScript API. This package
|
|
5
9
|
carries no runtime code; it exists so that both `@gukhanmun/wasm` and
|
|
6
10
|
`@gukhanmun/napi` can share the same type definitions without duplicating them.
|
|
7
11
|
|
|
12
|
+
[JSR badge]: https://jsr.io/badges/@gukhanmun/types
|
|
13
|
+
[JSR]: https://jsr.io/@gukhanmun/types
|
|
14
|
+
[npm badge]: https://img.shields.io/npm/v/@gukhanmun/types?logo=npm
|
|
15
|
+
[npm]: https://www.npmjs.com/package/@gukhanmun/types
|
|
16
|
+
[GPL badge]: https://img.shields.io/npm/l/%40gukhanmun%2Ftypes
|
|
17
|
+
[GPL]: https://www.gnu.org/licenses/gpl-3.0.html
|
|
18
|
+
|
|
8
19
|
|
|
9
20
|
Installation
|
|
10
21
|
------------
|
package/dist/index.d.ts
CHANGED
|
@@ -122,6 +122,19 @@ type NumeralStrategy = "hangul-phonetic" | "positional-arabic" | "additive-arabi
|
|
|
122
122
|
* accuracy matters more than latency.
|
|
123
123
|
*/
|
|
124
124
|
type ContextWindow = "off" | "per-block" | "per-section" | "per-document";
|
|
125
|
+
/**
|
|
126
|
+
* Selects how the homophone marker decides that a reading needs its hanja shown
|
|
127
|
+
* in `rendering: "hangul-only"`. Corresponds to Rust `HomophoneDetection`.
|
|
128
|
+
*
|
|
129
|
+
* - `"context-local"` — Gloss a reading only when a different-meaning homophone
|
|
130
|
+
* actually appears within the {@link ContextWindow}. This keeps hangul-only
|
|
131
|
+
* output clean and is the default.
|
|
132
|
+
* - `"dictionary-wide"` — Also gloss readings shared by other hanja forms
|
|
133
|
+
* anywhere in the dictionary, even when no homophone appears in the text.
|
|
134
|
+
* With a large reference dictionary this glosses most Sino-Korean words; words
|
|
135
|
+
* that should always be glossed are better expressed with `requireHanja`.
|
|
136
|
+
*/
|
|
137
|
+
type HomophoneDetection = "context-local" | "dictionary-wide";
|
|
125
138
|
/**
|
|
126
139
|
* Controls how the pipeline handles reader errors encountered during HTML
|
|
127
140
|
* scanning. Corresponds to Rust `Recovery`.
|
|
@@ -220,7 +233,7 @@ type DictionarySource = FileDictionarySource;
|
|
|
220
233
|
interface HtmlOptions {
|
|
221
234
|
/**
|
|
222
235
|
* Class names whose containing element (and all descendants) should be
|
|
223
|
-
* treated as a preserved region
|
|
236
|
+
* treated as a preserved region—the engine skips their text content.
|
|
224
237
|
*
|
|
225
238
|
* Equivalent to passing `--html-preserve-class NAME` to the CLI one or
|
|
226
239
|
* more times.
|
|
@@ -323,13 +336,22 @@ interface GukhanmunOptions {
|
|
|
323
336
|
readonly initialSoundLaw?: boolean;
|
|
324
337
|
/**
|
|
325
338
|
* Context window for homophone disambiguation. The `HomophoneMarker`
|
|
326
|
-
* middleware sets `homophone = true` on annotations whose hangul reading
|
|
327
|
-
*
|
|
328
|
-
* `"per-block"`.
|
|
339
|
+
* middleware sets `homophone = true` on annotations whose hangul reading
|
|
340
|
+
* collides within this window. Defaults to `"per-block"`.
|
|
329
341
|
*
|
|
330
342
|
* @see {@link ContextWindow}
|
|
331
343
|
*/
|
|
332
344
|
readonly homophoneWindow?: ContextWindow;
|
|
345
|
+
/**
|
|
346
|
+
* Strategy that decides which readings count as homophones needing a hanja
|
|
347
|
+
* gloss. Defaults to `"context-local"`, which glosses a reading only when a
|
|
348
|
+
* different-meaning homophone appears within {@link homophoneWindow}. Use
|
|
349
|
+
* `"dictionary-wide"` to also gloss readings shared by other dictionary
|
|
350
|
+
* entries.
|
|
351
|
+
*
|
|
352
|
+
* @see {@link HomophoneDetection}
|
|
353
|
+
*/
|
|
354
|
+
readonly homophoneDetection?: HomophoneDetection;
|
|
333
355
|
/**
|
|
334
356
|
* Context window for first-occurrence filtering. The
|
|
335
357
|
* `FirstOccurrenceFilter` middleware clears `requireHanja` /
|
|
@@ -533,4 +555,4 @@ declare class GukhanmunError extends Error {
|
|
|
533
555
|
}[];
|
|
534
556
|
}
|
|
535
557
|
//#endregion
|
|
536
|
-
export { ContextWindow, DictionaryEntry, DictionarySource, Directives, ErrorCode, FileDictionarySource, Format, Gukhanmun, GukhanmunError, GukhanmunFactory, GukhanmunOptions, HtmlOptions, NumeralStrategy, OriginalGloss, Preset, Recovery, RenderMode, Segmentation, load };
|
|
558
|
+
export { ContextWindow, DictionaryEntry, DictionarySource, Directives, ErrorCode, FileDictionarySource, Format, Gukhanmun, GukhanmunError, GukhanmunFactory, GukhanmunOptions, HomophoneDetection, HtmlOptions, NumeralStrategy, OriginalGloss, Preset, Recovery, RenderMode, Segmentation, load };
|