Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert 畳 (and other Japanese units of measurement) #642

Closed
nicolasmaia opened this issue Jun 21, 2021 · 12 comments
Closed

Convert 畳 (and other Japanese units of measurement) #642

nicolasmaia opened this issue Jun 21, 2021 · 12 comments

Comments

@nicolasmaia
Copy link

A common measurement of size for apartments is 畳. I'm sometimes asked by my friends how big my place is in 畳. Or they'll say something is x 畳, and when I ask them to convert to squared meters, they have no idea how to do it.

One complicating factor is that 畳 has different sizes depending on the region: https://suumo.jp/yougo/a/ichijou/

Still, it could be interesting if Rikai was able to convert it to metric or imperial units, for each of the known 畳 sizes.

An overview of other units can be seen here: https://en.wikipedia.org/wiki/Japanese_units_of_measurement

@birtles
Copy link
Member

birtles commented Jun 22, 2021

That's a really neat idea. According to https://ja.wikipedia.org/wiki/%E7%95%B3#%E7%95%B3%E3%81%AE%E5%AF%B8%E6%B3%95%E3%81%AE%E5%AE%9F%E6%85%8B 帖 is defined to always mean 1.62 square metres whereas 畳 is at least 1.62 square metres for the purpose of real estate advertisements (the Suumo article says the same too it seems).

So doing 帖 should be straight forward. For 畳 however, ideally we would handle 四畳半 etc. too.

@SaltfishAmi
Copy link
Contributor

SaltfishAmi commented Jun 22, 2021

Non-metric measurement units are always a pain in the neck for me. I still remember last time I translated a work to Chinese and I needed to write a reference explaining 畳. Then I was confused about the region differences and at last I picked the estate advertisement version as a standard.

This is also true for imperial units tho... In China many measurement handbooks have both 'US gallon' and 'UK gallon' thing. And 'UK fluid gallon'... I never figured out why there are so many variations. But I guess UK uses metric units now?

Nevertheless, the actual figures of a 斤 also differ among China, Hong Kong and Taiwan. So as a Chinese I guess I should just shut up.

@Tomalak
Copy link

Tomalak commented Jun 22, 2021

But I guess UK uses metric units now?

You wish. :) Officially yes, practically no.

@birtles birtles closed this as completed in 7991227 Jul 2, 2021
@birtles
Copy link
Member

birtles commented Jul 2, 2021

I've landed an initial implementation of this in 7991227.

image

I've also made it convert from square metres back to 畳.

image

There are a few caveats though:

  • I haven't yet made it show the alternative conversions based on regional differences in tatami mat sizes. I'll give that a try in a moment.
  • A number of real estate sites use annotations like "洋6.7 洋5.2 LDK13.4", or "1K(洋室6.0・K2.0)" and it doesn't recognize those yet. I can try and add that but I'm afraid it might turn up too many false positives.
  • The initial issue here was to cover other Japanese units of measurement too. I've only handled 畳/帖 here. Probably most of the work in this issue can be re-used for other units so we should be able to pretty easily add the others. There are quite a lot though so I'd probably prefer to add them on an as-needed basis. What are units you commonly encounter that would be handy to have converted? Please comment here or file a separate issue for them.

@birtles
Copy link
Member

birtles commented Jul 2, 2021

  • I haven't yet made it show the alternative conversions based on regional differences in tatami mat sizes. I'll give that a try in a moment.

I had a go at doing this but I wonder if it's a bit too busy?

image

image

@nicolasmaia
Copy link
Author

  • I haven't yet made it show the alternative conversions based on regional differences in tatami mat sizes. I'll give that a try in a moment.

I had a go at doing this but I wonder if it's a bit too busy?

image

image

I don't think it looks too busy at all, thanks to the decreased font size. I like it a lot!

@Tomalak
Copy link

Tomalak commented Jul 2, 2021

I think it looks perfect.

@Tomalak
Copy link

Tomalak commented Jul 6, 2021

...although on second thought, it seems a little excessive to convert to m² with three digits of decimal precision.

Nobody knows what 0.001 m² even means, at least not in the context of room size. Rounding to 1 digit of precision is plenty.

@birtles
Copy link
Member

birtles commented Jul 7, 2021

...although on second thought, it seems a little excessive to convert to m² with three digits of decimal precision.

Nobody knows what 0.001 m² even means, at least not in the context of room size. Rounding to 1 digit of precision is plenty.

Good call. It currently uses 4 significant digits which is why sometimes you get a third fractional digit. I'm going to make it round to two digits of precision since it seems like the listings from SUUMO in those screenshots show two digits.

@nicolasmaia
Copy link
Author

So far, I've unfortunately not been able to enjoy this new feature on websites like this:
https://www.biccamera.com/bc/item/9314464

Due to the fact that 10ten doesn't parse half-width numerals :(

@birtles
Copy link
Member

birtles commented Jul 14, 2021

So far, I've unfortunately not been able to enjoy this new feature on websites like this:
https://www.biccamera.com/bc/item/9314464

Due to the fact that 10ten doesn't parse half-width numerals :(

Oh, sorry, that's not due to parsing half-width numerals, it's simply that I haven't released an updated version of the add-on with this feature yet.

I'm trying to gather together a bunch of major UI changes to release at once along with the name change in order to minimize disruption. Hopefully the next release will be ready next week.

For what it's worth, half-width numerals should work fine:

image

So should all the following:

  • 6畳
  • 六畳
  • 6畳
  • 六〇畳
  • 六十畳
  • 四畳半
  • 6 畳
  • 1.5 帖
  • 6m2
  • 6m2
  • 6㎡
  • 22.5平方メートル
  • 22.5平方メートル
  • 22.5平方㍍
  • 22.5平㍍
  • 22.5平米
  • 十二平方米

@birtles
Copy link
Member

birtles commented Jul 22, 2021

This feature is finally available in the latest release. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants