Skip to content

Commit

Permalink
hubda
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond committed Jan 25, 2025
1 parent 698b618 commit 4072021
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions public/assets/std.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,38 @@ async function speechda(
samples('shabda/speech/' + locale + '/' + gender + ':' + words.join(','));
}

async function hubda(orgList, repoList = '') {
const orgs = listToArray(orgList);

const orgRepos = [];
const orgChoices = [];
for (const org of orgs) {
if (org.includes('/')) {
const [orgName, repoName] = org.split('/');
orgRepos.push({ org: orgName, repo: repoName });
} else {
orgChoices.push(org);
}
}

const repoChoices = listToArray(repoList);

for (const orgChoice of orgChoices) {
for (const repoChoice of repoChoices) {
orgRepos.push({ org: orgChoice, repo: repoChoice });
}
}

console.log(orgRepos);

const addresses = orgRepos.map(({ org, repo }) => 'github:' + org + '/' + repo);
for (const address of addresses) {
samples(address);
}
}

window.speechda = speechda;
window.spagda = spagda;
window.spag = spag;
window.hubda = hubda;
//=== END OF NUDEL STANDARD LIBRARY ===//

0 comments on commit 4072021

Please sign in to comment.