Closed marcolarosa closed 2 years ago
I got the lookup function in lookup.js which requires the datapacks array from index.js
some examples for lookups can be found in lookup_test.js
I experimented with async-await but settled on using promises for fetching the files parallel if there are more than one.
The lookup as of now does not include the crossreferencing of Austlang and Glottolog ids yet.
done for now
To make this easier on the calling application we might want a top level index that maps a pointer from the
packName
to the actual data file online. e.g.Then, when the calling app calls
lookup({ packName: ['Austlang']...)
the code could download from github and cache locally for use next time.Also have a look at https://github.com/Language-Research-Technology/language-data-node-tools/blob/master/lib/langs.js