aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/translator.js
Commit message (Collapse)AuthorAge
* add cn reading processors (#1120)Cashew2024-06-24
| | | | | | | | | | | | | | | | | | | | | * add cn reading processors * remove meow * fix lint * add cn reading processors * remove meow * fix lint * wip * update names * update test * remove vestigial code
* use only longest substring that deinflects to headword (#1075)StefanVukovic992024-06-17
| | | | | | | * show only deinflection for longest matched text * cleanup * cleanup
* display inflection rule descriptions (#1000)24.6.3.0StefanVukovic992024-06-03
| | | | | | | | | | | | | | | | | | | | | * load descriptions in deinflector * description functions in deinflectors * show descriptions in title * use toaster * use names without internal * css lint * reformat transform descriptors * fix merge errors * done? * rename method
* Allow trailing commas in ESLint (#1013)James Maa2024-05-31
| | | | | * Update comma-dangle rule * Fix dangling commas
* improve preprocessing performance (#973)StefanVukovic992024-05-22
| | | | | | | | | | | * mvp * cleanup * cleanup types * descriptive variable * type
* Allow ordering term dictionaries with the same priority using the ui order ↵Kuuuube2024-05-21
| | | | | | | | | | | | | | | | | | | (#981) * Remove score from dictionary sorting * Update tests * Allow score sorting after dict order * Update tests * Sort by score before index * Move headwordIndices and headwords below score * Update tests * Move definition count back under headwords
* fix search resolution infinite loop (#938)StefanVukovic992024-05-14
|
* Update eslint unsafe rule (#887)James Maa2024-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable @typescript-eslint/no-unsafe-assignment * Updates * Add missing import * Updates * Fix types? * Fix tests * Address comments * Move TextProcessorVariant to types * Update types/ext/translation-internal.d.ts Co-authored-by: StefanVukovic99 <stefanvukovic44@gmail.com> Signed-off-by: James Maa <jmaa@berkeley.edu> --------- Signed-off-by: James Maa <jmaa@berkeley.edu> Co-authored-by: toasted-nutbread <toasted-nutbread@users.noreply.github.com> Co-authored-by: StefanVukovic99 <stefanvukovic44@gmail.com>
* rework text processors (#793)24.4.21.0StefanVukovic992024-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | * rework text processors * rename text-preprocessors file * Fix search header left margins on small screens (#839) * Refocuses search input on backspace (#840) Fixes #775. Note that this behavior gets overridden if backspace is set as a shortcut action. * Change hotkey triggering condition to account for IME usage (#837) _isKeyCharacterInput only worked when not using an IME, as inside of an IME when a keydown event is fired, the key is reported as "Process", which does not have a key.length equal to 1. This resulted in hotkeys being triggered while typing, which this commit fixes. --------- Co-authored-by: James Maa <jmaa@berkeley.edu> Co-authored-by: Kuuuube <61125188+Kuuuube@users.noreply.github.com> Co-authored-by: Andrew Thomas Sartor <andrew@sartor.net>
* improve term sorting (#806)24.4.15.0StefanVukovic992024-04-15
| | | | | * improve term sorting * edge case
* expand deinflection format (#745)StefanVukovic992024-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * abstract deinflections * undo redundant changes * remove cast * switch to js * MultiLanguageTransformer * comments * comments * fix test * suffixInflection * fix bench * substring instead of replace * without heuristic * suffixMap * add other language deinflections * wip * catch cycles * fix tests * uninflect to deinflect * use less regex * add suru masu stem deinflection
* make deinflections language-specific (#720)StefanVukovic992024-02-27
| | | | | | | | | | | | | * abstract deinflections * undo redundant changes * remove cast * MultiLanguageTransformer * comments * comments
* Turn on @typescript-eslint/no-unsafe-argument (#728)24.2.26.0toasted-nutbread2024-02-25
|
* Constructor simplification (#713)toasted-nutbread2024-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update AudioDownloader * Update Translator * Update ClipboardMonitor * Update ClipboardReader * Update PanelElement * Update QueryParser * Update DisplayGenerator * Update DisplayHistory * Update DOMDataBinder * Remove unnecessary cast * Update Popup types * One declaration per line * Remove optionals from Frontend constructor * Fix Translator constructor
* add language select, abstract text transformations (#584)StefanVukovic992024-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions * part1 * frotend done? * fix tests * offscreen and type complications * add tests * start fixing tests * keep fixing tests * fix tests * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions * delete pt * renames * add tests * kebab-case filenames * lint * minor fixes * merge * fixes * fix part of comments * fix more comments * delete unused types * comment * comment * do backend * other files * move fetch utils to own file * remove extra line * add extra line * remove unnecessary export * simplify folder structure * remove redundant async * fix param type in api * fix language index * undo changes to cssStyleApplier * undo changes to utilities.js * undo changes to utilities.js * simplify language util * lint * undo phantom changes to anki integration * require textTransformations options * explicit locale in localeCompare * punctuate notes * prefer early exit * rename LanguageOptionsObjectMap * rename to textPreprocessor * tuple with names instead of boolean array * safe data setting * optional chaining * simplify LanguageOptions * encapsulate languages * delete language util * nullable language in text preprocessors controller * rename transform to process * remove settings * make translation advanced again * remove unused getTextTransformations api call * comments * change language types * RIP flags * comments * fix tests * lint * Text preprocessor type changes (#10) * Add types * Update types * Simplify type check * Refactor typing and structuring of language definitions * lint * update translator benchmark * undo markdown changes * undo markdown changes * undo markdown changes * more merge * simplify language controller --------- Co-authored-by: toasted-nutbread <toasted-nutbread@users.noreply.github.com> Co-authored-by: Darius Jahandarie <djahandarie@gmail.com>
* Even more eslint rules (#696)toasted-nutbread2024-02-17
| | | | | | | | | * capitalized-comments * Turn rules on * Add miscellaneous rules * More rules
* Eslint rule updates (#673)toasted-nutbread2024-02-15
| | | | | | | | | | | | | | | | | * Install unicorn * Add rules * Fix issues * Install sonarjs * Set up rules * Fix issues * Install eslint-plugin-import and fix import extensions * Simplify permitted error names
* move files (#630)StefanVukovic992024-02-04
|
* Module refactoring (#588)toasted-nutbread2024-01-31
| | | | | | | | | | | | | | | | | | | | | * Convert PronunciationGenerator into static functions * Convert DictionaryDataUtil into static functions * Convert AnkiNoteDataCreator into static functions * Convert MediaUtil into static functions * Convert RegexUtil into static functions * Convert StringUtil into static functions * Convert ArrayBufferUtil into static functions * Convert AnkiUtil into static functions * Convert PermissionsUtil into static functions * Convert ProfileConditionsUtil into static functions
* Language transformer (#582)toasted-nutbread2024-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Set up new deinflection data file * Define types * Test * Add internal types * Set up loading for transforms * Add getPartOfSpeechFlags * Convert static methods * Add note * Add transform function * Update trace structure * Add a language tag to the language transform descriptor * Add clear function * Add function for multiple parts of speech * Clarify naming * Add getConditionFlagsFromConditionType * Add plural function * Replace usages of Deinflector * Update tests * Update config * Remove old * Rename * Rename files
* JapaneseUtil refactor (#555)toasted-nutbread2024-01-28
| | | | | | | * Copy functions from JapaneseUtil * Remove JapaneseUtil * Update usages of JapaneseUtil functions
* Add Deinflector.rulesMatch helper function (#530)toasted-nutbread2024-01-20
|
* Update copyright year (#524)toasted-nutbread2024-01-20
| | | | | | | | | | | | | * Update copyright year * Update lib files * Rebase updates * Update dates * Update years to range * Update permitted pattern
* Dictionary deinflections (#503)StefanVukovic992024-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wip * wip * fix v3 * wip * fix tests * fix maxitems * hide deinflection definitions * fix anki template * undo unnecessary change * delete console.log * refactor * add set false to handlebars * lint * fix tests * fix comments * fix * use Map in areArraysEqualIgnoreOrder * move inflection source icons to css * lint * improve naming * fix tests * add test * typescript * use for of * wip * comments * anki template upgrade * update descriptions
* add option to disable part of speech rule check (#438)StefanVukovic992024-01-13
| | | | | | | | | | | | | | | | | | | | | | | * pos filter wip * add part of speech filter option * add part of speech filter option * remove from deinflector * update test * remove return * tie to dictionary * duplicate to welcome page * delete unused html * fix ts * typo
* search resolution option (#436)StefanVukovic992023-12-29
| | | | | | | | | | | | | | | * add search resolution setting * move finding next substring to method * use regex literal * fix comments * fix comments * add options update function * update test
* add phonetic transcriptions term meta type (#434)StefanVukovic992023-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move dictionary files to dictionary folder * wip * move dictionary files to dictionary folder * add ipa term meta * wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fixing comments wip * fix comments * fix comments * update test data * fix gitignore * engines * add tests * update database test * fix test
* move dictionary files to dictionary folder (#429)StefanVukovic992023-12-23
|
* rename variables (#409)Cashew2023-12-20
| | | | | | | | | | | * rename variables * add comment to ambiguous variable * rename variables * add comments * rename functions
* Template type improvements (#380)toasted-nutbread2023-12-19
| | | | | | | * Default templates to unknown * Default typescript templates to unknown * More template type updates
* Fix Non JP Scanning Option for Kanji Dictionaries (#372)marv2023-12-18
| | | | | | | * Fix non JP scanning option for kanji dictionaries * Fix trailing comma * Add removeNonJapaneseCharacters to test inputs
* Update offscreentoasted-nutbread2023-11-27
|
* Update typestoasted-nutbread2023-11-27
|
* Remove unneeded referencestoasted-nutbread2023-11-27
|
* Add JSDoc type annotations to project (rebased)toasted-nutbread2023-11-27
|
* Modernize codebaseDarius Jahandarie2023-11-04
| | | | | | - Use ES modules - Remove vendored libs and build them from npm using esbuild - Switch from JSZip to zip.js
* add sort dictionary data to parse results on the search pagepraschke2023-10-13
| | | | this is based on forsakeninfinity's commit https://github.com/forsakeninfinity/yomibaba/commit/c9887d51ed5c917bb900d7964614154de1d76872
* fixed eslint, changed header to only use 2 spaces, added missing headers to testAustin Siew2023-03-22
|
* Updated LICENSE to full license, added Yomitan 2023 to all license headersAustin Siew2023-03-21
|
* Sort using number of definitions (#2166)toasted-nutbread2022-05-29
|
* Sort using frequency dictionary before using dictionary priority (#2165)toasted-nutbread2022-05-29
|
* ESlint JSdoc (#2148)toasted-nutbread2022-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Install eslint-plugin-jsdoc * Initial rules setup * Update lists * Use @returns rather than @return * Remove error throwing code which is never executed * Fix issues relating to @throws * General error fixes * Update Display type documentation * Various doc fixes * Fix invalid tuple syntax * Doc updates * Remove unused * Doc updates * Enable jsdoc/require-returns * Update rules * Update remaining rules
* Add mode documentation about the types used by Translator (#2147)toasted-nutbread2022-05-19
|
* Update copyright date (#2062)toasted-nutbread2022-02-02
| | | | | | | * Update eslint settings * Update 2021 files * Update other files
* matchType/deinflect distinction (#2040)toasted-nutbread2021-12-17
| | | | | | | * Pass a "deinflect" option to findTerms * Update Translator to use deinflect option * Fix test input options
* Dictionary database term source info (#2039)toasted-nutbread2021-12-17
| | | | | | | | | | | | | | | | | | | * Update DictionaryDatabase._findMultiBulk's createResult callback signature * Simplify _splitField use * Update sequence * Expose new fields 'matchType' and 'matchSource' as part of term data * Expose matchType and matchSource as part of TermSource * Update sourceTermExactMatchCount calculation * Update test data * Expose matchType and matchSource info in HTML attributes * Add primaryMatchTypes attribute
* Replace 'wildcard' parameter with 'matchType' (#2038)toasted-nutbread2021-12-17
|
* String frequency support (#1989)toasted-nutbread2021-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | * Restore support for string frequency values * Add support for {value, displayValue} frequencies * Update test data * Improve number parsing of string frequencies * Improve reading detection * Expose a displayValue property for frequency information * Update docs * Expose displayValue to Anki note data * Fix translator * Update display generation * Update test data * Update counts
* Ensure frequency values are always numbers (#1943)toasted-nutbread2021-09-26
|
* Frequency dictionary sort (#1938)toasted-nutbread2021-09-26
| | | | | | | | | | | | | | | | | * Add sortDictionary/sortDictionaryOrder options * Update options * Add API.getTermFrequencies * Add settings * Implement frequency dictionary sorting * Update test * Update test data * Fix handling of undefined rank-based frequencies