birchill / 10ten-ja-reader

A browser extension to translate Japanese by hovering over words.
https://addons.mozilla.org/firefox/addon/10ten-ja-reader/
GNU General Public License v3.0
604 stars 45 forks source link

Additional yen conversion parsing #2000

Closed 0xNF closed 1 month ago

0xNF commented 1 month ago

In multilingual discussions on the internet, I often encounter yen-denominated sums written with k, m, or t metric suffixes, for example, 40k円, which doesn't parse in 10ten.

What do the maintainers think of allowing these suffixes to be parsed?

birtles commented 1 month ago

Absolutely. We already parse some pretty non-standard numbers and I'm more than happy to add more if they occur in the wild.

Do you happen to have any URLs with examples of these variants?

0xNF commented 1 month ago

It's most prevalent on reddit:

But you'll sometimes see it on explainer sites in Japanese:

To say nothing of the discord chats it sometimes comes up in. It's mostly an English-Japanese speaker thing.

birtles commented 1 month ago

Thank you! So basically 洋製日本語. Nice.

birtles commented 1 month ago

In multilingual discussions on the internet, I often encounter yen-denominated sums written with k, m, or t metric suffixes, for example, 40k円, which doesn't parse in 10ten.

@0xNF What is the t suffix used for?

SaltfishAmi commented 1 month ago

What is the t suffix used for?

兆円, I guess??

0xNF commented 1 month ago

Trillion yen, often seen in discussions of government fiscal budgets.

birtles commented 1 month ago

Thanks! So I guess "b" should be a suffix too?

0xNF commented 1 month ago

Yeah, I didn't expand in detail in my original comment which is my bad.

(m)illion yen (b)illion yen (t)rillion yen

Is what I had in mind. In theory (q)uadrillon lurks out there on the net somewhere too but I've never personally seen it.

birtles commented 1 month ago

I've done a basic implementation of this over in #2049 but looking at the dentist thread from an earlier comment I guess it would be more useful if this recognized "5k yen" too?

I'm not sure if it's ever going to recognize the "40k" in "40k to 200k円", however, since that would require parsing quite a bit more of the context to make that work.

birtles commented 1 month ago

Updated #2049 to cover "5k yen" too.

0xNF commented 4 days ago

image This is fantastic, thanks so much.

birtles commented 4 days ago

This is fantastic, thanks so much.

Thank you!