hebrew-transliteration 2.2.4 → 2.3.1
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 +23 -15
- package/dist/remove.d.ts +264 -43
- package/dist/remove.js +189 -21
- package/dist/schema.d.ts +4 -3
- package/dist/schema.js +3 -1
- package/dist/schemas/brillAcademic.js +2 -1
- package/dist/schemas/brillSimple.js +2 -1
- package/dist/schemas/michiganClaremont.js +2 -1
- package/dist/schemas/sblAcademicSpirantization.js +2 -1
- package/dist/schemas/sblSimple.js +14 -1
- package/package.json +19 -11
- package/dist/.DS_Store +0 -0
- package/dist/schemas/romaniote.d.ts +0 -2
- package/dist/schemas/romaniote.js +0 -96
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ Takes a `string` or [`Text`](#text), and optionally a [`Schema`](#schema) or `Pa
|
|
|
56
56
|
|
|
57
57
|
```javascript
|
|
58
58
|
heb.transliterate("אֱלֹהִים");
|
|
59
|
-
//
|
|
59
|
+
// ʾĕlōhîm
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
If no [`Schema`](#schema) is passed, then the package defaults to SBL's academic style.
|
|
@@ -78,13 +78,6 @@ heb.transliterate("בְּבֵית", brillAcademic)
|
|
|
78
78
|
```
|
|
79
79
|
**Note**: schemas are not endorsed by publishers.
|
|
80
80
|
|
|
81
|
-
The available schemas are:
|
|
82
|
-
|
|
83
|
-
- brillAcademic
|
|
84
|
-
- brillSimple
|
|
85
|
-
- sblAcademicSpirantization
|
|
86
|
-
- sblSimple
|
|
87
|
-
|
|
88
81
|
If you need a fully customized transliteration, it is best to use the [`Schema`](#schema) constructor:
|
|
89
82
|
|
|
90
83
|
```javascript
|
|
@@ -104,17 +97,32 @@ heb.transliterate("אָ֣ב", schema)
|
|
|
104
97
|
|
|
105
98
|
#### `remove()`
|
|
106
99
|
|
|
107
|
-
Takes `string` and
|
|
100
|
+
Takes `string` and `RemoveOptions`.
|
|
101
|
+
|
|
102
|
+
The default removes accents (i.e. characters called HEBREW ACCENT) and metheg and rafe.
|
|
108
103
|
|
|
109
104
|
```javascript
|
|
110
105
|
heb.remove("שָׂרַ֣י אִשְׁתְּךָ֔");
|
|
111
|
-
//
|
|
106
|
+
// שָׂרַי אִשְׁתְּךָ;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The `RemoveOptions` can be customized.
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
```javascript
|
|
112
|
+
heb.remove("שָׂרַ֣י אִשְׁתְּךָ֔", { SHIN_DOT: true, SIN_DOT: true });
|
|
113
|
+
// שָרַ֣י אִשְתְּךָ֔
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Note:** unlike a `Schema` where a `Partial<Schema>` extends the default, `RemoveOptions` does not accept a `Partial<RemoveOptions>`.
|
|
115
117
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
All properties for `RemoveOptions` can be found in the [source](src/remove.ts).
|
|
119
|
+
|
|
120
|
+
There are some preset options availables as well.
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
const opts = require("hebrew-transliteration/removeOptions");
|
|
124
|
+
heb.remove("שָׂרַ֣י אִשְׁתְּךָ֔", opts.all);
|
|
125
|
+
// שרי אשתך, וימצאו
|
|
118
126
|
```
|
|
119
127
|
|
|
120
128
|
---
|
|
@@ -322,7 +330,7 @@ heb.transliterate("בֵּ֣ית", {
|
|
|
322
330
|
|
|
323
331
|
## Live
|
|
324
332
|
|
|
325
|
-
Use it live at [
|
|
333
|
+
Use it live at [https://hebrewtransliteration.app](https://hebrewtransliteration.app)
|
|
326
334
|
|
|
327
335
|
## Contributing
|
|
328
336
|
|
package/dist/remove.d.ts
CHANGED
|
@@ -1,65 +1,286 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for the `remove()` function
|
|
3
|
-
*/
|
|
4
1
|
interface RemoveOptions {
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
* ◌֑
|
|
4
|
+
*/
|
|
5
|
+
ETNAHTA?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* ◌֒
|
|
8
|
+
*/
|
|
9
|
+
SEGOLTA?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* ◌֓
|
|
12
|
+
*/
|
|
13
|
+
SHALSHELET?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* ◌֔
|
|
16
|
+
*/
|
|
17
|
+
ZAQEF_QATAN?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* ◌֕
|
|
20
|
+
*/
|
|
21
|
+
ZAQEF_GADOL?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* ◌֖
|
|
24
|
+
*/
|
|
25
|
+
TIPEHA?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* ◌֗
|
|
28
|
+
*/
|
|
29
|
+
REVIA?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* ◌֘
|
|
32
|
+
*/
|
|
33
|
+
ZARQA?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* ◌֙
|
|
36
|
+
*/
|
|
37
|
+
PASHTA?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* ◌֚
|
|
40
|
+
*/
|
|
41
|
+
YETIV?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* ◌֛
|
|
44
|
+
*/
|
|
45
|
+
TEVIR?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* ◌֜
|
|
48
|
+
*/
|
|
49
|
+
GERESH?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* ◌֝
|
|
52
|
+
*/
|
|
53
|
+
GERESH_MUQDAM?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* ◌֞
|
|
56
|
+
*/
|
|
57
|
+
GERSHAYIM?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* ◌֟
|
|
60
|
+
*/
|
|
61
|
+
QARNEY_PARA?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* ◌֠
|
|
64
|
+
*/
|
|
65
|
+
TELISHA_GEDOLA?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* ◌֡
|
|
68
|
+
*/
|
|
69
|
+
PAZER?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* ◌֢
|
|
72
|
+
*/
|
|
73
|
+
ATNAH_HAFUKH?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* ◌֣
|
|
76
|
+
*/
|
|
77
|
+
MUNAH?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* ◌֤
|
|
80
|
+
*/
|
|
81
|
+
MAHAPAKH?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* ◌֥
|
|
84
|
+
*/
|
|
85
|
+
MERKHA?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* ◌֦
|
|
88
|
+
*/
|
|
89
|
+
MERKHA_KEFULA?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* ◌֧
|
|
92
|
+
*/
|
|
93
|
+
DARGA?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* ◌֨
|
|
96
|
+
*/
|
|
97
|
+
QADMA?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* ◌֩
|
|
100
|
+
*/
|
|
101
|
+
TELISHA_QETANA?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* ◌֪
|
|
104
|
+
*/
|
|
105
|
+
YERAH_BEN_YOMO?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* ◌֫
|
|
108
|
+
*/
|
|
109
|
+
OLE?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* ◌֬
|
|
112
|
+
*/
|
|
113
|
+
ILUY?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* ◌֭
|
|
116
|
+
*/
|
|
117
|
+
DEHI?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* ◌֮
|
|
120
|
+
*/
|
|
121
|
+
ZINOR?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* ◌ְ
|
|
124
|
+
*/
|
|
125
|
+
SHEVA?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* ◌ֱ
|
|
128
|
+
*/
|
|
129
|
+
HATAF_SEGOL?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* ◌ֲ
|
|
132
|
+
*/
|
|
133
|
+
HATAF_PATAH?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* ◌ֳ
|
|
136
|
+
*/
|
|
137
|
+
HATAF_QAMATS?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* ◌ִ
|
|
140
|
+
*/
|
|
141
|
+
HIRIQ?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* ◌ֵ
|
|
144
|
+
*/
|
|
145
|
+
TSERE?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* ◌ֶ
|
|
148
|
+
*/
|
|
149
|
+
SEGOL?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* ◌ַ
|
|
152
|
+
*/
|
|
153
|
+
PATAH?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* ◌ָ
|
|
156
|
+
*/
|
|
157
|
+
QAMATS?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* ◌ֹ
|
|
160
|
+
*/
|
|
161
|
+
HOLAM?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* ◌ֻ
|
|
164
|
+
*/
|
|
165
|
+
QUBUTS?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* ◌ּ
|
|
168
|
+
*/
|
|
169
|
+
DAGESH?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* ◌ֽ
|
|
172
|
+
*/
|
|
173
|
+
METEG?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* ◌ֿ
|
|
176
|
+
*/
|
|
177
|
+
RAFE?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* ◌ׁ
|
|
180
|
+
*/
|
|
181
|
+
SHIN_DOT?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* ◌ׂ
|
|
184
|
+
*/
|
|
185
|
+
SIN_DOT?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* ◌ׇ
|
|
188
|
+
*/
|
|
189
|
+
QAMATS_QATAN?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* ־◌
|
|
192
|
+
*/
|
|
193
|
+
MAQAF?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* ׀ ◌
|
|
196
|
+
*/
|
|
197
|
+
PASEQ?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* ׃◌
|
|
200
|
+
*/
|
|
201
|
+
SOF_PASUQ?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* ׆
|
|
204
|
+
*/
|
|
205
|
+
NUN_HAFUKHA?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* ׳
|
|
208
|
+
*/
|
|
209
|
+
PUNC_GERESH?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* ״
|
|
212
|
+
*/
|
|
213
|
+
PUNC_GERSHAYIM?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* ◌֯
|
|
216
|
+
*/
|
|
217
|
+
MASORA_CIRCLE?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* ◌ׄ
|
|
220
|
+
*/
|
|
221
|
+
UPPER_DOT?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* ◌ׅ
|
|
224
|
+
*/
|
|
225
|
+
LOWER_DOT?: boolean;
|
|
35
226
|
}
|
|
36
227
|
/**
|
|
37
|
-
* removes
|
|
228
|
+
* removes all chars called HEBREW ACCENT (U+0591-05AF)
|
|
229
|
+
*/
|
|
230
|
+
export declare const accents: RemoveOptions;
|
|
231
|
+
/**
|
|
232
|
+
* removes all chars called HEBREW POINT (U+05B0-05BD, U+05BF, U+05C1-05C2 and U+05C7)
|
|
233
|
+
*/
|
|
234
|
+
export declare const points: RemoveOptions;
|
|
235
|
+
/**
|
|
236
|
+
* removes chars called HEBREW POINT (U+05B0-05BC and U+05C7) except for:
|
|
237
|
+
* - SHIN_DOT
|
|
238
|
+
* - SIN_DOT
|
|
239
|
+
* - METEG
|
|
240
|
+
* - RAFE
|
|
241
|
+
*/
|
|
242
|
+
export declare const vowels: RemoveOptions;
|
|
243
|
+
/**
|
|
244
|
+
* removes all chars called HEBREW PUNCTUATION (U+05BE, U+05C0, U+05C3, and U+05C6)
|
|
245
|
+
*/
|
|
246
|
+
export declare const punctuation: RemoveOptions;
|
|
247
|
+
/**
|
|
248
|
+
* removes all chars called HEBREW MARK (U+05AF, U+05C4, and U+05C5)
|
|
249
|
+
*/
|
|
250
|
+
export declare const marks: RemoveOptions;
|
|
251
|
+
export declare const all: RemoveOptions;
|
|
252
|
+
/**
|
|
253
|
+
* removes niqqud from Hebrew text
|
|
38
254
|
*
|
|
39
255
|
* @param text - a string of Hebrew characters
|
|
40
|
-
* @param
|
|
41
|
-
* @returns Hebrew characters with
|
|
256
|
+
* @param options
|
|
257
|
+
* @returns Hebrew characters with accents and niqqud optionally removed
|
|
42
258
|
*
|
|
43
259
|
* @example Default
|
|
44
260
|
*
|
|
45
261
|
* ```ts
|
|
46
|
-
*
|
|
47
|
-
*
|
|
262
|
+
* // by default removes all accents and metheg and rafe
|
|
263
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ");
|
|
264
|
+
* // שָׂרַי אִשְׁתְּךָ, וַיִּמְצְאוּ
|
|
48
265
|
* ```
|
|
49
266
|
*
|
|
50
|
-
* @example Remove vowels
|
|
267
|
+
* @example Remove accents and vowels, but not shin/sin dots
|
|
51
268
|
*
|
|
52
269
|
* ```ts
|
|
53
|
-
*
|
|
54
|
-
*
|
|
270
|
+
* import { accents, vowelsl } from "hebrew-transliteration/removeOptions";
|
|
271
|
+
*
|
|
272
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ", { ...accents, ...vowels, METEG: true });
|
|
273
|
+
* // שׂרי אשׁתך, וימצאו
|
|
55
274
|
* ```
|
|
56
275
|
*
|
|
57
276
|
* @example Remove all
|
|
58
277
|
*
|
|
59
278
|
* ```ts
|
|
60
|
-
*
|
|
61
|
-
*
|
|
279
|
+
* import { all } from "hebrew-transliteration/removeOptions";
|
|
280
|
+
*
|
|
281
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ", all);
|
|
282
|
+
* // שרי אשתך, וימצאו
|
|
62
283
|
* ```
|
|
63
284
|
*/
|
|
64
|
-
export declare const remove: (text: string,
|
|
285
|
+
export declare const remove: (text: string, options?: RemoveOptions) => string;
|
|
65
286
|
export {};
|
package/dist/remove.js
CHANGED
|
@@ -1,45 +1,213 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.remove = void 0;
|
|
3
|
+
exports.remove = exports.all = exports.marks = exports.punctuation = exports.vowels = exports.points = exports.accents = void 0;
|
|
4
4
|
const sequence_1 = require("./sequence");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
const removeMap = {
|
|
6
|
+
// accents //
|
|
7
|
+
ETNAHTA: "\u{0591}",
|
|
8
|
+
SEGOLTA: "\u{0592}",
|
|
9
|
+
SHALSHELET: "\u{0593}",
|
|
10
|
+
ZAQEF_QATAN: "\u{0594}",
|
|
11
|
+
ZAQEF_GADOL: "\u{0595}",
|
|
12
|
+
TIPEHA: "\u{0596}",
|
|
13
|
+
REVIA: "\u{0597}",
|
|
14
|
+
ZARQA: "\u{0598}",
|
|
15
|
+
PASHTA: "\u{0599}",
|
|
16
|
+
YETIV: "\u{059A}",
|
|
17
|
+
TEVIR: "\u{059B}",
|
|
18
|
+
GERESH: "\u{059C}",
|
|
19
|
+
GERESH_MUQDAM: "\u{059D}",
|
|
20
|
+
GERSHAYIM: "\u{059E}",
|
|
21
|
+
QARNEY_PARA: "\u{059F}",
|
|
22
|
+
TELISHA_GEDOLA: "\u{05A0}",
|
|
23
|
+
PAZER: "\u{05A1}",
|
|
24
|
+
ATNAH_HAFUKH: "\u{05A2}",
|
|
25
|
+
MUNAH: "\u{05A3}",
|
|
26
|
+
MAHAPAKH: "\u{05A4}",
|
|
27
|
+
MERKHA: "\u{05A5}",
|
|
28
|
+
MERKHA_KEFULA: "\u{05A6}",
|
|
29
|
+
DARGA: "\u{05A7}",
|
|
30
|
+
QADMA: "\u{05A8}",
|
|
31
|
+
TELISHA_QETANA: "\u{05A9}",
|
|
32
|
+
YERAH_BEN_YOMO: "\u{05AA}",
|
|
33
|
+
OLE: "\u{05AB}",
|
|
34
|
+
ILUY: "\u{05AC}",
|
|
35
|
+
DEHI: "\u{05AD}",
|
|
36
|
+
ZINOR: "\u{05AE}",
|
|
37
|
+
// points //
|
|
38
|
+
SHEVA: "\u{05B0}",
|
|
39
|
+
HATAF_SEGOL: "\u{05B1}",
|
|
40
|
+
HATAF_PATAH: "\u{05B2}",
|
|
41
|
+
HATAF_QAMATS: "\u{05B3}",
|
|
42
|
+
HIRIQ: "\u{05B4}",
|
|
43
|
+
TSERE: "\u{05B5}",
|
|
44
|
+
SEGOL: "\u{05B6}",
|
|
45
|
+
PATAH: "\u{05B7}",
|
|
46
|
+
QAMATS: "\u{05B8}",
|
|
47
|
+
HOLAM: "\u{05B9}",
|
|
48
|
+
// below is not needed because sequnce() does not output this
|
|
49
|
+
// HOLAM_HASER_FOR_VAV: "\u{05BA}", // HEBREW POINT HOLAM HASER FOR VAV
|
|
50
|
+
QUBUTS: "\u{05BB}",
|
|
51
|
+
DAGESH: "\u{05BC}",
|
|
52
|
+
METEG: "\u{05BD}",
|
|
53
|
+
RAFE: "\u{05BF}",
|
|
54
|
+
SHIN_DOT: "\u{05C1}",
|
|
55
|
+
SIN_DOT: "\u{05C2}",
|
|
56
|
+
QAMATS_QATAN: "\u{05C7}",
|
|
57
|
+
MAQAF: "\u{05BE}",
|
|
58
|
+
PASEQ: "\u{05C0}",
|
|
59
|
+
SOF_PASUQ: "\u{05C3}",
|
|
60
|
+
NUN_HAFUKHA: "\u{05C6}",
|
|
61
|
+
// the punctuation geresh/gereshayim is different then the accent ones
|
|
62
|
+
PUNC_GERESH: "\u{05F3}",
|
|
63
|
+
PUNC_GERSHAYIM: "\u{05F4}",
|
|
64
|
+
MASORA_CIRCLE: "\u{05AF}",
|
|
65
|
+
UPPER_DOT: "\u{05C4}",
|
|
66
|
+
LOWER_DOT: "\u{05C5}" // U+LOWER DOT HEBREW MARK 05C5];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* removes all chars called HEBREW ACCENT (U+0591-05AF)
|
|
70
|
+
*/
|
|
71
|
+
exports.accents = {
|
|
72
|
+
ETNAHTA: true,
|
|
73
|
+
SEGOLTA: true,
|
|
74
|
+
SHALSHELET: true,
|
|
75
|
+
ZAQEF_QATAN: true,
|
|
76
|
+
ZAQEF_GADOL: true,
|
|
77
|
+
TIPEHA: true,
|
|
78
|
+
REVIA: true,
|
|
79
|
+
ZARQA: true,
|
|
80
|
+
PASHTA: true,
|
|
81
|
+
YETIV: true,
|
|
82
|
+
TEVIR: true,
|
|
83
|
+
GERESH: true,
|
|
84
|
+
GERESH_MUQDAM: true,
|
|
85
|
+
GERSHAYIM: true,
|
|
86
|
+
QARNEY_PARA: true,
|
|
87
|
+
TELISHA_GEDOLA: true,
|
|
88
|
+
PAZER: true,
|
|
89
|
+
ATNAH_HAFUKH: true,
|
|
90
|
+
MUNAH: true,
|
|
91
|
+
MAHAPAKH: true,
|
|
92
|
+
MERKHA: true,
|
|
93
|
+
MERKHA_KEFULA: true,
|
|
94
|
+
DARGA: true,
|
|
95
|
+
QADMA: true,
|
|
96
|
+
TELISHA_QETANA: true,
|
|
97
|
+
YERAH_BEN_YOMO: true,
|
|
98
|
+
OLE: true,
|
|
99
|
+
ILUY: true,
|
|
100
|
+
DEHI: true,
|
|
101
|
+
ZINOR: true
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* removes all chars called HEBREW POINT (U+05B0-05BD, U+05BF, U+05C1-05C2 and U+05C7)
|
|
105
|
+
*/
|
|
106
|
+
exports.points = {
|
|
107
|
+
SHEVA: true,
|
|
108
|
+
HATAF_SEGOL: true,
|
|
109
|
+
HATAF_PATAH: true,
|
|
110
|
+
HATAF_QAMATS: true,
|
|
111
|
+
HIRIQ: true,
|
|
112
|
+
TSERE: true,
|
|
113
|
+
SEGOL: true,
|
|
114
|
+
PATAH: true,
|
|
115
|
+
QAMATS: true,
|
|
116
|
+
HOLAM: true,
|
|
117
|
+
QUBUTS: true,
|
|
118
|
+
DAGESH: true,
|
|
119
|
+
SHIN_DOT: true,
|
|
120
|
+
SIN_DOT: true,
|
|
121
|
+
METEG: true,
|
|
122
|
+
RAFE: true,
|
|
123
|
+
QAMATS_QATAN: true
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* removes chars called HEBREW POINT (U+05B0-05BC and U+05C7) except for:
|
|
127
|
+
* - SHIN_DOT
|
|
128
|
+
* - SIN_DOT
|
|
129
|
+
* - METEG
|
|
130
|
+
* - RAFE
|
|
131
|
+
*/
|
|
132
|
+
exports.vowels = {
|
|
133
|
+
SHEVA: true,
|
|
134
|
+
HATAF_SEGOL: true,
|
|
135
|
+
HATAF_PATAH: true,
|
|
136
|
+
HATAF_QAMATS: true,
|
|
137
|
+
HIRIQ: true,
|
|
138
|
+
TSERE: true,
|
|
139
|
+
SEGOL: true,
|
|
140
|
+
PATAH: true,
|
|
141
|
+
QAMATS: true,
|
|
142
|
+
HOLAM: true,
|
|
143
|
+
QUBUTS: true,
|
|
144
|
+
DAGESH: true,
|
|
145
|
+
QAMATS_QATAN: true
|
|
146
|
+
};
|
|
10
147
|
/**
|
|
11
|
-
* removes
|
|
148
|
+
* removes all chars called HEBREW PUNCTUATION (U+05BE, U+05C0, U+05C3, and U+05C6)
|
|
149
|
+
*/
|
|
150
|
+
exports.punctuation = {
|
|
151
|
+
MAQAF: true,
|
|
152
|
+
PASEQ: true,
|
|
153
|
+
SOF_PASUQ: true,
|
|
154
|
+
NUN_HAFUKHA: true,
|
|
155
|
+
PUNC_GERESH: true,
|
|
156
|
+
PUNC_GERSHAYIM: true
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* removes all chars called HEBREW MARK (U+05AF, U+05C4, and U+05C5)
|
|
160
|
+
*/
|
|
161
|
+
exports.marks = {
|
|
162
|
+
MASORA_CIRCLE: true,
|
|
163
|
+
UPPER_DOT: true,
|
|
164
|
+
LOWER_DOT: true
|
|
165
|
+
};
|
|
166
|
+
exports.all = Object.assign(Object.assign(Object.assign(Object.assign({}, exports.accents), exports.points), exports.punctuation), exports.marks);
|
|
167
|
+
/**
|
|
168
|
+
* removes niqqud from Hebrew text
|
|
12
169
|
*
|
|
13
170
|
* @param text - a string of Hebrew characters
|
|
14
|
-
* @param
|
|
15
|
-
* @returns Hebrew characters with
|
|
171
|
+
* @param options
|
|
172
|
+
* @returns Hebrew characters with accents and niqqud optionally removed
|
|
16
173
|
*
|
|
17
174
|
* @example Default
|
|
18
175
|
*
|
|
19
176
|
* ```ts
|
|
20
|
-
*
|
|
21
|
-
*
|
|
177
|
+
* // by default removes all accents and metheg and rafe
|
|
178
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ");
|
|
179
|
+
* // שָׂרַי אִשְׁתְּךָ, וַיִּמְצְאוּ
|
|
22
180
|
* ```
|
|
23
181
|
*
|
|
24
|
-
* @example Remove vowels
|
|
182
|
+
* @example Remove accents and vowels, but not shin/sin dots
|
|
25
183
|
*
|
|
26
184
|
* ```ts
|
|
27
|
-
*
|
|
28
|
-
*
|
|
185
|
+
* import { accents, vowelsl } from "hebrew-transliteration/removeOptions";
|
|
186
|
+
*
|
|
187
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ", { ...accents, ...vowels, METEG: true });
|
|
188
|
+
* // שׂרי אשׁתך, וימצאו
|
|
29
189
|
* ```
|
|
30
190
|
*
|
|
31
191
|
* @example Remove all
|
|
32
192
|
*
|
|
33
193
|
* ```ts
|
|
34
|
-
*
|
|
35
|
-
*
|
|
194
|
+
* import { all } from "hebrew-transliteration/removeOptions";
|
|
195
|
+
*
|
|
196
|
+
* remove("שָׂרַ֣י אִשְׁתְּךָ֔, וַֽיִּמְצְא֗וּ", all);
|
|
197
|
+
* // שרי אשתך, וימצאו
|
|
36
198
|
* ```
|
|
37
199
|
*/
|
|
38
|
-
const remove = (text,
|
|
200
|
+
const remove = (text, options = Object.assign(Object.assign({}, exports.accents), { METEG: true, RAFE: true })) => {
|
|
201
|
+
/** all the keys of options that are to be removed */
|
|
202
|
+
const keys = Object.keys(options).filter((k) => (k in options ? options[k] : false));
|
|
39
203
|
const sequenced = (0, sequence_1.sequence)(text);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
204
|
+
return keys.reduce((a, c) => {
|
|
205
|
+
var _a;
|
|
206
|
+
const key = (_a = removeMap[c]) !== null && _a !== void 0 ? _a : null;
|
|
207
|
+
if (key) {
|
|
208
|
+
return a.replace(new RegExp(key, "gu"), "");
|
|
209
|
+
}
|
|
210
|
+
return a;
|
|
211
|
+
}, sequenced);
|
|
44
212
|
};
|
|
45
213
|
exports.remove = remove;
|
package/dist/schema.d.ts
CHANGED
|
@@ -468,13 +468,14 @@ export declare class Schema implements SylOpts {
|
|
|
468
468
|
location: "before-syllable" | "after-syllable" | "before-vowel" | "after-vowel";
|
|
469
469
|
mark: string;
|
|
470
470
|
};
|
|
471
|
+
allowNoNiqqud: SylOpts["allowNoNiqqud"];
|
|
472
|
+
article: SylOpts["article"];
|
|
473
|
+
holemHaser: SylOpts["holemHaser"];
|
|
471
474
|
longVowels: SylOpts["longVowels"];
|
|
472
475
|
qametsQatan: SylOpts["qametsQatan"];
|
|
473
476
|
sqnmlvy: SylOpts["sqnmlvy"];
|
|
474
|
-
wawShureq: SylOpts["wawShureq"];
|
|
475
|
-
article: SylOpts["article"];
|
|
476
|
-
allowNoNiqqud: SylOpts["allowNoNiqqud"];
|
|
477
477
|
strict: SylOpts["strict"];
|
|
478
|
+
wawShureq: SylOpts["wawShureq"];
|
|
478
479
|
constructor(schema: Schema);
|
|
479
480
|
}
|
|
480
481
|
export declare class SBL extends Schema {
|
package/dist/schema.js
CHANGED
|
@@ -78,6 +78,7 @@ class Schema {
|
|
|
78
78
|
(this.article = schema.article),
|
|
79
79
|
(this.allowNoNiqqud = schema.allowNoNiqqud),
|
|
80
80
|
(this.strict = schema.strict);
|
|
81
|
+
this.holemHaser = schema.holemHaser;
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
84
|
exports.Schema = Schema;
|
|
@@ -156,7 +157,8 @@ class SBL extends Schema {
|
|
|
156
157
|
wawShureq: (_44 = schema.wawShureq) !== null && _44 !== void 0 ? _44 : true,
|
|
157
158
|
article: (_45 = schema.article) !== null && _45 !== void 0 ? _45 : true,
|
|
158
159
|
allowNoNiqqud: (_46 = schema.allowNoNiqqud) !== null && _46 !== void 0 ? _46 : true,
|
|
159
|
-
strict: (_47 = schema.strict) !== null && _47 !== void 0 ? _47 : false
|
|
160
|
+
strict: (_47 = schema.strict) !== null && _47 !== void 0 ? _47 : false,
|
|
161
|
+
holemHaser: schema.holemHaser || "remove"
|
|
160
162
|
});
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -61,11 +61,24 @@ exports.sblSimple = {
|
|
|
61
61
|
SOF_PASUQ: "",
|
|
62
62
|
MAQAF: "-",
|
|
63
63
|
DIVINE_NAME: "yhwh",
|
|
64
|
+
ADDITIONAL_FEATURES: [
|
|
65
|
+
{
|
|
66
|
+
FEATURE: "cluster",
|
|
67
|
+
HEBREW: "\u{05E9}\u{05C1}\u{05BC}",
|
|
68
|
+
TRANSLITERATION: "sh"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
FEATURE: "cluster",
|
|
72
|
+
HEBREW: "\u{05E6}\u{05BC}",
|
|
73
|
+
TRANSLITERATION: "ts"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
64
76
|
longVowels: true,
|
|
65
77
|
sqnmlvy: true,
|
|
66
78
|
qametsQatan: true,
|
|
67
79
|
wawShureq: true,
|
|
68
80
|
article: true,
|
|
69
81
|
allowNoNiqqud: true,
|
|
70
|
-
strict: false
|
|
82
|
+
strict: false,
|
|
83
|
+
holemHaser: "remove"
|
|
71
84
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hebrew-transliteration",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "a package for transliterating Hebrew",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,12 +15,20 @@
|
|
|
15
15
|
"types": "./dist/schemas/index.d.ts",
|
|
16
16
|
"require": "./dist/schemas/index.js",
|
|
17
17
|
"import": "./dist/schemas/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./removeOptions": {
|
|
20
|
+
"types": "./dist/remove.d.ts",
|
|
21
|
+
"require": "./dist/remove.js",
|
|
22
|
+
"import": "./dist/remove.js"
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
"typesVersions": {
|
|
21
26
|
"*": {
|
|
22
27
|
"schemas": [
|
|
23
28
|
"./dist/schemas/index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"removeOptions": [
|
|
31
|
+
"./dist/remove.d.ts"
|
|
24
32
|
]
|
|
25
33
|
}
|
|
26
34
|
},
|
|
@@ -56,22 +64,22 @@
|
|
|
56
64
|
"author": "Charles Loder",
|
|
57
65
|
"license": "MIT",
|
|
58
66
|
"devDependencies": {
|
|
59
|
-
"@types/jest": "^29.2.
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
61
|
-
"esbuild": "^0.
|
|
62
|
-
"eslint": "^8.
|
|
67
|
+
"@types/jest": "^29.2.4",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
69
|
+
"esbuild": "^0.16.8",
|
|
70
|
+
"eslint": "^8.30.0",
|
|
63
71
|
"eslint-config-prettier": "^8.5.0",
|
|
64
|
-
"eslint-plugin-jest": "^27.1.
|
|
65
|
-
"eslint-plugin-jsdoc": "^39.6.
|
|
72
|
+
"eslint-plugin-jest": "^27.1.7",
|
|
73
|
+
"eslint-plugin-jsdoc": "^39.6.4",
|
|
66
74
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
67
75
|
"jest": "^29.3.1",
|
|
68
|
-
"npm-check-updates": "^16.
|
|
76
|
+
"npm-check-updates": "^16.6.0",
|
|
69
77
|
"npm-dts": "^1.3.12",
|
|
70
|
-
"prettier": "^2.
|
|
78
|
+
"prettier": "^2.8.1",
|
|
71
79
|
"ts-jest": "^29.0.3",
|
|
72
|
-
"typescript": "^4.
|
|
80
|
+
"typescript": "^4.9.4"
|
|
73
81
|
},
|
|
74
82
|
"dependencies": {
|
|
75
|
-
"havarotjs": "^0.
|
|
83
|
+
"havarotjs": "^0.12.0"
|
|
76
84
|
}
|
|
77
85
|
}
|
package/dist/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.romaniote = void 0;
|
|
4
|
-
exports.romaniote = {
|
|
5
|
-
ALEF: "",
|
|
6
|
-
BET: "β",
|
|
7
|
-
BET_DAGESH: "μπ",
|
|
8
|
-
GIMEL: "γ",
|
|
9
|
-
GIMEL_DAGESH: "γκ",
|
|
10
|
-
DALET: "δ",
|
|
11
|
-
DALET_DAGESH: "ντ",
|
|
12
|
-
HE: "",
|
|
13
|
-
VAV: "β",
|
|
14
|
-
ZAYIN: "ζ",
|
|
15
|
-
HET: "χ",
|
|
16
|
-
TET: "τ",
|
|
17
|
-
YOD: "γι",
|
|
18
|
-
KAF: "χ",
|
|
19
|
-
KAF_DAGESH: "κ",
|
|
20
|
-
FINAL_KAF: "χ",
|
|
21
|
-
LAMED: "λ",
|
|
22
|
-
MEM: "μ",
|
|
23
|
-
FINAL_MEM: "μ",
|
|
24
|
-
NUN: "ν",
|
|
25
|
-
FINAL_NUN: "ν",
|
|
26
|
-
SAMEKH: "σ",
|
|
27
|
-
AYIN: "",
|
|
28
|
-
PE: "φ",
|
|
29
|
-
PE_DAGESH: "π",
|
|
30
|
-
FINAL_PE: "φ",
|
|
31
|
-
TSADI: "τσ",
|
|
32
|
-
FINAL_TSADI: "τσ",
|
|
33
|
-
QOF: "κ",
|
|
34
|
-
RESH: "ρ",
|
|
35
|
-
SIN: "σ",
|
|
36
|
-
SHIN: "σσ",
|
|
37
|
-
TAV: "θ",
|
|
38
|
-
TAV_DAGESH: "τ",
|
|
39
|
-
DAGESH: "",
|
|
40
|
-
DAGESH_CHAZAQ: true,
|
|
41
|
-
VOCAL_SHEVA: "ε",
|
|
42
|
-
PATAH: "α",
|
|
43
|
-
HATAF_PATAH: "α",
|
|
44
|
-
QAMATS: "α",
|
|
45
|
-
HATAF_QAMATS: "ο",
|
|
46
|
-
SEGOL: "ε",
|
|
47
|
-
HATAF_SEGOL: "ε",
|
|
48
|
-
TSERE: "ε",
|
|
49
|
-
HIRIQ: "ι",
|
|
50
|
-
HOLAM: "ω",
|
|
51
|
-
QUBUTS: "ου",
|
|
52
|
-
QAMATS_HE: "α",
|
|
53
|
-
SEGOL_HE: "ε",
|
|
54
|
-
TSERE_HE: "ε",
|
|
55
|
-
SEGOL_YOD: "ε",
|
|
56
|
-
HIRIQ_YOD: "η",
|
|
57
|
-
TSERE_YOD: "ε",
|
|
58
|
-
FURTIVE_PATAH: "a",
|
|
59
|
-
QAMATS_QATAN: "o",
|
|
60
|
-
HOLAM_VAV: "o",
|
|
61
|
-
SHUREQ: "ου",
|
|
62
|
-
MS_SUFX: "άβ",
|
|
63
|
-
PASEQ: "",
|
|
64
|
-
SOF_PASUQ: "",
|
|
65
|
-
MAQAF: "-",
|
|
66
|
-
DIVINE_NAME: "Αδωνάη",
|
|
67
|
-
ADDITIONAL_FEATURES: [
|
|
68
|
-
{
|
|
69
|
-
FEATURE: "cluster",
|
|
70
|
-
HEBREW: "זּ",
|
|
71
|
-
TRANSLITERATION: "τζ"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
FEATURE: "syllable",
|
|
75
|
-
HEBREW: "ִים",
|
|
76
|
-
TRANSLITERATION: "είμ"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
FEATURE: "syllable",
|
|
80
|
-
HEBREW: "\u{05B5}\u{05D9}$",
|
|
81
|
-
TRANSLITERATION: "αί"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
FEATURE: "syllable",
|
|
85
|
-
HEBREW: "\u{05B5}\u{05D9}[\u{05BE}|-]?$",
|
|
86
|
-
TRANSLITERATION: "αί-"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
longVowels: true,
|
|
90
|
-
sqnmlvy: true,
|
|
91
|
-
qametsQatan: true,
|
|
92
|
-
wawShureq: true,
|
|
93
|
-
article: true,
|
|
94
|
-
allowNoNiqqud: true,
|
|
95
|
-
strict: false
|
|
96
|
-
};
|