FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.06k stars 213 forks source link

[Feature Request] ignore parentheses #1195

Closed fedexman closed 3 years ago

fedexman commented 3 years ago

Hello, i had an idea while using netflix. Often a website or netflix subtitles use parentheses instead of furigana : e.g " なんかあったら 遠慮(えんりょ)なく言(い)いなさい " Having an option that ignore the parentheses so we can search 言いなさい will be useful because currently yomichan will block at 言 and willn't make the link with いんさい. Thank for developing this extension that I use every day ! I hope my explanation is understandable 😄

toasted-nutbread commented 3 years ago

I've run into this same issue before as well. I've added support for this with a new feature that supports generic pattern replacement using regular expressions in #1199.

Patterns can be configured under the Translation > Configure custom text replacement patterns… popup window on the v2 settings page (Advanced must be enabled). Pattern for your case: [(]([^)]*)[)]

Note that you may need to increase the value of the Text scan length setting to catch longer words, as the removal of characters will shorten the input.

fedexman commented 3 years ago

Ok thanks ! It seems very powerful even for another problems, i'll wait the next update to test it