Skip to content

Commit

Permalink
Update outputZipName function to include date in the zip name
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Dec 23, 2023
1 parent 3b251ed commit a829055
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/convertWikipedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import { parseLine } from './parseLine.js';
import { languagesAllowed } from './constants.js';

const linkCharacter = '⧉';
const outputZipName = (lang, version) => `${lang} Wikipedia (v${version}).zip`;
/**
*
* @param {string} lang
* @param {string} date
* @param {string} version
* @returns
*/
const outputZipName = (lang, date, version) => `${lang} Wikipedia [${date}] (v${version}).zip`;
const shortAbstractFile = (lang) =>
`short-abstracts_lang=${lang.toLowerCase()}.ttl`;

Expand Down Expand Up @@ -40,7 +47,7 @@ const shortAbstractFile = (lang) =>
}
}

console.log(`Processed ${processedLines} lines, exporting...`);
console.log(`Processed ${processedLines} lines, exporting zip...`);

await dict.setIndex({
title: `${lang} Wikipedia [${date}] (v${version})`,
Expand All @@ -58,7 +65,7 @@ div.gloss-sc-div[data-sc-wikipedia=term-specifier] {
});

await dict.export('./');
console.log(`Exported to ${outputZipName(lang)}`);
console.log(`Exported to ${outputZipName(lang, date, version)}`);
})().catch((e) => {
console.error(e);
});
Expand Down

0 comments on commit a829055

Please sign in to comment.