nva-language 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/README.md +58 -43
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # nva\-language\-js
1
+ # nva-language-js
2
2
  Javascript implementation of NVA (the Norwegian national research archive) language handling.
3
3
 
4
4
  Languages in NVA are represented by URIs, this module allows users to find the correct URI for a language and find a name string in a given language for each URI without dereferencing the URI.
5
5
 
6
- NVA\-language also routes non\-preferred representations to preferred representations.
6
+ NVA-language also routes non-preferred representations to preferred representations.
7
7
 
8
8
  ## Using the library
9
9
 
@@ -46,10 +46,10 @@ All functions return a language object, which has the structure:
46
46
 
47
47
  The properties are structured as follows:
48
48
 
49
- - uri: a Lexvo ISO 639\-3 uri
50
- - iso6391Code: an ISO 639\-1, two\-letter code
51
- - iso6392Codes: an array containing ISO 639\-2 B/T three\letter codes (min one, max. two items)
52
- - iso6393Code: an ISO 639\-3 code
49
+ - uri: a Lexvo ISO 639-3 uri
50
+ - iso6391Code: an ISO 639-1, two-letter code
51
+ - iso6392Codes: an array containing ISO 639-2 B/T three\letter codes (min one, max. two items)
52
+ - iso6393Code: an ISO 639-3 code
53
53
  - eng: the English name of the language
54
54
  - nob: the Norwegian Bokmål name of the language
55
55
  - nno: the Norwegian Nynorsk name of the language
@@ -57,42 +57,57 @@ The properties are structured as follows:
57
57
 
58
58
  ## Available functions
59
59
 
60
- There are a number of methods provided by nva\-language, all of which return a Language object, these have self\-explanatory names:
61
-
62
- - getLanguageByBokmaalName
63
- - example: `const english = getLanguageByBokmaalName('Engelsk')`
64
- - Given a Norwegian Bokmål token for a language, say "Engelsk", returns a Language object that either matches the token, or is the Undefined language
65
- - Matching is not case\–sensitive
66
- - getLanguageByEnglishName
67
- - example: `const english = getLanguageByEnglishName('English')`
68
- - Given a Norwegian Bokmål token for a language, say "English", returns a Language object that either matches the token, or is the Undefined language
69
- - Matching is not case\–sensitive
70
- - getLanguageByIso6391Code
71
- - example: `const english = getLanguageByIso6391Code('en')`
72
- - Given an ISO 639\-1 code, returns a Language object that either matches the token, or is the Undefined language
73
- - Matching is not case\–sensitive
74
- - getLanguageByIso6392Code
75
- - example: `const english = getLanguageByIso6392Code('eng')`
76
- - Given an ISO 639\-2 code, returns a Language object that either matches the token, or is the Undefined language
77
- - Returns e.g. a Language object for German if either the B/T ("ger", "deu") variants are supplied
78
- - Matching is not case\–sensitive
79
- - getLanguageByIso6393Code
80
- - example: `const english = getLanguageByIso6393Code('eng')`
81
- - Given an ISO 639\-1 code, returns a Language object that either matches the token, or is the Undefined language
82
- - Matching is not case\–sensitive
83
- - getLanguageByNynorskName
84
- - example: `const english = getLanguageByNynorskName('Engelsk')`
85
- - Given a Norwegian Nynorsk token for a language, say "Engelsk", returns a Language object that either matches the token, or is the Undefined language
86
- - Matching is not case\–sensitive
87
- - The only difference between getLanguageByNynorskName and getLanguageByBokmaalName is Bokmål "Flere språk", Nynorsk "Fleire språk"
88
- - getLanguageBySamiName
89
- - example: `const english = getLanguageBySamiName('Eaŋgalsgiella')`
90
- - Given a Northern Sami token for a language, say "Eaŋgalsgiella", returns a Language object that either matches the token, or is the Undefined language
91
- - Matching is not case\–sensitive
92
- - getLanguageByUri
93
- - example: `const english = getLanguageByUri(' http://lexvo.org/id/iso639-3/eng')`
94
- - Given a Lexvo ISO 639\-3 URI, returns the corresponding language object or Undefined language (in the case that the URI is not in use)
95
- - Note: Lexvo does *not* use HTTPS
60
+ There are a number of methods provided by nva-language, all of which return a Language object, these have self-explanatory names:
61
+
62
+ ### getLanguageByBokmaalName
63
+
64
+ - example: `const english = getLanguageByBokmaalName('Engelsk')`
65
+ - Given a Norwegian Bokmål token for a language, say "Engelsk", returns a Language object that either matches the token, or is the Undefined language
66
+ - Matching is not case sensitive
67
+
68
+ ### getLanguageByEnglishName
69
+
70
+ - example: `const english = getLanguageByEnglishName('English')`
71
+ - Given a Norwegian Bokmål token for a language, say "English", returns a Language object that either matches the token, or is the Undefined language
72
+ - Matching is not case sensitive
73
+
74
+ ### getLanguageByIso6391Code
75
+
76
+ - example: `const english = getLanguageByIso6391Code('en')`
77
+ - Given an ISO 639-1 code, returns a Language object that either matches the token, or is the Undefined language
78
+ - Matching is not case sensitive
79
+
80
+ ### getLanguageByIso6392Code
81
+
82
+ - example: `const english = getLanguageByIso6392Code('eng')`
83
+ - Given an ISO 639-2 code, returns a Language object that either matches the token, or is the Undefined language
84
+ - Returns e.g. a Language object for German if either the B/T ("ger", "deu") variants are supplied
85
+ - Matching is not case sensitive
86
+
87
+ ### getLanguageByIso6393Code
88
+
89
+ - example: `const english = getLanguageByIso6393Code('eng')`
90
+ - Given an ISO 639-1 code, returns a Language object that either matches the token, or is the Undefined language
91
+ - Matching is not case sensitive
92
+
93
+ ### getLanguageByNynorskName
94
+
95
+ - example: `const english = getLanguageByNynorskName('Engelsk')`
96
+ - Given a Norwegian Nynorsk token for a language, say "Engelsk", returns a Language object that either matches the token, or is the Undefined language
97
+ - Matching is not case sensitive
98
+ - The only difference between getLanguageByNynorskName and getLanguageByBokmaalName is Bokmål "Flere språk", Nynorsk "Fleire språk"
99
+
100
+ ### getLanguageBySamiName
101
+
102
+ - example: `const english = getLanguageBySamiName('Eaŋgalsgiella')`
103
+ - Given a Northern Sami token for a language, say "Eaŋgalsgiella", returns a Language object that either matches the token, or is the Undefined language
104
+ - Matching is not case sensitive
105
+
106
+ ## getLanguageByUri
107
+
108
+ - example: `const english = getLanguageByUri(' http://lexvo.org/id/iso639-3/eng')`
109
+ - Given a Lexvo ISO 639-3 URI, returns the corresponding language object or Undefined language (in the case that the URI is not in use)
110
+ - Note: Lexvo does *not* use HTTPS
96
111
 
97
112
  ## Notes
98
113
  ### Valid and invalid languages
@@ -113,4 +128,4 @@ Since the primary source for the data for this module has been NSD DBH's publica
113
128
 
114
129
  ### More than one language
115
130
 
116
- We use the ISO 639\-3 `mul` code for these cases, which replaces the sometimes\-used `mis` code if provided as input.
131
+ We use the ISO 639-3 `mul` code for these cases, which replaces the sometimes-used `mis` code if provided as input.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nva-language",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "",
5
5
  "main": "./dist/LanguageMapper.js",
6
6
  "module": "./src/LanguageMapper.mjs",