2022-09-05 16:57:11 -04:00
|
|
|
import { WordlistOwl } from "./wordlist-owl.js";
|
|
|
|
import { decodeOwlA } from "./decode-owla.js";
|
2022-11-30 15:44:23 -05:00
|
|
|
/**
|
|
|
|
* An OWL-A format Wordlist extends the OWL format to add an
|
|
|
|
* overlay onto an OWL format Wordlist to support diacritic
|
|
|
|
* marks.
|
|
|
|
*
|
|
|
|
* This class is generally not useful to most developers as
|
|
|
|
* it is used mainly internally to keep Wordlists for languages
|
|
|
|
* based on latin-1 small.
|
|
|
|
*
|
|
|
|
* If necessary, there are tools within the ``generation/`` folder
|
2023-06-01 17:52:58 -04:00
|
|
|
* to create the necessary data.
|
2022-11-30 15:44:23 -05:00
|
|
|
*/
|
2022-09-05 16:57:11 -04:00
|
|
|
export class WordlistOwlA extends WordlistOwl {
|
|
|
|
#accent;
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Creates a new Wordlist for %%locale%% using the OWLA %%data%%
|
|
|
|
* and %%accent%% data and validated against the %%checksum%%.
|
|
|
|
*/
|
2022-09-05 16:57:11 -04:00
|
|
|
constructor(locale, data, accent, checksum) {
|
|
|
|
super(locale, data, checksum);
|
|
|
|
this.#accent = accent;
|
|
|
|
}
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* The OWLA-encoded accent data.
|
|
|
|
*/
|
2022-09-05 16:57:11 -04:00
|
|
|
get _accent() { return this.#accent; }
|
2023-06-01 17:52:58 -04:00
|
|
|
/**
|
|
|
|
* Decode all the words for the wordlist.
|
|
|
|
*/
|
2022-09-05 16:57:11 -04:00
|
|
|
_decodeWords() {
|
|
|
|
return decodeOwlA(this._data, this._accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//# sourceMappingURL=wordlist-owla.js.map
|