themoeway / yomitan

Pop-up dictionary browser extension. Successor to Yomichan.
https://yomitan.wiki
GNU General Public License v3.0
1.15k stars 89 forks source link

Sentence for the vocab added in Anki can have extra unwanted data #882

Open pinntokuru opened 4 months ago

pinntokuru commented 4 months ago

When I mine vocab from text in some websites such as Twitter the {{sentence}} field is filled with not just the sentence but other data that's not part of the sentence.

For example, when mining "発売" from this tweet

image

my sentence field looks like this:

image

This is with Yomitan default settings.

Is it possible to have the user highlight the sentence they want added before mining? This would also allow the user to add multiple sentences before and after the vocab sentence for added context, if nesessary. Here's an example of what I mean:

https://github.com/themoeway/yomitan/assets/167678490/91afca7c-6580-4962-969f-2bb1bf2cb5b0

Extension version: Yomitan 24.4.16.0 Platform: Windows Browser: Firefox Language: en-CA User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0 AnkiConnect version: 6 Installed dictionaries: JPDB, デジタル大辞泉, 三省堂国語辞典 第八版, 大辞林 第四版, 新明解国語辞典 第八版, JMdict, VNDB Names

jamesmaa commented 4 months ago

Does the {selection-text} work for your purposes?

jamesmaa commented 4 months ago

This feels more like a bug than an enhancement. Looking at the tweet it should be highlighting the entire sentence without the urls

<span class="css-1qaijid r-bcqeeo r-qvutc0 r-poiln3" style="text-overflow: unset;">放課後ていぼう日誌12巻 5月20日発売です!よろしくお願いします! </span>