Skip to content

Commit

Permalink
Stop loading CLDR label file
Browse files Browse the repository at this point in the history
This file is now two years old and all emojis inside of it is already
present in the emoji-test.txt file, which seems to be much more
up-to-date when it comes to categorizing the emojis.

Removing the old file made the categories much more uniform.
  • Loading branch information
Mange committed Jun 15, 2019
1 parent 45ea982 commit ee615c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 100 deletions.
14 changes: 2 additions & 12 deletions compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# frozen_string_literal: true

require "json"
require_relative "lib/character_spec"
require_relative "lib/emoji"
require_relative "lib/label_file"
require_relative "lib/annotation_file"
require_relative "lib/emoji_test_file"

Expand Down Expand Up @@ -52,21 +50,13 @@ def format_emojis(emojis)
end

# Build emoji table
$stderr.print "Loading CLDR label file…"
labels_file = "cldr/common/properties/labels.txt"
emojis = LabelFile.new(labels_file).read_emojis
warn " Done!"
emojis = {}

$stderr.print "Loading CLDR emoji-test file…"
EmojiTestFile.new(
"cldr/tools/java/org/unicode/cldr/util/data/emoji/emoji-test.txt",
).each_emoji do |emoji|
existing = emojis[emoji.characters]
if existing
existing.merge!(emoji)
else
emojis[emoji.characters] = emoji
end
emojis[emoji.characters] = emoji
end
warn " Done!"

Expand Down
39 changes: 0 additions & 39 deletions lib/character_spec.rb

This file was deleted.

49 changes: 0 additions & 49 deletions lib/label_file.rb

This file was deleted.

0 comments on commit ee615c0

Please sign in to comment.