"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTxtWordList = void 0;
const fs_1 = __importDefault(require("fs"));
const downloadFile_1 = require("./downloadFile");
const extractWords_1 = require("./extractWords");
const getTxtWordList = async (url, locale) => {
    const tempFilename = await (0, downloadFile_1.downloadFile)(url);
    const file = fs_1.default.readFileSync(tempFilename, 'utf-8');
    const words = (0, extractWords_1.extractWords)(file.toLocaleString(), locale);
    fs_1.default.unlinkSync(tempFilename);
    return words;
};
exports.getTxtWordList = getTxtWordList;
