summaryrefslogtreecommitdiff
path: root/ext/js/language
diff options
context:
space:
mode:
authorCashew <52880648+Scrub1492@users.noreply.github.com>2023-12-19 14:22:22 +0900
committerGitHub <noreply@github.com>2023-12-19 05:22:22 +0000
commit5f96276fda93dcad39f2165fd3c8d890aa5f9be5 (patch)
tree1437c9298afa0ecd41414446043fe799026e8c79 /ext/js/language
parent7b93055f2e3d79729195fbd515cdccbf538c9376 (diff)
update JSDoc comments (#387)
* lesen-tan initial commit * update README.md * tidy up code * opt for Map<K, V> instead of Object * Document dev/* * add docs for deinflector.js * update deinflector example * Annotate * Revert "Merge branch 'development' of https://github.com/Scrub1492/lesen-tan into development" This reverts commit b92348f702bc031b36f24462adfa940d17f9ecdd, reversing changes made to 3255e6d963281af3533dcf1e893df39032d29fec. * Lint error fix * Lint error fix * update JSDoc comments --------- Co-authored-by: Darius Jahandarie <djahandarie@gmail.com>
Diffstat (limited to 'ext/js/language')
-rw-r--r--ext/js/language/deinflector.js6
-rw-r--r--ext/js/language/dictionary-database.js28
2 files changed, 8 insertions, 26 deletions
diff --git a/ext/js/language/deinflector.js b/ext/js/language/deinflector.js
index 90ca79ea..676f45a1 100644
--- a/ext/js/language/deinflector.js
+++ b/ext/js/language/deinflector.js
@@ -16,16 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-/**
- * This class deinflects Japanese terms to its dictionary form.
- */
export class Deinflector {
/**
* @param {import('deinflector').ReasonsRaw} reasons
* @example
* const deinflectionReasons = JSON.parse(
* readFileSync(path.join('ext/data/deinflect.json')).toString(),
- * ) as object;
+ * );
* const deinflector = new Deinflector(deinflectionReasons);
*/
constructor(reasons) {
@@ -101,7 +98,6 @@ export class Deinflector {
}
/**
- * Given a list of rules, return the corresponding deinflection rule flags.
* @param {string[]} rules
* @returns {import('translation-internal').DeinflectionRuleFlags}
*/
diff --git a/ext/js/language/dictionary-database.js b/ext/js/language/dictionary-database.js
index ce5041c8..c47e1e90 100644
--- a/ext/js/language/dictionary-database.js
+++ b/ext/js/language/dictionary-database.js
@@ -19,9 +19,6 @@
import {log, stringReverse} from '../core.js';
import {Database} from '../data/database.js';
-/**
- * This class represents the dictionary database.
- */
export class DictionaryDatabase {
constructor() {
/** @type {Database<import('dictionary-database').ObjectStoreName>} */
@@ -144,7 +141,6 @@ export class DictionaryDatabase {
}
/**
- * Purges the database.
* @returns {Promise<boolean>}
*/
async purge() {
@@ -166,7 +162,6 @@ export class DictionaryDatabase {
}
/**
- * Deletes a dictionary.
* @param {string} dictionaryName
* @param {number} progressRate
* @param {import('dictionary-database').DeleteDictionaryProgressCallback} onProgress
@@ -230,10 +225,9 @@ export class DictionaryDatabase {
}
/**
- * Find terms in bulk.
- * @param {string[]} termList The list of terms to find.
- * @param {import('dictionary-database').DictionarySet} dictionaries Dictionaries to find the terms from.
- * @param {import('dictionary-database').MatchType} matchType Matching type.
+ * @param {string[]} termList
+ * @param {import('dictionary-database').DictionarySet} dictionaries
+ * @param {import('dictionary-database').MatchType} matchType
* @returns {Promise<import('dictionary-database').TermEntry[]>}
*/
findTermsBulk(termList, dictionaries, matchType) {
@@ -265,9 +259,8 @@ export class DictionaryDatabase {
}
/**
- * Find exact terms in bulk.
- * @param {import('dictionary-database').TermExactRequest[]} termList The list of terms to find.
- * @param {import('dictionary-database').DictionarySet} dictionaries Dictionaries to find the term from.
+ * @param {import('dictionary-database').TermExactRequest[]} termList
+ * @param {import('dictionary-database').DictionarySet} dictionaries
* @returns {Promise<import('dictionary-database').TermEntry[]>}
*/
findTermsExactBulk(termList, dictionaries) {
@@ -277,7 +270,6 @@ export class DictionaryDatabase {
}
/**
- * Find terms by sequence in bulk.
* @param {import('dictionary-database').DictionaryAndQueryRequest[]} items
* @returns {Promise<import('dictionary-database').TermEntry[]>}
*/
@@ -288,7 +280,6 @@ export class DictionaryDatabase {
}
/**
- * Find term meta in bulk.
* @param {string[]} termList
* @param {import('dictionary-database').DictionarySet} dictionaries
* @returns {Promise<import('dictionary-database').TermMeta[]>}
@@ -300,9 +291,8 @@ export class DictionaryDatabase {
}
/**
- * Find kanji in bulk.
- * @param {string[]} kanjiList The list of kanji to find.
- * @param {import('dictionary-database').DictionarySet} dictionaries Dictionaries to find from.
+ * @param {string[]} kanjiList
+ * @param {import('dictionary-database').DictionarySet} dictionaries
* @returns {Promise<import('dictionary-database').KanjiEntry[]>}
*/
findKanjiBulk(kanjiList, dictionaries) {
@@ -312,7 +302,6 @@ export class DictionaryDatabase {
}
/**
- * Find kanji meta in bulk.
* @param {string[]} kanjiList
* @param {import('dictionary-database').DictionarySet} dictionaries
* @returns {Promise<import('dictionary-database').KanjiMeta[]>}
@@ -324,7 +313,6 @@ export class DictionaryDatabase {
}
/**
- * Find tag meta in bulk.
* @param {import('dictionary-database').DictionaryAndQueryRequest[]} items
* @returns {Promise<(import('dictionary-database').Tag|undefined)[]>}
*/
@@ -335,7 +323,6 @@ export class DictionaryDatabase {
}
/**
- * Find tag for title.
* @param {string} name
* @param {string} dictionary
* @returns {Promise<?import('dictionary-database').Tag>}
@@ -356,7 +343,6 @@ export class DictionaryDatabase {
}
/**
- * Get dictionary metadata.
* @returns {Promise<import('dictionary-importer').Summary[]>}
*/
getDictionaryInfo() {