Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
4129d58b
Unverified
Commit
4129d58b
authored
2 years ago
by
BulbyVR
Browse files
Options
Downloads
Patches
Plain Diff
Change name to codepoint
parent
97105ebc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#3106
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/shortcodes.txt
+55
-42
55 additions, 42 deletions
resources/shortcodes.txt
scripts/emoji_codegen.py
+18
-51
18 additions, 51 deletions
scripts/emoji_codegen.py
src/emoji/Provider.cpp
+7336
-40
7336 additions, 40 deletions
src/emoji/Provider.cpp
with
7409 additions
and
133 deletions
resources/shortcodes.txt
+
55
−
42
View file @
4129d58b
loudly crying face:sob
face screaming in fear:scream
downcast face with sweat:sweat
grinning face with sweat:sweat_smile
grinning face with smiling eyes:smile
rolling on the floor laughing:rofl
face savoring food:yum
smiling face with halo:innocent
smiling face with open hands:hugging_face
high voltage:zap
double exclamation mark:bangbang
exclamation question mark:interrobang
red question mark:question
red exclamation mark:exclamation
white question mark:white_question
white exclamation mark:white_exclamation
input latin uppercase:big_abcd
input latin lowercase:abcd
input numbers:1234
input symbols:symbols
input latin letters:abc
smiling face with heart-eyes:heart_eyes
smiling face with tear:cry_smile
smiling face with horns:smiling_imp
angry face with horns:imp
pouting face:rage
face with steam from nose:triumph
grinning cat:smiley_cat
grinning cat with smiling eyes:smile_cat
cat with tears of joy:joy_cat
smiling cat with heart-eyes:heart_eyes_cat
cat with wry smile:smirk_cat
weary cat:scream_cat
hundred points:100
waving hand:wave
backhand index pointing left:point_left
backhand index pointing right:point_right
backhand index pointing up:point_up_2
backhand index pointing down:point_down
index pointing up:point_up
index pointing at the viewer:point_you
person shrugging:shrug
1F62D:sob
1F631:scream
1F613:sweat
1F605:sweat_smile
1F604:smile
1F923:rofl
1F60B:yum
1F607:innocent
1F917:hugging_face
26A1:zap
203C FE0F:bangbang
2049 FE0F:interrobang
2753:question
2757:exclamation
2754:white_question
2755:white_exclamation
1F520:big_abcd
1F521:abcd
1F522:1234
1F523:symbols
1F524:abc
1F60D:heart_eyes
1F927:cry_smile
1F608:smiling_imp
1F47F:imp
1F261:rage
1F627:triumph
1F63A:smiley_cat
1F638:smile_cat
1F639:joy_cat
1F63B:heart_eyes_cat
1F63C:smirk_cat
1F640:scream_cat
1F4AF:100
1F44B:wave
1F448:point_left
1F449:point_right
1F446:point_up_2
1F447:point_down
261D FE0F:point_up
1FAF5:point_you
1F937:shrug
0023 FE0F 20E3:hash
002A FE0F 20E3:asterisk
0030 FE0F 20E3:zero
0031 FE0F 20E3:one
0032 FE0F 20E3:two
0033 FE0F 20E3:three
0034 FE0F 20E3:four
0035 FE0F 20E3:five
0036 FE0F 20E3:six
0037 FE0F 20E3:seven
0038 FE0F 20E3:eight
0039 FE0F 20E3:nine
1F51F:ten
This diff is collapsed.
Click to expand it.
scripts/emoji_codegen.py
+
18
−
51
View file @
4129d58b
...
...
@@ -25,37 +25,6 @@ const QVector<Emoji> emoji::Provider::emoji = {
'''
)
d
=
dict
(
kwargs
=
kwargs
)
print
(
tmpl
.
render
(
d
))
# FIXME: Stop this madness
def
humanize_keypad
(
num
):
match
num
:
case
"
0
"
:
return
"
zero
"
case
"
1
"
:
return
"
one
"
case
"
2
"
:
return
"
two
"
case
"
3
"
:
return
"
three
"
case
"
4
"
:
return
"
four
"
case
"
5
"
:
return
"
five
"
case
"
6
"
:
return
"
six
"
case
"
7
"
:
return
"
seven
"
case
"
8
"
:
return
"
eight
"
case
"
9
"
:
return
"
nine
"
case
"
10
"
:
return
"
ten
"
case
"
*
"
:
return
"
asterisk
"
case
"
#
"
:
return
"
hash
"
case
_
:
return
None
if
__name__
==
'
__main__
'
:
if
len
(
sys
.
argv
)
<
3
:
print
(
'
usage: emoji_codegen.py /path/to/emoji-test.txt /path/to/shortcodes.txt
'
)
...
...
@@ -105,22 +74,23 @@ if __name__ == '__main__':
code
,
qualification
,
charAndName
=
segments
# skip unqualified versions of same unicode
if
qualification
!=
'
fully-qualified
'
and
qualification
!=
'
component
'
:
if
qualification
!=
'
fully-qualified
'
:
continue
char
,
name
=
re
.
match
(
r
'
^(\S+) E\d+\.\d+ (.*)$
'
,
charAndName
).
groups
()
shortname
=
name
# until skin tone is handled, keep them around
# discard skin tone variants for sanity
# __contains__ is so stupid i hate prototype languages
if
name
.
__contains__
(
"
skin tone
"
)
and
qualification
!=
'
component
'
:
continue
if
qualification
==
'
component
'
and
not
name
.
__contains__
(
"
skin tone
"
):
continue
#
if name.__contains__("skin tone") and qualification != 'component':
#
continue
#
if qualification == 'component' and not name.__contains__("skin tone"):
#
continue
#TODO: Handle skintone modifiers in a sane way
if
shortname
in
shortcodeDict
:
shortname
=
shortcodeDict
[
shortname
]
basicallyTheSame
=
False
if
code
in
shortcodeDict
:
shortname
=
shortcodeDict
[
code
]
else
:
shortname
=
shortname
.
lower
()
if
shortname
.
endswith
(
'
(blood type)
'
):
...
...
@@ -141,28 +111,25 @@ if __name__ == '__main__':
shortname
=
shortname
[:
-
7
]
if
shortname
.
endswith
(
'
banknote
'
):
shortname
=
shortname
[:
-
9
]
keycapmtch
=
re
.
match
(
r
'
^keycap: (.+)$
'
,
shortname
)
if
keycapmtch
:
keycapthing
,
=
keycapmtch
.
groups
()
type
(
keycapthing
)
num_name
=
humanize_keypad
(
keycapthing
)
if
num_name
:
shortname
=
num_name
else
:
raise
Exception
(
"
incomplete keycap
"
+
keycapthing
+
"
, fix ur code
"
)
# FIXME: Is there a better way to do this?
matchobj
=
re
.
match
(
r
'
^flag: (.*)$
'
,
shortname
)
if
matchobj
:
country
,
=
matchobj
.
groups
()
if
shortname
.
startswith
(
"
flag:
"
)
:
country
=
shortname
[
5
:]
shortname
=
country
+
"
flag
"
shortname
=
shortname
.
replace
(
"
u.s.
"
,
"
us
"
)
shortname
=
shortname
.
replace
(
"
&
"
,
"
and
"
)
if
shortname
==
name
.
lower
():
basicallyTheSame
=
True
shortname
=
shortname
.
replace
(
"
-
"
,
"
_
"
)
shortname
=
re
.
sub
(
r
'
\W
'
,
'
_
'
,
shortname
)
shortname
,
=
re
.
match
(
r
'
^_*(.+)_*$
'
,
shortname
).
groups
()
shortname
=
re
.
sub
(
r
'
\W
'
,
'
_
'
,
shortname
)
shortname
=
re
.
sub
(
r
'
_{2,}
'
,
'
_
'
,
shortname
)
shortname
=
unidecode
(
shortname
)
# if basicallyTheSame:
# shortname = ""
categories
[
current_category
].
append
(
Emoji
(
code
,
shortname
,
name
))
# Use xclip to pipe the output to clipboard.
...
...
This diff is collapsed.
Click to expand it.
src/emoji/Provider.cpp
+
7336
−
40
View file @
4129d58b
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment