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 = {
|
const res = {
|
||||||
rules: 'jp/data/rules.json',
|
rules: 'jp/data/rules.json',
|
||||||
@ -44,8 +51,5 @@ function onMessage(request, sender, callback) {
|
|||||||
kanjidic: 'jp/data/kanjidic.json'
|
kanjidic: 'jp/data/kanjidic.json'
|
||||||
};
|
};
|
||||||
|
|
||||||
window.trans = new Translator(
|
window.trans = new Translator(res, onInit);
|
||||||
res,
|
|
||||||
() => chrome.runtime.onMessage.addListener(onMessage)
|
|
||||||
);
|
|
||||||
})();
|
})();
|
||||||
|
@ -98,6 +98,10 @@ class Translator {
|
|||||||
|
|
||||||
processTerm(groups, source, rules=[], root='') {
|
processTerm(groups, source, rules=[], root='') {
|
||||||
for (const entry of this.dictionary.findTerm(root || source)) {
|
for (const entry of this.dictionary.findTerm(root || source)) {
|
||||||
|
if (entry.id in groups) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
groups[entry.id] = {
|
groups[entry.id] = {
|
||||||
expression: entry.expression,
|
expression: entry.expression,
|
||||||
reading: entry.reading,
|
reading: entry.reading,
|
||||||
|
Loading…
Reference in New Issue
Block a user