ifct2017 2.0.14 → 2.1.0

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