ifct2017 2.0.15 → 2.1.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.
Files changed (111) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +1021 -71
  3. package/abbreviations/index.csv +78 -0
  4. package/abbreviations/index.d.ts +39 -0
  5. package/abbreviations/index.js +103 -0
  6. package/abbreviations/index.txt +12 -0
  7. package/about/build.ts +31 -0
  8. package/about/index.d.ts +47 -0
  9. package/about/index.js +110 -0
  10. package/about/index.txt +174 -0
  11. package/build.ts +115 -0
  12. package/carbohydrates/index.csv +8 -0
  13. package/carbohydrates/index.d.ts +42 -0
  14. package/carbohydrates/index.js +112 -0
  15. package/carbohydrates/index.txt +14 -0
  16. package/codes/index.csv +2904 -0
  17. package/codes/index.d.ts +36 -0
  18. package/codes/index.js +102 -0
  19. package/codes/index.txt +12 -0
  20. package/columndescriptions/build.ts +22 -0
  21. package/columndescriptions/index.csv +215 -0
  22. package/columndescriptions/index.d.ts +44 -0
  23. package/columndescriptions/index.js +119 -0
  24. package/columns/build.ts +23 -0
  25. package/columns/index.csv +215 -0
  26. package/columns/index.d.ts +39 -0
  27. package/columns/index.js +111 -0
  28. package/columns/index.txt +71 -0
  29. package/compositingcentres/index.csv +7 -0
  30. package/compositingcentres/index.d.ts +35 -0
  31. package/compositingcentres/index.js +103 -0
  32. package/compositingcentres/index.txt +13 -0
  33. package/compositions/build.ts +212 -0
  34. package/compositions/index.csv +543 -0
  35. package/compositions/index.d.ts +254 -0
  36. package/compositions/index.js +204 -0
  37. package/compositionstats/build.ts +103 -0
  38. package/compositionstats/index.csv +4 -0
  39. package/compositionstats/index.d.ts +31 -0
  40. package/compositionstats/index.js +97 -0
  41. package/contents/index.csv +21 -0
  42. package/contents/index.d.ts +39 -0
  43. package/contents/index.js +102 -0
  44. package/contents/index.txt +13 -0
  45. package/deno.lock +67 -0
  46. package/descriptions/index.csv +543 -0
  47. package/descriptions/index.d.ts +45 -0
  48. package/descriptions/index.js +124 -0
  49. package/descriptions/index.txt +15 -0
  50. package/energies/index.csv +6 -0
  51. package/energies/index.d.ts +34 -0
  52. package/energies/index.js +101 -0
  53. package/energies/index.txt +13 -0
  54. package/frequencydistribution/index.csv +10 -0
  55. package/frequencydistribution/index.d.ts +36 -0
  56. package/frequencydistribution/index.js +90 -0
  57. package/frequencydistribution/index.txt +14 -0
  58. package/groups/index.csv +21 -0
  59. package/groups/index.d.ts +46 -0
  60. package/groups/index.js +118 -0
  61. package/groups/index.txt +14 -0
  62. package/hierarchy/asset.csv +215 -0
  63. package/hierarchy/asset.txt +70 -0
  64. package/hierarchy/build.ts +73 -0
  65. package/hierarchy/index.csv +215 -0
  66. package/hierarchy/index.d.ts +39 -0
  67. package/hierarchy/index.js +100 -0
  68. package/hierarchy/index.txt +14 -0
  69. package/index.d.ts +24 -28
  70. package/index.js +28 -39
  71. package/index.test.ts +717 -0
  72. package/intakes/build.ts +28 -0
  73. package/intakes/index.csv +42 -0
  74. package/intakes/index.d.ts +66 -0
  75. package/intakes/index.js +113 -0
  76. package/intakes/index.txt +20 -0
  77. package/jonesfactors/index.csv +15 -0
  78. package/jonesfactors/index.d.ts +35 -0
  79. package/jonesfactors/index.js +105 -0
  80. package/jonesfactors/index.txt +12 -0
  81. package/languages/index.csv +22 -0
  82. package/languages/index.d.ts +39 -0
  83. package/languages/index.js +103 -0
  84. package/languages/index.txt +12 -0
  85. package/methods/build.ts +101 -0
  86. package/methods/index.csv +37 -0
  87. package/methods/index.d.ts +39 -0
  88. package/methods/index.js +196 -0
  89. package/methods/index.txt +13 -0
  90. package/package.json +15 -63
  91. package/regions/index.csv +7 -0
  92. package/regions/index.d.ts +36 -0
  93. package/regions/index.js +100 -0
  94. package/regions/index.txt +12 -0
  95. package/representations/build.ts +133 -0
  96. package/representations/index.csv +215 -0
  97. package/representations/index.d.ts +36 -0
  98. package/representations/index.js +91 -0
  99. package/retentionfactors/groups.csv +21 -0
  100. package/retentionfactors/index.csv +215 -0
  101. package/samplingunits/index.csv +36 -0
  102. package/samplingunits/index.d.ts +39 -0
  103. package/samplingunits/index.js +110 -0
  104. package/samplingunits/index.txt +14 -0
  105. package/yieldfactors/index.csv +543 -0
  106. package/yieldfactors/index.d.ts +57 -0
  107. package/yieldfactors/index.js +158 -0
  108. package/yieldfactors/index.txt +294 -0
  109. package/corpus.js +0 -6
  110. package/corpus.min.js +0 -1
  111. package/pictures.d.ts +0 -41
package/README.md CHANGED
@@ -1,56 +1,59 @@
1
- The Indian Food Composition tables ([IFCT 2017]) provides nutritional values for 528 key foods.<br>
2
- 📦 [Node.js](https://www.npmjs.com/package/ifct2017),
3
- 📜 [Files](https://unpkg.com/ifct2017/).
1
+ <!-- Copyright (C) 2025-26 Subhajit Sahu -->
2
+ <!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
3
+ <!-- See LICENSE for full terms -->
4
4
 
5
- Food composition values were measured by [National Institute of Nutrition, Hyderabad]. Shown
6
- below is a text-query JavaScript API for search information through these tables. You may
7
- also add these to a database for more control over the query.
5
+ This package provides detailed nutritional values for 542 key foods in India, based on direct measurements across six regions. Data was obtained from the book [Indian Food Composition Tables 2017], published by the [National Institute of Nutrition, Hyderabad].
8
6
 
9
- > Online database: [ifct2017.github.io].
7
+
8
+ 📦 [JSR](https://jsr.io/@nodef/ifct2017),
9
+ 📦 [NPM](https://www.npmjs.com/package/ifct2017),
10
+ 📦 [Corpus](https://www.npmjs.com/package/@ifct2017/corpus),
11
+ 📰 [Docs](https://jsr.io/@nodef/ifct2017/doc),
12
+ 🌐 [Website](https://ifct2017.github.io).
10
13
 
11
14
  <br>
12
15
 
13
- ```javascript
14
- const ifct2017 = require('ifct2017');
16
+ <br>
15
17
 
18
+ ```javascript
19
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
16
20
 
17
- async function main() {
18
- await ifct2017.compositions.load();
19
- /// Load corpus first
20
21
 
22
+ await ifct2017.loadCompositions();
23
+ await ifct2017.loadColumns();
24
+ await ifct2017.loadIntakes();
25
+ // Load corpus first
21
26
 
22
27
  ifct2017.compositions('pineapple');
23
28
  ifct2017.compositions('ananas comosus');
24
- // [ { code: 'E053',
25
- // name: 'Pineapple',
26
- // scie: 'Ananas comosus',
27
- // lang: 'A. Ahnaros; B. Anarasa; G. Anenas; H. Ananas; Kan. Ananas; Kash. Punchitipul; Kh. Soh trun; Kon. Anas; Mal. Kayirha chakka; M. Kihom Ananas; O. Sapuri; P. Ananas; Tam. Annasi pazham; Tel. Anasa pandu; U. Ananas.',
28
- // ... } ]
29
+ // [ { code: 'E053',
30
+ // name: 'Pineapple',
31
+ // scie: 'Ananas comosus',
32
+ // lang: 'A. Ahnaros; B. Anarasa; G. Anenas; H. Ananas; Kan. Ananas; Kash. Punchitipul; Kh. Soh trun; Kon. Anas; Mal. Kayirha chakka; M. Kihom Ananas; O. Sapuri; P. Ananas; Tam. Annasi pazham; Tel. Anasa pandu; U. Ananas.',
33
+ // ... } ]
29
34
 
30
35
  ifct2017.columns('vitamin c');
31
36
  ifct2017.columns('c-vitamin');
32
- // [ { code: 'vitc',
33
- // name: 'Total Ascorbic acid',
34
- // tags: 'ascorbate water soluble vitamin c vitamin c essential' } ]
37
+ // [ { code: 'vitc',
38
+ // name: 'Total Ascorbic acid',
39
+ // tags: 'ascorbate water soluble vitamin c vitamin c essential' } ]
35
40
 
36
41
  ifct2017.pictures.unpkg('A001');
37
- // https://unpkg.com/@ifct2017/pictures/assets/A001.jpeg
42
+ // https://unpkg.com/@ifct2017/pictures/assets/A001.jpeg
38
43
 
39
44
  ifct2017.intakes('his');
40
45
  ifct2017.intakes('Histidine');
41
- // [ { code: 'his',
42
- // whorda: -0.01,
43
- // usear: NaN,
44
- // usrdam: -0.014,
45
- // usrdaf: NaN,
46
- // euprim: NaN,
47
- // euprif: NaN,
48
- // ulus: NaN,
49
- // uleu: NaN,
50
- // uljapan: NaN } ]
51
- /// Negative value indicates amount per kg of body weight.
52
- }
53
- main();
46
+ // [ { code: 'his',
47
+ // whorda: -0.01,
48
+ // usear: NaN,
49
+ // usrdam: -0.014,
50
+ // usrdaf: NaN,
51
+ // euprim: NaN,
52
+ // euprif: NaN,
53
+ // ulus: NaN,
54
+ // uleu: NaN,
55
+ // uljapan: NaN } ]
56
+ // Negative value indicates amount per kg of body weight.
54
57
  ```
55
58
 
56
59
  <br>
@@ -61,9 +64,10 @@ main();
61
64
 
62
65
  | Method | Action
63
66
  |-------------------------|-------
64
- | [compositions] | Detailed nutrient composition of 528 key foods in India.
67
+ | [compositions] | Detailed nutrient composition of 542 key foods in India.
65
68
  | [columns] | Codes and names of nutrients, and its components.
66
69
  | [pictures] | Single representative photo of each foods (JPEG, 307x173).
70
+ | [yieldFactors] | Yield factors for conversion of raw to edible portion.
67
71
  | [intakes] | Recommended daily intakes of nutrients.
68
72
  | [hierarchy] | Tree-like hierarchy of nutrients, and its components.
69
73
  | [representations] | Representations of columns (as factors and units).
@@ -87,40 +91,986 @@ main();
87
91
  > NOTE: `.pictures(code) -> null` as it is not included locally.<br>
88
92
  > Use `.pictures.unpkg(code)`, or `.pictures.jsDelivr(code)` instead.
89
93
 
90
- > A corpus consisting of columns, hierarchy, intakes, methods, nutrients,<br>
91
- > representations is available for use with UI: [unpkg], [jsDelivr].
92
-
93
- <br>
94
- <br>
95
-
96
- [![](https://i.imgur.com/D5UYmbD.jpg)](http://ifct2017.com/)<br>
97
- [![ORG](https://img.shields.io/badge/org-ifct2017-green?logo=Org)](https://ifct2017.github.io)
98
- [![DOI](https://zenodo.org/badge/133156402.svg)](https://zenodo.org/badge/latestdoi/133156402)
99
-
100
- [abbreviations]: https://www.npmjs.com/package/@ifct2017/abbreviations
101
- [about]: https://www.npmjs.com/package/@ifct2017/about
102
- [carbohydrates]: https://www.npmjs.com/package/@ifct2017/carbohydrates
103
- [codes]: https://www.npmjs.com/package/@ifct2017/codes
104
- [columns]: https://www.npmjs.com/package/@ifct2017/columns
105
- [compositingCentres]: https://www.npmjs.com/package/@ifct2017/compositingcentres
106
- [compositions]: https://www.npmjs.com/package/@ifct2017/compositions
107
- [contents]: https://www.npmjs.com/package/@ifct2017/contents
108
- [descriptions]: https://www.npmjs.com/package/@ifct2017/descriptions
109
- [energies]: https://www.npmjs.com/package/@ifct2017/energies
110
- [frequencyDistribution]: https://www.npmjs.com/package/@ifct2017/frequencydistribution
111
- [groups]: https://www.npmjs.com/package/@ifct2017/groups
112
- [hierarchy]: https://www.npmjs.com/package/@ifct2017/hierarchy
113
- [intakes]: https://www.npmjs.com/package/@ifct2017/intakes
114
- [jonesFactors]: https://www.npmjs.com/package/@ifct2017/jonesfactors
115
- [languages]: https://www.npmjs.com/package/@ifct2017/languages
116
- [methods]: https://www.npmjs.com/package/@ifct2017/methods
117
- [nutrients]: https://www.npmjs.com/package/@ifct2017/nutrients
118
- [pictures]: https://www.npmjs.com/package/@ifct2017/pictures
119
- [regions]: https://www.npmjs.com/package/@ifct2017/regions
120
- [representations]: https://www.npmjs.com/package/@ifct2017/representations
121
- [samplingUnits]: https://www.npmjs.com/package/@ifct2017/samplingunits
122
- [IFCT 2017]: http://ifct2017.com/
123
- [unpkg]: https://unpkg.com/ifct2017/corpus.min.js
124
- [jsDelivr]: https://cdn.jsdelivr.net/npm/ifct2017/corpus.min.js
125
- [ifct2017.github.io]: https://ifct2017.github.io
94
+ [Indian Food Composition Tables 2017]: http://ifct2017.com/
126
95
  [National Institute of Nutrition, Hyderabad]: https://www.nin.res.in/
96
+ [abbreviations]: https://jsr.io/@nodef/ifct2017/doc/~/abbreviations
97
+ [about]: https://jsr.io/@nodef/ifct2017/doc/~/about
98
+ [carbohydrates]: https://jsr.io/@nodef/ifct2017/doc/~/carbohydrates
99
+ [codes]: https://jsr.io/@nodef/ifct2017/doc/~/codes
100
+ [columns]: https://jsr.io/@nodef/ifct2017/doc/~/columns
101
+ [compositingCentres]: https://jsr.io/@nodef/ifct2017/doc/~/compositingcentres
102
+ [compositions]: https://jsr.io/@nodef/ifct2017/doc/~/compositions
103
+ [contents]: https://jsr.io/@nodef/ifct2017/doc/~/contents
104
+ [descriptions]: https://jsr.io/@nodef/ifct2017/doc/~/descriptions
105
+ [energies]: https://jsr.io/@nodef/ifct2017/doc/~/energies
106
+ [frequencyDistribution]: https://jsr.io/@nodef/ifct2017/doc/~/frequencydistribution
107
+ [groups]: https://jsr.io/@nodef/ifct2017/doc/~/groups
108
+ [hierarchy]: https://jsr.io/@nodef/ifct2017/doc/~/hierarchy
109
+ [intakes]: https://jsr.io/@nodef/ifct2017/doc/~/intakes
110
+ [jonesFactors]: https://jsr.io/@nodef/ifct2017/doc/~/jonesfactors
111
+ [languages]: https://jsr.io/@nodef/ifct2017/doc/~/languages
112
+ [methods]: https://jsr.io/@nodef/ifct2017/doc/~/methods
113
+ [nutrients]: https://jsr.io/@nodef/ifct2017/doc/~/nutrients
114
+ [pictures]: https://jsr.io/@nodef/ifct2017/doc/~/pictures
115
+ [regions]: https://jsr.io/@nodef/ifct2017/doc/~/regions
116
+ [representations]: https://jsr.io/@nodef/ifct2017/doc/~/representations
117
+ [samplingUnits]: https://jsr.io/@nodef/ifct2017/doc/~/samplingunits
118
+ [yieldFactors]: https://jsr.io/@nodef/ifct2017/doc/~/yieldfactors
119
+
120
+ <br>
121
+ <br>
122
+
123
+
124
+ ## Abbreviations
125
+
126
+ Full forms of *abbreviations* used in the original book.
127
+
128
+ <br>
129
+
130
+ ```javascript
131
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
132
+ // ifct2017.loadAbbreviations() → corpus
133
+ // ifct2017.abbreviationsSql([table], [options]) → SQL statements
134
+ // ifct2017.abbreviationsCsv() → Path of CSV file
135
+ // ifct2017.abbreviations(query)
136
+ // → {abbr, full} if found, null otherwise.
137
+
138
+
139
+ await ifct2017.loadAbbreviations();
140
+ // Load corpus first
141
+
142
+ ifct2017.abbreviations('GLV');
143
+ ifct2017.abbreviations('g l v');
144
+ // → { abbr: 'GLV', full: 'Green Leafy Vegetables' }
145
+
146
+ ifct2017.abbreviations('what is D.R.I.');
147
+ ifct2017.abbreviations('d. r. i. stands for?');
148
+ // → { abbr: 'DRI', full: 'Dietary reference intake' }
149
+
150
+
151
+ // Note:
152
+ // Full stops must immediately follow character, if present.
153
+ // For single character abbreviations, full stop is mandatory.
154
+ ```
155
+
156
+ [abbreviations-csv]: https://github.com/ifct2017/abbreviations/blob/master/index.csv
157
+ [abbreviations-doc]: https://docs.google.com/spreadsheets/d/1ZTzOOj827HhsUWhdISh1lOJsOh-dvh3ORbAPs9XHI1Q/edit?usp=sharing
158
+ [abbreviations-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vSPLlUvSc4OuO8cHl7kBntXJvolVWxklwZrbyNX0YfOaMMQpAi6iwf47If6wE1UyCTiBHUcx-UwLdb9/pubhtml
159
+
160
+ <br>
161
+ <br>
162
+
163
+
164
+ ## About
165
+
166
+ On the history of malnutrition, current status, and data details.
167
+
168
+ > Supported *topics* include: 1937, 1951, 1963, 1971, 1989, 2017, challenge,
169
+ > column, credit, data, father, form, funder, group, interest, learn, limitation,
170
+ > publisher, source, supporter, use, user, what, when, why.
171
+
172
+ <br>
173
+
174
+ ```javascript
175
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
176
+ // ifct2017.loadAbout() → corpus
177
+ // ifct2017.about(query)
178
+ // → text if matched, null otherwise
179
+
180
+
181
+ await ifct2017.loadAbout();
182
+ // Load corpus first
183
+
184
+ ifct2017.about('who is you publisher');
185
+ ifct2017.about('which organization issued you');
186
+ // → Indian Food Composition Tables 2017 was published by:
187
+ // → T. Longvah, R. Ananthan, K. Bhaskarachary and K. Venkaiah
188
+ // → National Institute of Nutrition
189
+ // → Indian Council of Medical Research
190
+ // → Department of Health Research
191
+ // → Ministry of Health and Family Welfare, Government of India
192
+ // → Jamai Osmania (PO), Hyderabad – 500 007
193
+ // → Telangana, India
194
+ // → Phone: +91 40 27197334, Fax: +91 40 27000339, Email: nin@ap.nic.in
195
+
196
+ ifct2017.about('can i know the food groups');
197
+ ifct2017.about('i want to know what types of food are there');
198
+ // → There are 20 food groups:
199
+ // → - A: Cereals and Millets. 24 foods.
200
+ // → - B: Grain Legumes. 25 foods.
201
+ // → - C: Green Leafy Vegetables. 34 foods.
202
+ // → - D: Other Vegetables. 78 foods.
203
+ // → - E: Fruits. 68 foods.
204
+ // → - F: Roots and Tubers. 19 foods.
205
+ // → - G: Condiments and Spices. 33 foods.
206
+ // → - H: Nuts and Oil Seeds. 21 foods.
207
+ // → - I: Sugars. 2 foods.
208
+ // → - J: Mushrooms. 4 foods.
209
+ // → - K: Miscellaneous Foods. 2 foods.
210
+ // → - L: Milk and Milk Products. 4 foods.
211
+ // → - M: Egg and Egg Products. 15 foods.
212
+ // → - N: Poultry. 19 foods.
213
+ // → - O: Animal Meat. 63 foods.
214
+ // → - P: Marine Fish. 92 foods.
215
+ // → - Q; Marine Shellfish. 8 foods.
216
+ // → - R: Marine Mollusks. 7 foods.
217
+ // → - S: Fresh Water Fish and Shellfish. 10 foods.
218
+ // → - T: Edible Oils and Fats. 9 foods.
219
+
220
+ ifct2017.about('what happened in 1951');
221
+ ifct2017.about('what was the situation in nineteen fifty');
222
+ // → Between 1938 and 1951, there was a notable transition in the Indian nutrition
223
+ // → scenario. Among tropical regions, India contributed substantially in the field
224
+ // → of nutrition (Nicholls, 1945). The incidence of pellagra was noticed and the
225
+ // → role of niacin in its cure was successfully demonstrated in India (Raman, 1940;
226
+ // → Aykroyd & Swaminathan, 1940). The agricultural practices in India also underwent
227
+ // → modifications with concomitant increase in the crop yields. However, the basic
228
+ // → diet of individuals remained inadequate, devoid of animal fats and proteins,
229
+ // → due to poor economic conditions (Day, 1944). The translation of nutrition research
230
+ // → into sustained public health was hindered by obstacles of weak economy, ignorance
231
+ // → and poverty (Aykroyd, 1941). Other deficiency diseases such as maternal anaemia,
232
+ // → infant beriberi and osteomalacia continued to be rampant. Sustained nutritional
233
+ // → issues prompted the revision of Indian FCT resulting in the publication of fourth
234
+ // → edition of the Health Bulletin No. 23 by Aykroyd, Patwardhan, and Ranganathan (1951).
235
+
236
+
237
+ // Note:
238
+ // Can convert textual number to number.
239
+ // 1950-1959 is considered for 1951 event.
240
+ ```
241
+
242
+ <br>
243
+ <br>
244
+
245
+
246
+ ## Carbohydrates
247
+
248
+ Conversion of carbohydrate weights to monosaccharide equivalents.
249
+
250
+ <br>
251
+
252
+ ```javascript
253
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
254
+ // ifct2017.loadCarbohydrates() → corpus
255
+ // ifct2017.carbohydratesSql([table], [options]) → SQL statements
256
+ // ifct2017.carbohydratesCsv() → path of CSV file
257
+ // ifct2017.carbohydrates(query)
258
+ // → matches [{sno, carbohydrate, hydrolysis, monosaccharide}]
259
+
260
+
261
+ await ifct2017.loadCarbohydrates();
262
+ // Load corpus first
263
+
264
+ ifct2017.carbohydrates('monosaccharide');
265
+ ifct2017.carbohydrates('Glucose');
266
+ // → [ { sno: '1',
267
+ // → carbohydrate: 'Monosaccharides e.g. glucose',
268
+ // → hydrolysis: 100,
269
+ // → monosaccharide: 1 } ]
270
+
271
+ ifct2017.carbohydrates('what is carbohydrate conversion factor of disaccharides?');
272
+ ifct2017.carbohydrates('maltose conversion factor');
273
+ // → [ { sno: '2',
274
+ // → carbohydrate: 'Disaccharides e.g. sucrose, lactose, maltose',
275
+ // → hydrolysis: 105,
276
+ // → monosaccharide: 1.05 } ]
277
+ ```
278
+
279
+ [carbohydrates-doc]: https://docs.google.com/spreadsheets/d/1YoEVoQFR0co_bTHL3Xok1dQfuqxXZa7yQrlUKbYVve4/edit?usp=sharing
280
+ [carbohydrates-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vQ4Ogyx4J5JWX3HQnHhoGt9HsmqNIZ5MFvDvHa2gkYSZg6vxtWeqPrzkyvh1_bmaXDgrsElNgAu1YKk/pubhtml
281
+
282
+ <br>
283
+ <br>
284
+
285
+
286
+ ## Codes
287
+
288
+ Uniquely identifiable *codes* for each food.
289
+
290
+ <br>
291
+
292
+ ```javascript
293
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
294
+ // ifct2017.loadCodes() → corpus
295
+ // ifct2017.codesSql([table], [options]) → SQL statements
296
+ // ifct2017.codesCsv() → path of CSV file
297
+ // ifct2017.codes(query)
298
+ // → matches [{name, code}]
299
+
300
+
301
+ await ifct2017.loadCodes();
302
+ // Load corpus first
303
+
304
+ ifct2017.codes('mango green');
305
+ ifct2017.codes('Raw mango');
306
+ // → [ { name: 'Mango, green, raw (Common)', code: 'D057' } ]
307
+
308
+ ifct2017.codes('what is food code of atta?');
309
+ ifct2017.codes('atta code');
310
+ // → [ { name: 'Atta (H., P.)', code: 'A019' },
311
+ // → { name: 'Gahama atta (O.)', code: 'A019' },
312
+ // → { name: 'Wheat flour, atta (Common)', code: 'A019' } ]
313
+ ```
314
+
315
+ [codes-doc]: https://docs.google.com/spreadsheets/d/1Q-M1C3DAEhoA6y7X89M3Fl_zml__v0Mr-fJAYBJkLJc/edit?usp=sharing
316
+ [codes-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vSZD-_xy9EvbEM2axafTL251gWsCPUYRZA8wAUvscy0MZmHS9bCOpbvqJQsbf5TujlOA8FmL91bOzF8/pubhtml
317
+
318
+ <br>
319
+ <br>
320
+
321
+
322
+ ## Columns
323
+
324
+ *Codes and names* of nutrients, and its components.
325
+
326
+ <br>
327
+
328
+ ```javascript
329
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
330
+ // ifct2017.loadColumns() → corpus
331
+ // ifct2017.columnsSql([table], [options]) → SQL statements
332
+ // ifct2017.columnsCsv() → path of CSV file
333
+ // ifct2017.columns(query)
334
+ // → matches [{code, name, tags}]
335
+
336
+
337
+ ifct2017.columns('vitamin c');
338
+ ifct2017.columns('c-vitamin');
339
+ // → [ { code: 'vitc',
340
+ // → name: 'Ascorbic acids (C)',
341
+ // → tags: 'total ascorbate water soluble vitamin c vitamin c essential' } ]
342
+
343
+ ifct2017.columns('what is butyric acid?');
344
+ ifct2017.columns('c4:0 stands for?');
345
+ // → [ { code: 'f4d0',
346
+ // → name: 'Butyric acid (C4:0)',
347
+ // → tags: 'c40 c 40 4 0 bta butanoic propanecarboxylic carboxylic saturated fatty fat triglyceride lipid colorless liquid unpleasant vomit body odor' } ]
348
+ ```
349
+
350
+ <br>
351
+ <br>
352
+
353
+
354
+ ## Compositing centres
355
+
356
+ Regional *compositing centres* and sample size of each region.
357
+
358
+ <br>
359
+
360
+ ```javascript
361
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
362
+ // ifct2017.loadCompositingCentres() → corpus
363
+ // ifct2017.compositingCentresSql([table], [options]) → SQL statements
364
+ // ifct2017.compositingCentresCsv() → path of CSV file
365
+ // ifct2017.compositingCentres(query)
366
+ // → matches [{region, centre, samples}]
367
+
368
+
369
+ await ifct2017.loadCompositingCentres();
370
+ // Load corpus first
371
+
372
+ ifct2017.compositingCentres('west');
373
+ ifct2017.compositingCentres('Mumbai');
374
+ // → [ { region: 'West', centre: 'Mumbai', samples: 12 } ]
375
+
376
+ ifct2017.compositingCentres('what is compositing centre of north east?');
377
+ ifct2017.compositingCentres('North East compositing centre');
378
+ // → [ { region: 'North East', centre: 'Guwahati', samples: 11 } ]
379
+ ```
380
+
381
+ [compositingcentres-doc]: https://docs.google.com/spreadsheets/d/1r9J5mC-Dus9YA1AMSE_8-cEsXJ-8eKm6tKZMz0m5xPw/edit?usp=sharing
382
+ [compositingcentres-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vQQj5wg7oGpgHZSlmrysbeS7MB92bgyPPVYrM7e2JpP2dC2Csts9pVc_Dcf0iVcCbtXSaWKbvQr0Yib/pubhtml
383
+
384
+ <br>
385
+ <br>
386
+
387
+
388
+ ## Compositions
389
+
390
+ Detailed *nutrient composition* of 542 key foods in India.
391
+
392
+ <br>
393
+
394
+ ```javascript
395
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
396
+ // ifct2017.loadCompositions() → corpus
397
+ // ifct2017.compositionsSql([table], [options]) → SQL statements
398
+ // ifct2017.compositionsCsv() → path of CSV file
399
+ // ifct2017.compositions(query)
400
+ // → matches [{code, name, scie, lang, grup, regn, tags, ...}]
401
+
402
+
403
+ await ifct2017.loadCompositions();
404
+ // Load corpus first
405
+
406
+ ifct2017.compositions('pineapple');
407
+ ifct2017.compositions('ananas comosus');
408
+ // → [ { code: 'E053',
409
+ // → name: 'Pineapple',
410
+ // → scie: 'Ananas comosus',
411
+ // → lang: 'A. Ahnaros; B. Anarasa; G. Anenas; H. Ananas; Kan. Ananas; Kash. Punchitipul; Kh. Soh trun; Kon. Anas; Mal. Kayirha chakka; M. Kihom Ananas; O. Sapuri; P. Ananas; Tam. Annasi pazham; Tel. Anasa pandu; U. Ananas.',
412
+ // → ... } ]
413
+
414
+ ifct2017.compositions('tell me about cow milk.');
415
+ ifct2017.compositions('gai ka doodh details.');
416
+ // → [ { code: 'L002',
417
+ // → name: 'Milk, Cow',
418
+ // → scie: '',
419
+ // → lang: 'A. Garoor gakhir; B. Doodh (garu); G. Gai nu dhudh; H. Gai ka doodh; Kan. Hasuvina halu; Kash. Doodh; Kh. Dud masi; M. San Sanghom; Mar. Doodh (gay); O. Gai dudha; P. Gaan da doodh; S. Gow kshiram; Tam. Pasumpaal; Tel. Aavu paalu.',
420
+ // → ... } ]
421
+ ```
422
+
423
+ [compositions-doc]: https://docs.google.com/spreadsheets/d/19C2EB4PIMgyusqKOnBq4-aBQxLjCai1Zg45YcBNTzFo/edit?usp=sharing
424
+ [compositions-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vRAWAh3wLrPjDfeZ2pmApbwnvJ11CxdWaPiJ4BPClyN9X1wbbCjvfyqYpBy-LoIBltsH7MKjtNATtAh/pubhtml
425
+ [compositions-tabdoc]: https://docs.google.com/spreadsheets/d/1ejgqo6uwlKRF3QLUPJJzrTkd47GtVXgHHsgG-T27uGc/edit?usp=sharing
426
+ [compositions-tabweb]: https://docs.google.com/spreadsheets/d/e/2PACX-1vTNaOhfRaF_DxH5yh4QtW2D3iJSM4MRIKB-P_cFRlHGhEzWo5NP5ADmAzrpXH2fsjmzJEOMbmaBFMgq/pubhtml
427
+
428
+ <br>
429
+ <br>
430
+
431
+
432
+ ## Contents
433
+
434
+ *Contents* in the original book.
435
+
436
+ <br>
437
+
438
+ ```javascript
439
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
440
+ // ifct2017.loadContents() → corpus
441
+ // ifct2017.contentsSql([table], [options]) → SQL statements
442
+ // ifct2017.contentsCsv() → path of CSV file
443
+ // ifct2017.contents(query)
444
+ // → matches [{sno, title, pagenos}]
445
+
446
+
447
+ await ifct2017.loadContents();
448
+ // Load corpus first
449
+
450
+ ifct2017.contents('table 2');
451
+ ifct2017.contents('Water soluble vitamins');
452
+ // → [ { sno: '6.2.',
453
+ // → title: 'Table 2: Water Soluble Vitamins',
454
+ // → pagenos: '31' } ]
455
+
456
+ ifct2017.contents('what is page number of table 3?');
457
+ ifct2017.contents('fat soluble vitamin page number');
458
+ // → [ { sno: '6.3.',
459
+ // → title: 'Table 3: Fat Soluble Vitamins',
460
+ // → pagenos: '61' } ]
461
+ ```
462
+
463
+ <br>
464
+ <br>
465
+
466
+
467
+ ## Descriptions
468
+
469
+ *Names* of each food in local languages, including scientific name.
470
+
471
+ <br>
472
+
473
+ ```javascript
474
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
475
+ // ifct2017.loadDescriptions() → corpus
476
+ // ifct2017.descriptionsSql([table], [options]) → SQL statements
477
+ // ifct2017.descriptionsCsv() → path of CSV file
478
+ // ifct2017.descriptions(query)
479
+ // → matches [{code, name, scie, desc}]
480
+
481
+
482
+ await ifct2017.loadDescriptions();
483
+ // Load corpus first
484
+
485
+ ifct2017.descriptions('pineapple');
486
+ ifct2017.descriptions('ananas comosus');
487
+ // → [ { code: 'E053',
488
+ // → name: 'Pineapple',
489
+ // → scie: 'Ananas comosus',
490
+ // → grup: 'Fruits',
491
+ // → desc: 'A. Ahnaros; B. Anarasa; G. Anenas; H. Ananas; Kan. Ananas; Kash. Punchitipul; Kh. Soh trun; Kon. Anas; Mal. Kayirha chakka; M. Kihom Ananas; O. Sapuri; P. Ananas; Tam. Annasi pazham; Tel. Anasa pandu; U. Ananas.' } ]
492
+
493
+ ifct2017.descriptions('tell me about cow milk.');
494
+ ifct2017.descriptions('gai ka doodh details.');
495
+ // → [ { code: 'L002',
496
+ // → name: 'Milk, Cow',
497
+ // → scie: '',
498
+ // → grup: 'Milk and Milk Products',
499
+ // → desc: 'A. Garoor gakhir; B. Doodh (garu); G. Gai nu dhudh; H. Gai ka doodh; Kan. Hasuvina halu; Kash. Doodh; Kh. Dud masi; M. San Sanghom; Mar. Doodh (gay); O. Gai dudha; P. Gaan da doodh; S. Gow kshiram; Tam. Pasumpaal; Tel. Aavu paalu.' } ]
500
+ ```
501
+
502
+ [descriptions-doc]: https://docs.google.com/spreadsheets/d/1dRKW2HJyWxDJliONe_URNxM0gPBmgZKqoF5lBotxOT8/edit?usp=sharing
503
+ [descriptions-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vSueRUdwru4BNvmLCK16cM8DYO3mum4c-g_8MILZvg6TsT3vaZChWOwN5cUS58GtrXMKqZHeHy0ajeG/pubhtml
504
+
505
+ <br>
506
+ <br>
507
+
508
+
509
+ ## Energies
510
+
511
+ Metabolizable *energy conversion factors*.
512
+
513
+ <br>
514
+
515
+ ```javascript
516
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
517
+ // ifct2017.loadEnergies() → corpus
518
+ // ifct2017.energiesSql([table], [options]) → SQL statements
519
+ // ifct2017.energiesCsv() → path of CSV file
520
+ // ifct2017.energies(query)
521
+ // → matches [{component, kj, kcal}]
522
+
523
+
524
+ await ifct2017.loadEnergies();
525
+ // Load corpus first
526
+
527
+ ifct2017.energies('dietary fibre');
528
+ ifct2017.energies('Soluble fibre');
529
+ // → [ { component: 'Fibre', kj: 8, kcal: 2 } ]
530
+
531
+ ifct2017.energies('what is energy conversion factor of fat?');
532
+ ifct2017.energies('conversion factor of fat');
533
+ // → [ { component: 'Fat', kj: 37, kcal: 9 } ]
534
+ ```
535
+
536
+ [energies-doc]: https://docs.google.com/spreadsheets/d/1Go_O1rv7gwDw9GFx5S9-eBOOEueyrSnqf2KmQmB5ZEw/edit?usp=sharing
537
+ [energies-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vRbNMeTawz-rXs53C9NTcMkJVnLCzJ79kxbOahFhq49Q7qDFMApQ5fcFvUoTGs6nDyHshtwcIzXMLiM/pubhtml
538
+
539
+ <br>
540
+ <br>
541
+
542
+
543
+ ## Frequency distribution
544
+
545
+ *Frequency distribution* of States/UTs for fixing the number of districts to be sampled.
546
+
547
+ <br>
548
+
549
+ ```javascript
550
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
551
+ // ifct2017.loadFrequencyDistribution() → corpus
552
+ // ifct2017.frequencyDistributionSql([table], [options]) → SQL statements
553
+ // ifct2017.frequencyDistributionCsv() → path of CSV file
554
+ // ifct2017.frequencyDistribution(districts)
555
+ // → {districts, states, selected, sampled} if found, null otherwise
556
+
557
+
558
+ await ifct2017.loadFrequencyDistribution();
559
+ // Load corpus first
560
+
561
+ ifct2017.frequencyDistribution(2);
562
+ ifct2017.frequencyDistribution(5);
563
+ // → { districts: '1-5', states: 9, selected: 1, sampled: 9 }
564
+
565
+ ifct2017.frequencyDistribution(32);
566
+ ifct2017.frequencyDistribution(37);
567
+ // → { districts: '31-40', states: 4, selected: 5, sampled: 20 }
568
+ ```
569
+
570
+ <br>
571
+ <br>
572
+
573
+
574
+ ## Groups
575
+
576
+ *Categorization* of food by their common names.
577
+
578
+ <br>
579
+
580
+ ```javascript
581
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
582
+ // ifct2017.loadGroups() → corpus
583
+ // ifct2017.groupsSql([table], [options]) → SQL statements
584
+ // ifct2017.groupsCsv() → path of CSV file
585
+ // ifct2017.groups(query)
586
+ // → matches [{code, group, entries, tags}]
587
+
588
+
589
+ await ifct2017.loadGroups();
590
+ // Load corpus first
591
+
592
+ ifct2017.groups('cereals');
593
+ ifct2017.groups('Millet');
594
+ // → [ { code: 'A',
595
+ // → group: 'Cereals and Millets',
596
+ // → entries: 24,
597
+ // → tags: 'vegetarian eggetarian fishetarian veg' } ]
598
+
599
+ ifct2017.groups('what is vegetable?');
600
+ ifct2017.groups('vegetable group code?');
601
+ // → [ { code: 'D',
602
+ // → group: 'Other Vegetables',
603
+ // → entries: 78,
604
+ // → tags: 'vegetarian eggetarian fishetarian veg' },
605
+ // → { code: 'C',
606
+ // → group: 'Green Leafy Vegetables',
607
+ // → entries: 34,
608
+ // → tags: 'vegetarian eggetarian fishetarian veg' } ]
609
+ ```
610
+
611
+ [groups-doc]: https://docs.google.com/spreadsheets/d/1PMR0TZLLYsS70lcC0Bap4oNrI1azgmuGx9ekfHJB_0Q/edit?usp=sharing
612
+ [groups-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vSsXdKiSvWypa6aJlCfl_eKIzAOfESO_wHITJtPik3K1goIy81hciSjmTCqFjmFv1cqrLdnYhg1Q3O1/pubhtml
613
+
614
+ <br>
615
+ <br>
616
+
617
+
618
+ ## Hierarchy
619
+
620
+ Tree-like *hierarchy* of nutrients, and its components.
621
+
622
+ <br>
623
+
624
+ ```javascript
625
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
626
+ // ifct2017.loadHierarchy() → corpus
627
+ // ifct2017.hierarchySql([table], [options]) → SQL statements
628
+ // ifct2017.hierarchyCsv() → path of CSV file
629
+ // ifct2017.hierarchy(query)
630
+ // → {parents, ancestry, children} if found, null otherwise
631
+
632
+
633
+ await ifct2017.loadHierarchy();
634
+ // Load corpus first
635
+
636
+ ifct2017.hierarchy('soluble oxalic acid');
637
+ ifct2017.hierarchy('Soluble Oxalic Acid');
638
+ // → { parents: 'oxalt', ancestry: 'oxalt orgac', children: '' }
639
+
640
+ ifct2017.hierarchy('what is ifct2017.hierarchy of total saturated fat?');
641
+ ifct2017.hierarchy('who are children of total saturated fat?');
642
+ // → { parents: 'fatce',
643
+ // → ancestry: 'fatce',
644
+ // → children:
645
+ // → 'f4d0 f6d0 f8d0 f10d0 f11d0 f12d0 f14d0 f15d0 f16d0 f18d0 f20d0 f22d0 f24d0' }
646
+ ```
647
+
648
+ [hierarchy-doc]: https://docs.google.com/spreadsheets/d/174DDCwdVRZ0RQT8zfGFSciQltA2sIHIIRXkWiejU_JQ/edit?usp=sharing
649
+ [hierarchy-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vR1C-FJ2driNzJ_rRVmftv_wYPo4Rz4SJKGEo-pFNccvbF3nsAFj2zmbiGHDGlX4YnozoqMydg0xBwZ/pubhtml
650
+
651
+ <br>
652
+ <br>
653
+
654
+
655
+ ## Intakes
656
+
657
+ *Recommended daily intakes* of nutrients.
658
+
659
+ <br>
660
+
661
+ ```javascript
662
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
663
+ // ifct2017.loadIntakes() → corpus
664
+ // ifct2017.intakesSql([table], [options]) → SQL statements
665
+ // ifct2017.intakesCsv() → path of CSV file
666
+ // ifct2017.intakes(query)
667
+ // → matches [{code, whorda, usear, usrdam, usrdaf, euprim, euprif, ulus, uleu, uljapan}]
668
+
669
+
670
+ await ifct2017.loadIntakes();
671
+ // Load corpus first
672
+
673
+ ifct2017.intakes('his');
674
+ ifct2017.intakes('Histidine');
675
+ // → [{ code: 'his',
676
+ // → whorda: -0.01,
677
+ // → usear: NaN,
678
+ // → usrdam: -0.014,
679
+ // → usrdaf: NaN,
680
+ // → euprim: NaN,
681
+ // → euprif: NaN,
682
+ // → ulus: NaN,
683
+ // → uleu: NaN,
684
+ // → uljapan: NaN }]
685
+
686
+ ifct2017.intakes('intake of total fibre?');
687
+ ifct2017.intakes('what is rda of total fiber?');
688
+ // → [{ code: 'fibtg',
689
+ // → whorda: NaN,
690
+ // → usear: NaN,
691
+ // → usrdam: 38,
692
+ // → usrdaf: 25,
693
+ // → euprim: NaN,
694
+ // → euprif: NaN,
695
+ // → ulus: NaN,
696
+ // → uleu: NaN,
697
+ // → uljapan: NaN }]
698
+
699
+
700
+ // Note:
701
+ // +ve value indicates amount in grams.
702
+ // -ve value indicates amount in grams per kg of body weight.
703
+ // NaN indicates no recommentation given.
704
+
705
+ // Note:
706
+ // whorda: WHO Recommended Dietary Allowance
707
+ // usear: US Estimated Average Requirement
708
+ // usrdam: US Recommended Dietary Allowance (Male)
709
+ // usrdaf: US Recommended Dietary Allowance (Female)
710
+ // euprim: EU Population Reference Intake (Male)
711
+ // euprif: EU Population Reference Intake (Female)
712
+ // ulus: Tolerable intake Upper Level (US)
713
+ // uleu: Tolerable intake Upper Level (EU)
714
+ // uljapan: Tolerable intake Upper Level (Japan)
715
+ ```
716
+
717
+ [intakes-doc]: https://docs.google.com/spreadsheets/d/14rD34GjeJ6jx9-RXLa7zu4m_896CojCP4qSTPKeWLEU/edit?usp=sharing
718
+ [intakes-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vShOB5MaBlnccsBXPGT1KbG3442fF7ZPChdJCm7Ez3C9ejVF6503gMY28dOOdBJRDpCLL9o0BfJO8Nj/pubhtml
719
+
720
+ <br>
721
+ <br>
722
+
723
+
724
+ ## Jones factors
725
+
726
+ *Jones factors* for conversion of nitrogen to protein.
727
+
728
+ <br>
729
+
730
+ ```javascript
731
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
732
+ // ifct2017.loadJonesFactors() → corpus
733
+ // ifct2017.jonesFactorsSql([table], [options]) → SQL statements
734
+ // ifct2017.jonesFactorsCsv() → path of CSV file
735
+ // ifct2017.jonesFactors(query)
736
+ // → matches [{food, factor}]
737
+
738
+
739
+ await ifct2017.loadJonesFactors();
740
+ // Load corpus first
741
+
742
+ ifct2017.jonesFactors('maida');
743
+ ifct2017.jonesFactors('Refined wheat');
744
+ // → [ { food: 'Refined wheat flour (Maida)', factor: '5.70' } ]
745
+
746
+ ifct2017.jonesFactors('what is jones factor of barley?');
747
+ ifct2017.jonesFactors('jones factor of oats');
748
+ // → [ { food: 'Barley and its flour;Rye and its flour;Oats',
749
+ // → factor: '5.83' } ]
750
+ ```
751
+
752
+ [jonesfactors-doc]: https://docs.google.com/spreadsheets/d/1OqV-MSaXH1ARXlyuyayyfj9NXoH1DvW5-n1oxOX4n0o/edit?usp=sharing
753
+ [jonesfactors-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vSfqNhcPoEpx9TbXLhlyLFYpN-JtKM0J6YtZN7He6Ad4fNoVGcNI3ILaW7PJkgsoTg7-XJqr39HRQe1/pubhtml
754
+
755
+ <br>
756
+ <br>
757
+
758
+
759
+ ## Languages
760
+
761
+ Full form of *language abbreviations*.
762
+
763
+ <br>
764
+
765
+ ```javascript
766
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
767
+ // ifct2017.loadLanguages() → corpus
768
+ // ifct2017.languagesSql([table], [options]) → SQL statements
769
+ // ifct2017.languagesCsv() → path of CSV file
770
+ // ifct2017.languages(query)
771
+ // → {abbr, lang} if found, null otherwise.
772
+
773
+
774
+ await ifct2017.loadLanguages();
775
+ // Load corpus first
776
+
777
+ ifct2017.languages('mal.');
778
+ ifct2017.languages('Mal');
779
+ // → { abbr: 'Mal.', lang: 'Malayalam' }
780
+
781
+ ifct2017.languages('what is s.?');
782
+ ifct2017.languages('S. stands for?');
783
+ // → { abbr: 'S.', lang: 'Sanskrit' }
784
+
785
+
786
+ // Note:
787
+ // Full stops must immediately follow character, if present.
788
+ // For single character abbreviations, full stop is mandatory.
789
+ ```
790
+
791
+ [languages-doc]: https://docs.google.com/spreadsheets/d/1NrdVtCYtmxooVtdGj9UQOPR7l4HIJc9qeI7BNoytGhI/edit?usp=sharing
792
+ [languages-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vTrDSLb2ABbFM8v7QVXqVR0QV7ha58ZJS3Kw6RmtgcwaN6GjNv_hfEZ3K-NqACpT9sIyv7oFysY6z_p/pubhtml
793
+
794
+ <br>
795
+ <br>
796
+
797
+
798
+ ## Methods
799
+
800
+ *Analytical methods* of nutrient and bioactive components.
801
+
802
+ <br>
803
+
804
+ ```javascript
805
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
806
+ // ifct2017.loadMethods() → corpus
807
+ // ifct2017.methodsSql([table], [options]) → SQL statements
808
+ // ifct2017.methodsCsv() → path of CSV file
809
+ // ifct2017.methods(query)
810
+ // → {analyte, method, reference} if found, null otherwise
811
+
812
+
813
+ await ifct2017.loadMethods();
814
+ // Load corpus first
815
+
816
+ ifct2017.methods('soluble oxalic acid');
817
+ ifct2017.methods('Insoluble Oxalic Acid');
818
+ // → { analyte: 'Oxalic acid (Total), Soluble oxalic acid, Insoluble oxalic acid',
819
+ // → method: 'Fast- HPLC',
820
+ // → reference: 'Moreau & Savage (2009)' }
821
+
822
+ ifct2017.methods('what is analytical method of saponin?');
823
+ ifct2017.methods('how is total saponin measured?');
824
+ // → { analyte: 'Total Saponin',
825
+ // → method: 'Colorimetry',
826
+ // → reference: 'Dini et al. (2009)' }
827
+ ```
828
+
829
+ [methods-doc]: https://docs.google.com/spreadsheets/d/11nJ7RfjgcTUz1bPmI7EWWOZSAxvwvXseG4AFqtLU3-o/edit?usp=sharing
830
+ [methods-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vShqmhmDcwBNV1Qz-uAed412gfPQBHbO0--NkS7EwuEWjNI3trjMy0Widnqx8eM05B9a-PQLssOzLcj/pubhtml
831
+
832
+ <br>
833
+ <br>
834
+
835
+
836
+ <!-- ## Nutrients
837
+
838
+ Detailed description of various *nutrients*, and its components.
839
+
840
+ <br>
841
+
842
+ ```javascript
843
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
844
+ // ifct2017.loadNutrients() // → corpus
845
+ // ifct2017.nutrients(query)
846
+ // → nutrient description if found, null otherwise
847
+
848
+
849
+ await ifct2017.loadNutrients();
850
+ // Load corpus first
851
+
852
+ ifct2017.nutrients('his');
853
+ ifct2017.nutrients('Histidine');
854
+ // → Amino acid profile of each food is determined by three different analyses.
855
+ // → Tryptophan is determined by alkaline hydrolysis, methionine and cystine by
856
+ // → performic oxidation and the rest of the amino acids by acid hydrolysis. The
857
+ // → amino acid profile of each food is expressed as g/100 g protein.
858
+
859
+ ifct2017.nutrients('what is soluble oxalate?');
860
+ ifct2017.nutrients('are organic acids useful?');
861
+ // → Organic acids is naturally present in a wide variety of foods especially fruits,
862
+ // → berries and vegetables. Organic acids cis-aconitic acid, citric acid, fumaric
863
+ // → acid, mallic acid, quinic acid, succinic acid and tartaric acid were determined
864
+ // → in single liquid chromatographic run. Soluble, insoluble and total oxalates were
865
+ // → determined separately by HPLC method. The organic acids are energy contributing
866
+ // → components, although it varies between the different organic acids. According to
867
+ // → the Codex Alimentarius Commission’s Guidelines for Nutrition Labeling, the energy
868
+ // → conversion factor for organic acids is 13 kJ/g. However, organic acids have not
869
+ // → been included in the total energy of foods given in the IFCT.
870
+ ```
871
+
872
+ <br>
873
+ <br> -->
874
+
875
+
876
+ ## Pictures
877
+
878
+ Single representative *photo* of each foods (JPEG, 307x173).
879
+
880
+ <br>
881
+
882
+ ```javascript
883
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
884
+ // ifct2017.picturesUnpkg(code) → UNPKG URL | null
885
+ // ifct2017.picturesJsDelivr(code) → jsDelivr URL | null
886
+ // ifct2017.pictures(code)
887
+ // → path is present, null otherwise
888
+
889
+
890
+ ifct2017.pictures('A001');
891
+ // C:\Documents\pictures\A001.jpeg
892
+
893
+ ifct2017.picturesUnpkg('A001');
894
+ // https://unpkg.com/@ifct2017/pictures/assets/A001.jpeg
895
+
896
+ ifct2017.picturesJsDelivr('A001');
897
+ // https://cdn.jsdelivr.net/npm/@ifct2017/pictures/assets/A001.jpeg
898
+ ```
899
+
900
+ [pictures-doc]: https://docs.google.com/document/d/1UVWVh-wPOR80M2sTy5naIJvR5DUNtf7lbOaPgCNQ9t4/edit?usp=sharing
901
+ [pictures-web]: https://docs.google.com/document/d/e/2PACX-1vSyo24GtsTF0wuhKUndF6w5KZa1gZU7kDyDun-6-QZvsO-Hy7Zn2chxxyYa3gSp5kzy-4AQrfHqF0N0/pub
902
+
903
+ <br>
904
+ <br>
905
+
906
+
907
+ ## Regions
908
+
909
+ Categorization of the States/UTs into six different regions.
910
+
911
+ <br>
912
+
913
+ ```javascript
914
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
915
+ // ifct2017.loadRegions() → corpus
916
+ // ifct2017.regionsSql([table], [options]) → SQL statements
917
+ // ifct2017.regionsCsv() → path of CSV file
918
+ // ifct2017.regions(query)
919
+ // → matches [{region, states}]
920
+
921
+
922
+ await ifct2017.loadRegions();
923
+ // Load corpus first
924
+
925
+ ifct2017.regions('central');
926
+ ifct2017.regions('Uttaranchal');
927
+ // → [ { region: 'Central',
928
+ // → states: 'Chhattisgarh;Madhya Pradesh;Uttar Pradesh;Uttaranchal' } ]
929
+
930
+ ifct2017.regions('which region andhra pradesh belongs to?');
931
+ ifct2017.regions('details of south region');
932
+ // → [ { region: 'South',
933
+ // → states: 'Andaman & Nicobar Islands;Andhra Pradesh;Karnataka;Kerala;Lakshadweep;Pondicherry;Telangana;Tamil Nadu' } ]
934
+ ```
935
+
936
+ [regions-doc]: https://docs.google.com/spreadsheets/d/1a01-O3cex87z9My2hF3ByoUMVMLZtMYKuRFGTbmcIzQ/edit?usp=sharing
937
+ [regions-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vRXTC_URrQPaVbgG0tyMvJGkuaZgTjaQ9UZivesdtVBgpJXWHQldR9ps8C04HVDcZmEuKjCX2LhjUNA/pubhtml
938
+
939
+ <br>
940
+ <br>
941
+
942
+
943
+ ## Representations
944
+
945
+ *Representations* of columns (as factors and units).
946
+
947
+ <br>
948
+
949
+ ```javascript
950
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
951
+ // ifct2017.loadRepresentations() → corpus
952
+ // ifct2017.representationsSql([table], [options]) → sql statements
953
+ // ifct2017.representationsCsv() → path of csv file
954
+ // ifct2017.representations(query)
955
+ // → {type, factor, unit} if found, null otherwise
956
+
957
+
958
+ await ifct2017.loadRepresentations();
959
+ // Load corpus first
960
+
961
+ ifct2017.representations('his');
962
+ ifct2017.representations('Histidine');
963
+ // → { type: 'mass', factor: 1000, unit: 'mg' }
964
+
965
+ ifct2017.representations('representation of vitamin d?');
966
+ ifct2017.representations('what is unit of ergocalciferol?');
967
+ // → { type: 'mass', factor: 1000000000, unit: 'ng' }
968
+
969
+
970
+ // Note:
971
+ // type: Type of physical quantity
972
+ // factor: Multiplication factor
973
+ // unit: Unit symbol
974
+ ```
975
+
976
+ <br>
977
+ <br>
978
+
979
+
980
+ ## Sampling units
981
+
982
+ Number of primary *sampling units* in each State/UT.
983
+
984
+ <br>
985
+
986
+ ```javascript
987
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
988
+ // ifct2017.loadSamplingUnits() → corpus
989
+ // ifct2017.samplingUnitsSql([table], [options]) → SQL staments
990
+ // ifct2017.samplingUnitsCsv() → path of CSV file
991
+ // ifct2017.samplingUnits(query)
992
+ // → matches [{sno, state, districts, selected}]
993
+
994
+
995
+ await ifct2017.loadSamplingUnits();
996
+ // Load corpus first
997
+
998
+ ifct2017.samplingUnits('andaman');
999
+ ifct2017.samplingUnits('Nicobar');
1000
+ // → [ { sno: 'A',
1001
+ // → state: 'Andaman & Nicobar',
1002
+ // → districts: 3,
1003
+ // → selected: 1 } ]
1004
+
1005
+ ifct2017.samplingUnits('sampling units in orissa?');
1006
+ ifct2017.samplingUnits('orissa\'s sampling units');
1007
+ // → [ { sno: '20', state: 'Orissa', districts: 30, selected: 4 } ]
1008
+ ```
1009
+
1010
+ [samplingunits-doc]: https://docs.google.com/spreadsheets/d/1Wm6eqy0TRwUItBHrU-OU4jVBRuYm162y2viZlP8JyuM/edit?usp=sharing
1011
+ [samplingunits-web]: https://docs.google.com/spreadsheets/d/e/2PACX-1vTL7Qe0f_MEe_6JtxiiROTb-mVewlGjrYlj2u3jPaRkz7mOgUjwOpsrTIPYUSAaKXD781_dCewAIiE9/pubhtml
1012
+
1013
+ <br>
1014
+ <br>
1015
+
1016
+
1017
+ ## Yield Factors
1018
+
1019
+ *Yield factors* for conversion of raw food to edible portion.
1020
+
1021
+ <br>
1022
+
1023
+ ```javascript
1024
+ import * as ifct2017 from "jsr:@nodef/ifct2017";
1025
+ // ifct2017.loadYieldFactors() → corpus
1026
+ // ifct2017.yieldFactorsSql([table], [options]) → SQL staments
1027
+ // ifct2017.yieldFactorsCsv() → path of CSV file
1028
+ // ifct2017.yieldFactors(query)
1029
+ // → matches [{code, name, scie, yield, preparation}]
1030
+
1031
+
1032
+ await ifct2017.loadYieldFactors();
1033
+ // Load corpus first
1034
+
1035
+
1036
+
1037
+ ifct2017.yieldFactors('mango');
1038
+ ifct2017.yieldFactors('Mangifera indica');
1039
+ // → [ { code: 'D057',
1040
+ // → name: 'Mango, green, raw',
1041
+ // → scie: 'Mangifera indica',
1042
+ // → lang: 'A. Keasa aam; B. Aam (kancha); G. Ambo; H. Katcha Aam; Kan. Mavinakayi; Kash. Kach Aamb; Kh. Soh pieng im; Mal. Manga; M. Heinou Ashangba; Mar. Amba; O. Ambu (kacha); P. Kaccha aam; Tam. Mangai; Tel. Mamidikaya; U. Kaccha aam.',
1043
+ // → grup: 'Other Vegetables',
1044
+ // → regn: 6,
1045
+ // → tags: 'vegetarian eggetarian fishetarian veg',
1046
+ // → yield: 0.6833333333,
1047
+ // → preparation: 'Washing, Peeling, Seed removal' } ]
1048
+
1049
+ ifct2017.yieldFactors('yield factor of cow milk?');
1050
+ ifct2017.yieldFactors('gai ka doodh');
1051
+ // → [ { code: 'L002',
1052
+ // → name: 'Milk, Cow',
1053
+ // → scie: '',
1054
+ // → lang: 'A. Garoor gakhir; B. Doodh (garu); G. Gai nu dhudh; H. Gai ka doodh; Kan. Hasuvina halu; Kash. Doodh; Kh. Dud masi; M. San Sanghom; Mar. Doodh (gay); O. Gai dudha; P. Gaan da doodh; S. Gow kshiram; Tam. Pasumpaal; Tel. Aavu paalu.',
1055
+ // → grup: 'Milk and Milk Products',
1056
+ // → regn: 6,
1057
+ // → tags: 'vegetarian eggetarian fishetarian veg',
1058
+ // → yield: 1,
1059
+ // → preparation: 'None' } ]
1060
+ ```
1061
+
1062
+ <br>
1063
+ <br>
1064
+
1065
+
1066
+ ## License
1067
+
1068
+ As of 18 April 2025, this project is licensed under AGPL-3.0. Previous versions remain under MIT.
1069
+
1070
+ <br>
1071
+ <br>
1072
+
1073
+
1074
+ [![](https://raw.githubusercontent.com/qb40/designs/gh-pages/0/image/11.png)](https://wolfram77.github.io)<br>
1075
+ [![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
1076
+ ![](https://ga-beacon.deno.dev/G-RC63DPBH3P:SH3Eq-NoQ9mwgYeHWxu7cw/github.com/nodef/ifct2017)