Skip to content

Add south_korea alias, korea tags for North Korea - #346

Open
Harshcombo50548 wants to merge 1 commit into
github:masterfrom
Harshcombo50548:south-korea-alias
Open

Add south_korea alias, korea tags for North Korea#346
Harshcombo50548 wants to merge 1 commit into
github:masterfrom
Harshcombo50548:south-korea-alias

Conversation

@Harshcombo50548

Copy link
Copy Markdown

Add south_korea alias, korea tags for North Korea

The 🇰🇷 flag has no alias containing either word of its name, so in practice it's reachable
only by typing kr exactly.

Current data:

🇰🇷  aliases: ["kr"]            tags: ["korea"]
🇰🇵  aliases: ["north_korea"]   tags: []

Emoji.find_by_alias("south_korea") returns nil, and alias-substring search misses it from
both directions:

Search Matches today 🇰🇷
south south_africa, south_sudan, south_georgia_south_sandwich_islands, french_southern_territories ❌ no alias contains "south"
korea north_korea ❌ "korea" is a tag, not an alias

South Korea does carry korea as a tag, so a tag-aware consumer can find it — but alias lookup
never sees tags, and pickers that do search tags rank those hits below alias matches, so 🇰🇵 wins
the "korea" query. 🇰🇵, meanwhile, has no tags at all, so it isn't findable by tag search either.

Change

🇰🇷  aliases: ["kr", "south_korea"]   tags: ["korea", "south"]
🇰🇵  aliases: ["north_korea"]         tags: ["korea", "north"]

Appending the full country name after a short canonical alias follows the existing
eu/european_union shape. North Korea gets korea/north tags to close the same gap from
the tag side, without touching its aliases.

After the change, an alias search for south returns 5 flags including South Korea, and
korea returns both Koreas.

Notes

  • Existing aliases stay in first position. Character#name is aliases.first, so
    find_by_unicode("🇰🇷").name still returns "kr" and :kr: / :north_korea: are
    unaffected. Nothing is renamed or removed, and North Korea's alias list is untouched.
  • No collisions. south_korea was unused across all 1870 entries, so the "emojis have
    valid names" duplicate assertion still holds. (For anyone considering the same treatment for
    the other ISO-2 flags: japan is already taken by 🗾 and turkey by 🦃.)
  • Survives regeneration. db/dump.rb copies existing_emoji.aliases and
    existing_emoji.tags verbatim, so rake db:dump won't clobber these. Both flag sequences
    match on the first find_by_unicode lookup and appear exactly once in
    vendor/unicode-emoji-test.txt, so the seen_existing de-dup path can't regenerate a fresh
    alias for them.
  • The diff is 4 added lines in db/emoji.json, hand-edited to match the file's generated
    leading-comma formatting.

`Emoji.find_by_alias("south_korea")` returned nil, so the South Korea flag
had no alias containing either word of its name: searching "south" matched
south_africa, south_sudan and south_georgia_south_sandwich_islands, while
"korea" matched the north_korea alias. South Korea carried "korea" as a
tag, but alias lookup never sees tags and pickers that do search them rank
tag hits below alias hits, so the flag was effectively reachable only by
typing `kr`.

Added `south_korea` as a second alias, following the existing
eu/european_union shape of a short canonical name plus the full country
name. North Korea had no tags at all, so it was not findable by tag search
either; added korea/north there to close the same gap from the other side.

The existing aliases stay in first position, so `Character#name` still
returns "kr" and "north_korea" and the `:kr:` / `:north_korea:` references
are unchanged. `db/dump.rb` copies existing aliases and tags verbatim when
rebuilding from the Unicode data, so these additions survive regeneration.

Co-Authored-By: X-DAEM0N <307583041+X-DAEM0N@users.noreply.github.com>
@Harshcombo50548

Copy link
Copy Markdown
Author

@mislav This repo Pull requests seem stale? Is it still being maintained?

Side Note: The south_korea alias is the only thing that actually matters here.

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

Successfully merging this pull request may close these issues.

1 participant