carmen-ruby/carmen

Japanese subregion abreviations are ISO codes

jjb opened this issue · 10 comments

jjb commented

First of all, thank you for such a fantastic project, it's been of great value to me!

Looks like the abbreviations provided for Japanese subregions are ISO codes. Is this an issue of missing data, or are there not standard latin character abbreviations for Japanese subregions? (my initial research suggests this)

Thanks for this @jjb. I'll take a look at it later, I'm not immediately sure what the answer is but will get back to you.

jjb commented

A bit more research suggests there are no established latin alpha abbreviations for Japanese subregions. In my own app I'm going to do something like:

if subregion.code.to_i.to_s == subregion.code
  subregion.name
else
  subregion.code
end

So maybe it would be nice to be able to do subregion.numeric_code_only? If that sounds interesting I can put together a PR.

Hi @jjb, I know this is super old.

I don't quite understand what the problem is. Is your problem that the subregion codes for Japan are just numbers (represented as strings)?

jjb commented

yes

I understand. In cases where the code is a string representation of a number, you would like to use the full name of the subregion - and otherwise use the code as normal (the two character string)?

If so, your suggested PR would be great. I would, however, prefer a name of subregion.numeric_code?. What do you think?

jjb commented

sounds good. but first we should establish the answer to this:

Is this an issue of missing data, or are there not standard latin character abbreviations for Japanese subregions?

This isn't an issue of missing data. The ISO 3166-2 file we retrieve our data from has them as integers (search for "JP" within that JSON). The WIkipedia page for ISO 3166-2:JP corroborates this. There are quite a few other countries that don't have textual representations for their subregion codes (such as Czechia and Barbados).

jjb commented

Gotcha. I figured, just wanted to make sure :)

good to know about the other countries, that makes this feature more valuable. I'll work on it right now

jjb commented

@swcraig okay, PR is up! :)

Discussed and resolved in the associated PR.