pravapis 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/dist/index.cjs +5837 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +5806 -0
- package/dist/names.cjs +6060 -0
- package/dist/names.d.cts +13 -0
- package/dist/names.d.ts +13 -0
- package/dist/names.js +6032 -0
- package/dist/pipeline-CQ31DzWB.d.ts +155 -0
- package/dist/pipeline-T0FQH27h.d.cts +155 -0
- package/dist/translit.cjs +1698 -0
- package/dist/translit.d.cts +44 -0
- package/dist/translit.d.ts +44 -0
- package/dist/translit.js +1667 -0
- package/dist/types-wqNurkip.d.cts +146 -0
- package/dist/types-wqNurkip.d.ts +146 -0
- package/package.json +63 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { e as TranslitScheme, f as Script, O as Orthography, g as TranslitData } from './types-wqNurkip.cjs';
|
|
2
|
+
|
|
3
|
+
declare class Scheme {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly tests: readonly {
|
|
6
|
+
input: string;
|
|
7
|
+
expected: string;
|
|
8
|
+
}[];
|
|
9
|
+
private readonly maxLen;
|
|
10
|
+
private readonly bySource;
|
|
11
|
+
constructor(scheme: TranslitScheme);
|
|
12
|
+
/** The longest grapheme at `start` whose condition holds: [output, consumed, lossy]. */
|
|
13
|
+
lookup(text: string, start: number): [string, number, boolean] | null;
|
|
14
|
+
}
|
|
15
|
+
interface TransliterationResult {
|
|
16
|
+
text: string;
|
|
17
|
+
unresolved: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The orthography each Latin scheme shares a softness convention with. */
|
|
21
|
+
declare const PAIRED: Readonly<Record<Exclude<Script, "cyrillic">, Orthography>>;
|
|
22
|
+
/** Scripts this port can read back into Cyrillic. The 2007 romanisation is absent on
|
|
23
|
+
* purpose: it does not write assimilative softness, so the reverse cannot be faithful. */
|
|
24
|
+
declare const REVERSIBLE: ReadonlySet<Script>;
|
|
25
|
+
declare class Transliterator {
|
|
26
|
+
private readonly scheme;
|
|
27
|
+
constructor(scheme: Scheme);
|
|
28
|
+
static fromData(translit: TranslitData, script: Exclude<Script, "cyrillic">, reverse?: boolean): Transliterator;
|
|
29
|
+
word(word: string): TransliterationResult;
|
|
30
|
+
/** Only word tokens are transliterated; numbers, punctuation and whitespace are
|
|
31
|
+
* reproduced byte for byte. */
|
|
32
|
+
transliterate(text: string): TransliterationResult;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Script conversion only — no orthography step (`pravapis`'s `convert` does that). */
|
|
36
|
+
declare function transliterate(text: string, script: Exclude<Script, "cyrillic">, options?: {
|
|
37
|
+
reverse?: boolean;
|
|
38
|
+
}): string;
|
|
39
|
+
/** One scheme, applied to a whole text; use this to inspect `.unresolved` too. */
|
|
40
|
+
declare function transliterateResult(text: string, script: Exclude<Script, "cyrillic">, options?: {
|
|
41
|
+
reverse?: boolean;
|
|
42
|
+
}): ReturnType<Transliterator["transliterate"]>;
|
|
43
|
+
|
|
44
|
+
export { PAIRED, REVERSIBLE, Script, type TransliterationResult, Transliterator, transliterate, transliterateResult };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { e as TranslitScheme, f as Script, O as Orthography, g as TranslitData } from './types-wqNurkip.js';
|
|
2
|
+
|
|
3
|
+
declare class Scheme {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly tests: readonly {
|
|
6
|
+
input: string;
|
|
7
|
+
expected: string;
|
|
8
|
+
}[];
|
|
9
|
+
private readonly maxLen;
|
|
10
|
+
private readonly bySource;
|
|
11
|
+
constructor(scheme: TranslitScheme);
|
|
12
|
+
/** The longest grapheme at `start` whose condition holds: [output, consumed, lossy]. */
|
|
13
|
+
lookup(text: string, start: number): [string, number, boolean] | null;
|
|
14
|
+
}
|
|
15
|
+
interface TransliterationResult {
|
|
16
|
+
text: string;
|
|
17
|
+
unresolved: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The orthography each Latin scheme shares a softness convention with. */
|
|
21
|
+
declare const PAIRED: Readonly<Record<Exclude<Script, "cyrillic">, Orthography>>;
|
|
22
|
+
/** Scripts this port can read back into Cyrillic. The 2007 romanisation is absent on
|
|
23
|
+
* purpose: it does not write assimilative softness, so the reverse cannot be faithful. */
|
|
24
|
+
declare const REVERSIBLE: ReadonlySet<Script>;
|
|
25
|
+
declare class Transliterator {
|
|
26
|
+
private readonly scheme;
|
|
27
|
+
constructor(scheme: Scheme);
|
|
28
|
+
static fromData(translit: TranslitData, script: Exclude<Script, "cyrillic">, reverse?: boolean): Transliterator;
|
|
29
|
+
word(word: string): TransliterationResult;
|
|
30
|
+
/** Only word tokens are transliterated; numbers, punctuation and whitespace are
|
|
31
|
+
* reproduced byte for byte. */
|
|
32
|
+
transliterate(text: string): TransliterationResult;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Script conversion only — no orthography step (`pravapis`'s `convert` does that). */
|
|
36
|
+
declare function transliterate(text: string, script: Exclude<Script, "cyrillic">, options?: {
|
|
37
|
+
reverse?: boolean;
|
|
38
|
+
}): string;
|
|
39
|
+
/** One scheme, applied to a whole text; use this to inspect `.unresolved` too. */
|
|
40
|
+
declare function transliterateResult(text: string, script: Exclude<Script, "cyrillic">, options?: {
|
|
41
|
+
reverse?: boolean;
|
|
42
|
+
}): ReturnType<Transliterator["transliterate"]>;
|
|
43
|
+
|
|
44
|
+
export { PAIRED, REVERSIBLE, Script, type TransliterationResult, Transliterator, transliterate, transliterateResult };
|