ochre-sdk 1.3.5 → 1.3.6

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 CHANGED
@@ -100,11 +100,14 @@ title.isEmpty();
100
100
  title.hasContent();
101
101
  title.hasLanguage("tur");
102
102
  title.hasAliases();
103
+ title.isNonLinguistic();
103
104
 
104
105
  title.getAvailableLanguages(); // languages that carry content
105
106
  title.getSupportedLanguages(); // languages the string was built to hold
106
107
  ```
107
108
 
109
+ OCHRE publishes `zxx` content in two senses, and the string tells them apart by the only thing that distinguishes them: whether another language stands beside it. Beside a field's languages, `zxx` content names the same thing again, so it is read as aliases (`getAliases()`). Standing alone, it is the text itself in no language, such as an identifier, so it is read as non-linguistic text: `isNonLinguistic()` is true, every language reads it through `getText`, and it has no aliases. Every string, however it is built or edited, follows the same rule, so adding a language to a non-linguistic string turns its text into aliases, as the same content would be read.
110
+
108
111
  Writes return a new string and never mutate the original.
109
112
 
110
113
  ```ts
@@ -129,6 +132,20 @@ const languages = defineLanguages("eng", "tur");
129
132
  const result = await fetchWebsite("uchicago-node", { languages });
130
133
  ```
131
134
 
135
+ ## Language Codes
136
+
137
+ OCHRE publishes ISO 639-2/B language codes, the Library of Congress MARC convention, and every language the SDK reads or accepts uses them: the bibliographic code wherever ISO 639-2 has one (`per` for Persian, not ISO 639-3 `fas`; `fre`, `chi`, `ger`), the ISO 639-3 identifier where it has none (`yua`, `lzh`), and a few codes of its own for transliterations and vocabularies (`ota-xlt`, `rel`), some of which collide with unrelated ISO 639-3 languages. Requests in any other code are rejected, with the OCHRE code to use when one exists.
138
+
139
+ `OCHRE_LANGUAGES` maps every code OCHRE publishes to its name, what it tags (a `language`, a `transliteration`, a `vocabulary` or `non-linguistic` content), its ISO 639-3 identifier and the BCP 47 tag to give `Intl` or an HTML `lang` attribute. Either standard is `null` when none fits.
140
+
141
+ ```ts
142
+ import { getOchreLanguage, getOchreLanguageCode } from "ochre-sdk";
143
+
144
+ getOchreLanguage("per"); // { name: "Persian", kind: "language", iso639_3: "fas", bcp47: "fa" }
145
+ getOchreLanguage("ota-xlt")?.bcp47; // "ota-Latn-t-ota-arab"
146
+ getOchreLanguageCode("fas"); // "per"
147
+ ```
148
+
132
149
  ## Set Queries
133
150
 
134
151
  Set fetchers accept a recursive `Query` tree. Leaf queries can target full text,
package/dist/index.d.mts CHANGED
@@ -15,5 +15,6 @@ import { fetchWebsiteMetadata } from "./fetchers/website-metadata.mjs";
15
15
  import { fetchWebsite } from "./fetchers/website.mjs";
16
16
  import { PropertyOptions, PropertySelector, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel } from "./getters.mjs";
17
17
  import { flattenItemProperties } from "./helpers.mjs";
18
+ import { OCHRE_LANGUAGES, OchreLanguage, OchreLanguageCode, OchreLanguageKind, getOchreLanguage, getOchreLanguageCode, isOchreLanguageCode } from "./languages.mjs";
18
19
  import { defineLanguages } from "./parsers/languages.mjs";
19
- export { type AccordionWebBlock, type AnyBibliography, type AnyConcept, type AnyItem, type AnyPeriod, type AnyPerson, type AnyPropertyValue, type AnyPropertyVariable, type AnyResource, type AnySet, type AnySpatialUnit, type AnyText, type AnyTree, type BaseItem, type BaseItemLink, type BelongsTo, type Bibliography, type BibliographyEntryInfo, type BibliographyItemLink, type BibliographySourceDocument, type Concept, type ConceptItemLink, type ContainedItemCategory, type ContainedItemCategoryFromOption, type ContainedItemCategoryOption, type Context, type ContextItem, type ContextItemCategory, type ContextNode, type ContextTree, type ContextTreeFilterLevel, type ContextTreeFilterVariant, type ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, type EmbeddedBibliography, type EmbeddedConcept, type EmbeddedItem, type EmbeddedPeriod, type EmbeddedPerson, type EmbeddedPropertyValue, type EmbeddedPropertyVariable, type EmbeddedResource, type EmbeddedSet, type EmbeddedSpatialUnit, type EmbeddedText, type EmbeddedTree, type Event, type Gallery, type Heading, type HeadingItemCategory, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type Item, type ItemCategory, type ItemCategoryFromOption, type ItemCategoryOption, type ItemCategoryWithEmbeddedItems, type ItemContainerCategory, type ItemLink, type ItemLinkCategory, type ItemLinks, type ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, type Observation, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Property, type PropertyLike, type PropertyOptions, type PropertyRelation, type PropertySelector, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type ProtectedWebsite, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type ResponsiveStyles, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemLocation, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetStyle, type SetStyleProperty, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type WebRelationVariant, type WebSectionDisplay, type WebSectionVariant, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePrivacy, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItemLocations, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel };
20
+ export { type AccordionWebBlock, type AnyBibliography, type AnyConcept, type AnyItem, type AnyPeriod, type AnyPerson, type AnyPropertyValue, type AnyPropertyVariable, type AnyResource, type AnySet, type AnySpatialUnit, type AnyText, type AnyTree, type BaseItem, type BaseItemLink, type BelongsTo, type Bibliography, type BibliographyEntryInfo, type BibliographyItemLink, type BibliographySourceDocument, type Concept, type ConceptItemLink, type ContainedItemCategory, type ContainedItemCategoryFromOption, type ContainedItemCategoryOption, type Context, type ContextItem, type ContextItemCategory, type ContextNode, type ContextTree, type ContextTreeFilterLevel, type ContextTreeFilterVariant, type ContextTreeLevel, type ContextTreeLevelItem, type Coordinates, type CoordinatesSource, DEFAULT_PAGE_SIZE, type DictionaryUnitItemLink, type EmbeddedBibliography, type EmbeddedConcept, type EmbeddedItem, type EmbeddedPeriod, type EmbeddedPerson, type EmbeddedPropertyValue, type EmbeddedPropertyVariable, type EmbeddedResource, type EmbeddedSet, type EmbeddedSpatialUnit, type EmbeddedText, type EmbeddedTree, type Event, type Gallery, type Heading, type HeadingItemCategory, type Identification, type Image, type ImageMap, type ImageMapArea, type Interpretation, type Item, type ItemCategory, type ItemCategoryFromOption, type ItemCategoryOption, type ItemCategoryWithEmbeddedItems, type ItemContainerCategory, type ItemLink, type ItemLinkCategory, type ItemLinks, type ItemPayloadKind, type ItemProperty, type ItemWithoutEmbeddedItems, type LanguageCodes, type License, type Metadata, type MultilingualOptions, MultilingualString, type MultilingualStringEntries, type MultilingualStringEntry, type MultilingualStringInput, type MultilingualStringJSON, type MultilingualStringObject, type MultilingualStringText, type Note, OCHRE_LANGUAGES, type Observation, type OchreLanguage, type OchreLanguageCode, type OchreLanguageKind, type OcrString, type Period, type PeriodItemLink, type Person, type PersonItemLink, type Property, type PropertyLike, type PropertyOptions, type PropertyRelation, type PropertySelector, type PropertyValue, type PropertyValueContent, type PropertyValueDataType, type PropertyValueItemLink, type PropertyValueQueryItem, type PropertyVariable, type PropertyVariableItemLink, type ProtectedWebsite, type Query, type QueryGroup, type QueryLeaf, type QueryablePropertyValueDataType, type RecursiveItemCategory, type Resource, type ResourceItemLink, type ResponsiveStyles, type Scope, type Section, type Set, type SetAttributeValueQueryItem, type SetBibliography, type SetConcept, type SetItem, type SetItemCategory, type SetItemLink, type SetItemLocation, type SetItemProperty, type SetItemSimplifiedProperty, type SetItemsSort, type SetItemsSortDirection, type SetPeriod, type SetResource, type SetSpatialUnit, type SetStyle, type SetStyleProperty, type SetTree, type SimplifiedProperty, type SpatialUnit, type SpatialUnitItemLink, type Style, type StylesheetCategory, type StylesheetItem, type Text, type TextItemLink, type TopLevelItem, type Tree, type TreeItemCategory, type TreeItemLink, type WebAccordionItem, type WebBlock, type WebBlockByLayout, type WebBlockItem, type WebBlockLayout, type WebElement, type WebElementComponent, type WebElementComponentName, type WebElementComponentOf, type WebElementOf, type WebIiifViewer, type WebImage, type WebLoadingVariant, type WebOptions, type WebRelationVariant, type WebSectionDisplay, type WebSectionVariant, type WebSidebar, type WebTitle, type Webpage, type Website, type WebsiteMetadata, type WebsitePrivacy, type WebsitePropertyQuery, type WebsitePropertyQueryNode, type WebsiteSegment, type WebsiteType, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItemLocations, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getOchreLanguage, getOchreLanguageCode, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isOchreLanguageCode, isPropertyMatchingFilter, normalizePropertyVariableLabel };
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import { DEFAULT_PAGE_SIZE } from "./constants.mjs";
2
2
  import { getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel } from "./getters.mjs";
3
3
  import { flattenItemProperties } from "./helpers.mjs";
4
4
  import { MultilingualString } from "./parsers/multilingual.mjs";
5
+ import { OCHRE_LANGUAGES, getOchreLanguage, getOchreLanguageCode, isOchreLanguageCode } from "./languages.mjs";
5
6
  import { defineLanguages } from "./parsers/languages.mjs";
6
7
  import { fetchGallery } from "./fetchers/gallery.mjs";
7
8
  import { fetchItemChildren } from "./fetchers/item-children.mjs";
@@ -14,4 +15,4 @@ import { fetchSetPropertyValues } from "./fetchers/set/property-values.mjs";
14
15
  import { fetchTreeItems } from "./fetchers/tree/items.mjs";
15
16
  import { fetchWebsiteMetadata } from "./fetchers/website-metadata.mjs";
16
17
  import { fetchWebsite } from "./fetchers/website.mjs";
17
- export { DEFAULT_PAGE_SIZE, MultilingualString, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItemLocations, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isPropertyMatchingFilter, normalizePropertyVariableLabel };
18
+ export { DEFAULT_PAGE_SIZE, MultilingualString, OCHRE_LANGUAGES, defineLanguages, fetchGallery, fetchItem, fetchItemChildren, fetchItemLinks, fetchItemOcrData, fetchSetItemLocations, fetchSetItems, fetchSetPropertyValues, fetchTreeItems, fetchWebsite, fetchWebsiteMetadata, flattenItemProperties, getLeafPropertyValues, getOchreLanguage, getOchreLanguageCode, getProperty, getPropertyValue, getPropertyValues, getUniqueProperties, getUniquePropertyVariableLabels, isOchreLanguageCode, isPropertyMatchingFilter, normalizePropertyVariableLabel };
@@ -0,0 +1,582 @@
1
+ //#region src/languages.d.ts
2
+ /**
3
+ * What an OCHRE language code tags
4
+ *
5
+ * - `language`: text in a natural language
6
+ * - `transliteration`: a language written in another script (`ota-xlt`)
7
+ * - `vocabulary`: codes or notation that are not a language (`rel`)
8
+ * - `non-linguistic`: `zxx`, which OCHRE publishes for aliases and for
9
+ * labels that are not in any language
10
+ */
11
+ export type OchreLanguageKind = "language" | "transliteration" | "vocabulary" | "non-linguistic";
12
+ /**
13
+ * A language code OCHRE publishes, with the standard codes it stands for
14
+ */
15
+ export type OchreLanguage = {
16
+ /**
17
+ * The English name of the language
18
+ */
19
+ name: string;
20
+ /**
21
+ * What the code tags
22
+ */
23
+ kind: OchreLanguageKind;
24
+ /**
25
+ * The ISO 639-3 identifier of the language, or null when the code tags
26
+ * no language, or a language ISO 639-3 does not code
27
+ */
28
+ iso639_3: string | null;
29
+ /**
30
+ * The BCP 47 tag to hand to `Intl` and HTML `lang` attributes, or null
31
+ * when no standard tag fits
32
+ */
33
+ bcp47: string | null;
34
+ };
35
+ /**
36
+ * Every language code OCHRE publishes, mapped to the ISO 639-3 and BCP 47
37
+ * codes it stands for
38
+ *
39
+ * OCHRE publishes ISO 639-2/B codes, the Library of Congress MARC
40
+ * convention: the bibliographic code wherever ISO 639-2 has one (`per`,
41
+ * not ISO 639-3 `fas`), the ISO 639-3 identifier where it has none
42
+ * (`yua`), and a few codes of its own (`ota-xlt`, `rel`), some of which
43
+ * collide with unrelated ISO 639-3 languages. Key everything by these codes,
44
+ * because they are what OCHRE serves, and convert through this table when a
45
+ * standard code is needed.
46
+ */
47
+ export declare const OCHRE_LANGUAGES: {
48
+ readonly akk: {
49
+ readonly name: "Akkadian";
50
+ readonly kind: "language";
51
+ readonly iso639_3: "akk";
52
+ readonly bcp47: "akk";
53
+ };
54
+ readonly xno: {
55
+ readonly name: "Anglo-Norman";
56
+ readonly kind: "language";
57
+ readonly iso639_3: "xno";
58
+ readonly bcp47: "xno";
59
+ };
60
+ readonly ara: {
61
+ readonly name: "Arabic";
62
+ readonly kind: "language";
63
+ readonly iso639_3: "ara";
64
+ readonly bcp47: "ar";
65
+ };
66
+ readonly arc: {
67
+ readonly name: "Aramaic";
68
+ readonly kind: "language";
69
+ readonly iso639_3: "arc";
70
+ readonly bcp47: "arc";
71
+ };
72
+ readonly arm: {
73
+ readonly name: "Armenian";
74
+ readonly kind: "language";
75
+ readonly iso639_3: "hye";
76
+ readonly bcp47: "hy";
77
+ };
78
+ readonly bel: {
79
+ readonly name: "Belarusian";
80
+ readonly kind: "language";
81
+ readonly iso639_3: "bel";
82
+ readonly bcp47: "be";
83
+ };
84
+ readonly ben: {
85
+ readonly name: "Bengali";
86
+ readonly kind: "language";
87
+ readonly iso639_3: "ben";
88
+ readonly bcp47: "bn";
89
+ };
90
+ readonly btc: {
91
+ readonly name: "Betacode";
92
+ readonly kind: "vocabulary";
93
+ readonly iso639_3: null;
94
+ readonly bcp47: "grc-Latn-x-betacode";
95
+ };
96
+ readonly bos: {
97
+ readonly name: "Bosnian";
98
+ readonly kind: "language";
99
+ readonly iso639_3: "bos";
100
+ readonly bcp47: "bs";
101
+ };
102
+ readonly bul: {
103
+ readonly name: "Bulgarian";
104
+ readonly kind: "language";
105
+ readonly iso639_3: "bul";
106
+ readonly bcp47: "bg";
107
+ };
108
+ readonly cnn: {
109
+ readonly name: "Canaanite";
110
+ readonly kind: "language";
111
+ readonly iso639_3: null;
112
+ readonly bcp47: null;
113
+ };
114
+ readonly yue: {
115
+ readonly name: "Cantonese";
116
+ readonly kind: "language";
117
+ readonly iso639_3: "yue";
118
+ readonly bcp47: "yue";
119
+ };
120
+ readonly cat: {
121
+ readonly name: "Catalan";
122
+ readonly kind: "language";
123
+ readonly iso639_3: "cat";
124
+ readonly bcp47: "ca";
125
+ };
126
+ readonly chi: {
127
+ readonly name: "Chinese";
128
+ readonly kind: "language";
129
+ readonly iso639_3: "zho";
130
+ readonly bcp47: "zh";
131
+ };
132
+ readonly chu: {
133
+ readonly name: "Church Slavonic";
134
+ readonly kind: "language";
135
+ readonly iso639_3: "chu";
136
+ readonly bcp47: "cu";
137
+ };
138
+ readonly lzh: {
139
+ readonly name: "Classical Chinese";
140
+ readonly kind: "language";
141
+ readonly iso639_3: "lzh";
142
+ readonly bcp47: "lzh";
143
+ };
144
+ readonly cop: {
145
+ readonly name: "Coptic";
146
+ readonly kind: "language";
147
+ readonly iso639_3: "cop";
148
+ readonly bcp47: "cop";
149
+ };
150
+ readonly hrv: {
151
+ readonly name: "Croatian";
152
+ readonly kind: "language";
153
+ readonly iso639_3: "hrv";
154
+ readonly bcp47: "hr";
155
+ };
156
+ readonly cze: {
157
+ readonly name: "Czech";
158
+ readonly kind: "language";
159
+ readonly iso639_3: "ces";
160
+ readonly bcp47: "cs";
161
+ };
162
+ readonly egyd: {
163
+ readonly name: "Demotic";
164
+ readonly kind: "language";
165
+ readonly iso639_3: "egy";
166
+ readonly bcp47: "egy-Egyd";
167
+ };
168
+ readonly nld: {
169
+ readonly name: "Dutch";
170
+ readonly kind: "language";
171
+ readonly iso639_3: "nld";
172
+ readonly bcp47: "nl";
173
+ };
174
+ readonly dum: {
175
+ readonly name: "Dutch (Middle)";
176
+ readonly kind: "language";
177
+ readonly iso639_3: "dum";
178
+ readonly bcp47: "dum";
179
+ };
180
+ readonly egy: {
181
+ readonly name: "Egyptian";
182
+ readonly kind: "language";
183
+ readonly iso639_3: "egy";
184
+ readonly bcp47: "egy";
185
+ };
186
+ readonly elx: {
187
+ readonly name: "Elamite";
188
+ readonly kind: "language";
189
+ readonly iso639_3: "elx";
190
+ readonly bcp47: "elx";
191
+ };
192
+ readonly eng: {
193
+ readonly name: "English";
194
+ readonly kind: "language";
195
+ readonly iso639_3: "eng";
196
+ readonly bcp47: "en";
197
+ };
198
+ readonly enm: {
199
+ readonly name: "English (Middle)";
200
+ readonly kind: "language";
201
+ readonly iso639_3: "enm";
202
+ readonly bcp47: "enm";
203
+ };
204
+ readonly ecy: {
205
+ readonly name: "Eteocypriot";
206
+ readonly kind: "language";
207
+ readonly iso639_3: "ecy";
208
+ readonly bcp47: "ecy";
209
+ };
210
+ readonly fre: {
211
+ readonly name: "French";
212
+ readonly kind: "language";
213
+ readonly iso639_3: "fra";
214
+ readonly bcp47: "fr";
215
+ };
216
+ readonly frm: {
217
+ readonly name: "French (Middle)";
218
+ readonly kind: "language";
219
+ readonly iso639_3: "frm";
220
+ readonly bcp47: "frm";
221
+ };
222
+ readonly fro: {
223
+ readonly name: "French (Old)";
224
+ readonly kind: "language";
225
+ readonly iso639_3: "fro";
226
+ readonly bcp47: "fro";
227
+ };
228
+ readonly geo: {
229
+ readonly name: "Georgian";
230
+ readonly kind: "language";
231
+ readonly iso639_3: "kat";
232
+ readonly bcp47: "ka";
233
+ };
234
+ readonly ger: {
235
+ readonly name: "German";
236
+ readonly kind: "language";
237
+ readonly iso639_3: "deu";
238
+ readonly bcp47: "de";
239
+ };
240
+ readonly nds: {
241
+ readonly name: "German (Low)";
242
+ readonly kind: "language";
243
+ readonly iso639_3: "nds";
244
+ readonly bcp47: "nds";
245
+ };
246
+ readonly gmh: {
247
+ readonly name: "German (Middle High)";
248
+ readonly kind: "language";
249
+ readonly iso639_3: "gmh";
250
+ readonly bcp47: "gmh";
251
+ };
252
+ readonly goh: {
253
+ readonly name: "German (Old High)";
254
+ readonly kind: "language";
255
+ readonly iso639_3: "goh";
256
+ readonly bcp47: "goh";
257
+ };
258
+ readonly grc: {
259
+ readonly name: "Greek";
260
+ readonly kind: "language";
261
+ readonly iso639_3: "grc";
262
+ readonly bcp47: "grc";
263
+ };
264
+ readonly guj: {
265
+ readonly name: "Gujarati";
266
+ readonly kind: "language";
267
+ readonly iso639_3: "guj";
268
+ readonly bcp47: "gu";
269
+ };
270
+ readonly "zh-Latn-pinyin": {
271
+ readonly name: "Hanyu Pinyin";
272
+ readonly kind: "transliteration";
273
+ readonly iso639_3: "cmn";
274
+ readonly bcp47: "zh-Latn-pinyin";
275
+ };
276
+ readonly htt: {
277
+ readonly name: "Hattian";
278
+ readonly kind: "language";
279
+ readonly iso639_3: "xht";
280
+ readonly bcp47: "xht";
281
+ };
282
+ readonly heb: {
283
+ readonly name: "Hebrew";
284
+ readonly kind: "language";
285
+ readonly iso639_3: "heb";
286
+ readonly bcp47: "he";
287
+ };
288
+ readonly hin: {
289
+ readonly name: "Hindi";
290
+ readonly kind: "language";
291
+ readonly iso639_3: "hin";
292
+ readonly bcp47: "hi";
293
+ };
294
+ readonly hit: {
295
+ readonly name: "Hittite";
296
+ readonly kind: "language";
297
+ readonly iso639_3: "hit";
298
+ readonly bcp47: "hit";
299
+ };
300
+ readonly xhu: {
301
+ readonly name: "Hurrian";
302
+ readonly kind: "language";
303
+ readonly iso639_3: "xhu";
304
+ readonly bcp47: "xhu";
305
+ };
306
+ readonly ita: {
307
+ readonly name: "Italian";
308
+ readonly kind: "language";
309
+ readonly iso639_3: "ita";
310
+ readonly bcp47: "it";
311
+ };
312
+ readonly jpn: {
313
+ readonly name: "Japanese";
314
+ readonly kind: "language";
315
+ readonly iso639_3: "jpn";
316
+ readonly bcp47: "ja";
317
+ };
318
+ readonly "jpn-xlt": {
319
+ readonly name: "Japanese XLit";
320
+ readonly kind: "transliteration";
321
+ readonly iso639_3: "jpn";
322
+ readonly bcp47: "ja-Latn-t-ja";
323
+ };
324
+ readonly kaz: {
325
+ readonly name: "Kazakh";
326
+ readonly kind: "language";
327
+ readonly iso639_3: "kaz";
328
+ readonly bcp47: "kk";
329
+ };
330
+ readonly kor: {
331
+ readonly name: "Korean";
332
+ readonly kind: "language";
333
+ readonly iso639_3: "kor";
334
+ readonly bcp47: "ko";
335
+ };
336
+ readonly lmc: {
337
+ readonly name: "Late Middle Chinese";
338
+ readonly kind: "language";
339
+ readonly iso639_3: "ltc";
340
+ readonly bcp47: "ltc";
341
+ };
342
+ readonly lat: {
343
+ readonly name: "Latin";
344
+ readonly kind: "language";
345
+ readonly iso639_3: "lat";
346
+ readonly bcp47: "la";
347
+ };
348
+ readonly xlt: {
349
+ readonly name: "Latin XLit";
350
+ readonly kind: "transliteration";
351
+ readonly iso639_3: null;
352
+ readonly bcp47: "und-Latn";
353
+ };
354
+ readonly luw: {
355
+ readonly name: "Luwian";
356
+ readonly kind: "language";
357
+ readonly iso639_3: null;
358
+ readonly bcp47: null;
359
+ };
360
+ readonly cmn: {
361
+ readonly name: "Mandarin";
362
+ readonly kind: "language";
363
+ readonly iso639_3: "cmn";
364
+ readonly bcp47: "cmn";
365
+ };
366
+ readonly mar: {
367
+ readonly name: "Marathi";
368
+ readonly kind: "language";
369
+ readonly iso639_3: "mar";
370
+ readonly bcp47: "mr";
371
+ };
372
+ readonly met: {
373
+ readonly name: "Metrical";
374
+ readonly kind: "vocabulary";
375
+ readonly iso639_3: null;
376
+ readonly bcp47: null;
377
+ };
378
+ readonly zxx: {
379
+ readonly name: "No linguistic content";
380
+ readonly kind: "non-linguistic";
381
+ readonly iso639_3: "zxx";
382
+ readonly bcp47: "zxx";
383
+ };
384
+ readonly och: {
385
+ readonly name: "Old Chinese";
386
+ readonly kind: "language";
387
+ readonly iso639_3: "och";
388
+ readonly bcp47: "och";
389
+ };
390
+ readonly peo: {
391
+ readonly name: "Old Persian";
392
+ readonly kind: "language";
393
+ readonly iso639_3: "peo";
394
+ readonly bcp47: "peo";
395
+ };
396
+ readonly ota: {
397
+ readonly name: "Ottoman Turkish";
398
+ readonly kind: "language";
399
+ readonly iso639_3: "ota";
400
+ readonly bcp47: "ota";
401
+ };
402
+ readonly "ota-xlt": {
403
+ readonly name: "Ottoman Turkish XLit";
404
+ readonly kind: "transliteration";
405
+ readonly iso639_3: "ota";
406
+ readonly bcp47: "ota-Latn-t-ota-arab";
407
+ };
408
+ readonly pla: {
409
+ readonly name: "Palaic";
410
+ readonly kind: "language";
411
+ readonly iso639_3: "plq";
412
+ readonly bcp47: "plq";
413
+ };
414
+ readonly per: {
415
+ readonly name: "Persian";
416
+ readonly kind: "language";
417
+ readonly iso639_3: "fas";
418
+ readonly bcp47: "fa";
419
+ };
420
+ readonly phn: {
421
+ readonly name: "Phoenician";
422
+ readonly kind: "language";
423
+ readonly iso639_3: "phn";
424
+ readonly bcp47: "phn";
425
+ };
426
+ readonly xpg: {
427
+ readonly name: "Phrygian";
428
+ readonly kind: "language";
429
+ readonly iso639_3: "xpg";
430
+ readonly bcp47: "xpg";
431
+ };
432
+ readonly pol: {
433
+ readonly name: "Polish";
434
+ readonly kind: "language";
435
+ readonly iso639_3: "pol";
436
+ readonly bcp47: "pl";
437
+ };
438
+ readonly por: {
439
+ readonly name: "Portuguese";
440
+ readonly kind: "language";
441
+ readonly iso639_3: "por";
442
+ readonly bcp47: "pt";
443
+ };
444
+ readonly pro: {
445
+ readonly name: "Pronunciation";
446
+ readonly kind: "vocabulary";
447
+ readonly iso639_3: null;
448
+ readonly bcp47: null;
449
+ };
450
+ readonly rel: {
451
+ readonly name: "Relator";
452
+ readonly kind: "vocabulary";
453
+ readonly iso639_3: null;
454
+ readonly bcp47: "zxx";
455
+ };
456
+ readonly rus: {
457
+ readonly name: "Russian";
458
+ readonly kind: "language";
459
+ readonly iso639_3: "rus";
460
+ readonly bcp47: "ru";
461
+ };
462
+ readonly san: {
463
+ readonly name: "Sanskrit";
464
+ readonly kind: "language";
465
+ readonly iso639_3: "san";
466
+ readonly bcp47: "sa";
467
+ };
468
+ readonly srp: {
469
+ readonly name: "Serbian";
470
+ readonly kind: "language";
471
+ readonly iso639_3: "srp";
472
+ readonly bcp47: "sr";
473
+ };
474
+ readonly spa: {
475
+ readonly name: "Spanish";
476
+ readonly kind: "language";
477
+ readonly iso639_3: "spa";
478
+ readonly bcp47: "es";
479
+ };
480
+ readonly sux: {
481
+ readonly name: "Sumerian";
482
+ readonly kind: "language";
483
+ readonly iso639_3: "sux";
484
+ readonly bcp47: "sux";
485
+ };
486
+ readonly sup: {
487
+ readonly name: "Supplemental";
488
+ readonly kind: "vocabulary";
489
+ readonly iso639_3: null;
490
+ readonly bcp47: null;
491
+ };
492
+ readonly syc: {
493
+ readonly name: "Syriac";
494
+ readonly kind: "language";
495
+ readonly iso639_3: "syc";
496
+ readonly bcp47: "syc";
497
+ };
498
+ readonly tei: {
499
+ readonly name: "TEI";
500
+ readonly kind: "vocabulary";
501
+ readonly iso639_3: null;
502
+ readonly bcp47: null;
503
+ };
504
+ readonly tur: {
505
+ readonly name: "Turkish";
506
+ readonly kind: "language";
507
+ readonly iso639_3: "tur";
508
+ readonly bcp47: "tr";
509
+ };
510
+ readonly uga: {
511
+ readonly name: "Ugaritic";
512
+ readonly kind: "language";
513
+ readonly iso639_3: "uga";
514
+ readonly bcp47: "uga";
515
+ };
516
+ readonly ukr: {
517
+ readonly name: "Ukrainian";
518
+ readonly kind: "language";
519
+ readonly iso639_3: "ukr";
520
+ readonly bcp47: "uk";
521
+ };
522
+ readonly urd: {
523
+ readonly name: "Urdu";
524
+ readonly kind: "language";
525
+ readonly iso639_3: "urd";
526
+ readonly bcp47: "ur";
527
+ };
528
+ readonly uzb: {
529
+ readonly name: "Uzbek";
530
+ readonly kind: "language";
531
+ readonly iso639_3: "uzb";
532
+ readonly bcp47: "uz";
533
+ };
534
+ readonly var: {
535
+ readonly name: "Variation";
536
+ readonly kind: "vocabulary";
537
+ readonly iso639_3: null;
538
+ readonly bcp47: null;
539
+ };
540
+ readonly was: {
541
+ readonly name: "Washo";
542
+ readonly kind: "language";
543
+ readonly iso639_3: "was";
544
+ readonly bcp47: "was";
545
+ };
546
+ readonly yid: {
547
+ readonly name: "Yiddish";
548
+ readonly kind: "language";
549
+ readonly iso639_3: "yid";
550
+ readonly bcp47: "yi";
551
+ };
552
+ readonly yua: {
553
+ readonly name: "Yucatec Maya";
554
+ readonly kind: "language";
555
+ readonly iso639_3: "yua";
556
+ readonly bcp47: "yua";
557
+ };
558
+ };
559
+ /**
560
+ * A language code OCHRE publishes
561
+ */
562
+ export type OchreLanguageCode = keyof typeof OCHRE_LANGUAGES;
563
+ /**
564
+ * Check whether a string is a language code OCHRE publishes
565
+ * @param code - The code to check
566
+ * @returns Whether OCHRE publishes the code
567
+ */
568
+ export declare function isOchreLanguageCode(code: string): code is OchreLanguageCode;
569
+ /**
570
+ * Look up a language OCHRE publishes by its OCHRE code
571
+ * @param code - The OCHRE language code
572
+ * @returns The language, or null when OCHRE does not publish the code
573
+ */
574
+ export declare function getOchreLanguage(code: string): OchreLanguage | null;
575
+ /**
576
+ * Find the OCHRE code of a language from its ISO 639-3 identifier
577
+ * @param iso639_3 - The ISO 639-3 identifier
578
+ * @returns The OCHRE code of the language itself, not of a transliteration,
579
+ * or null when OCHRE publishes no code for it
580
+ */
581
+ export declare function getOchreLanguageCode(iso639_3: string): OchreLanguageCode | null;
582
+ //#endregion