Deinflection fixes
This commit is contained in:
parent
059b2eb4f2
commit
a1bab38a2d
@ -36,6 +36,13 @@ function onMessage(request, sender, callback) {
|
||||
}
|
||||
}
|
||||
|
||||
function onInit() {
|
||||
chrome.runtime.onMessage.addListener(onMessage);
|
||||
|
||||
const res1 = window.trans.findTerm('食べられない');
|
||||
const res2 = window.trans.findTerm('作られている');
|
||||
}
|
||||
|
||||
(() => {
|
||||
const res = {
|
||||
rules: 'jp/data/rules.json',
|
||||
@ -44,8 +51,5 @@ function onMessage(request, sender, callback) {
|
||||
kanjidic: 'jp/data/kanjidic.json'
|
||||
};
|
||||
|
||||
window.trans = new Translator(
|
||||
res,
|
||||
() => chrome.runtime.onMessage.addListener(onMessage)
|
||||
);
|
||||
window.trans = new Translator(res, onInit);
|
||||
})();
|
||||
|
@ -98,6 +98,10 @@ class Translator {
|
||||
|
||||
processTerm(groups, source, rules=[], root='') {
|
||||
for (const entry of this.dictionary.findTerm(root || source)) {
|
||||
if (entry.id in groups) {
|
||||
continue;
|
||||
}
|
||||
|
||||
groups[entry.id] = {
|
||||
expression: entry.expression,
|
||||
reading: entry.reading,
|
||||
|
Loading…
Reference in New Issue
Block a user