Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2697521
emoji.lisp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
emoji.lisp
View Options
;;; -*- mode: Lisp; -*-
;; This file is part of kazv.
;; SPDX-FileCopyrightText: 2024 April Simone <apr3vau@outlook.com>
;; SPDX-License-Identifier: AGPL-3.0-or-later
;; Usage:
;; 1. Install a Common Lisp implementation (i.e. SBCL)
;; 2. Install Quicklisp (https://www.quicklisp.org/beta/)
;; 3. Load this script (for example, $ sbcl --load emoji.lisp)
;; 4. Copy the "./emoji" folder to kazv/src/contents/ui/
(
in-package
:cl-user
)
(
ql:quickload
:dexador
)
(
ql:quickload
:split-sequence
)
(
ql:quickload
:cl-ppcre
)
(
defparameter
*txt*
(
dex:get
"https://unicode.org/Public/emoji/13.0/emoji-test.txt"
))
(
defparameter
*lines*
(
split-sequence:split-sequence
#\Newline
*txt*
))
(
defparameter
*table*
(
make-hash-table
:test
'equal
))
(
loop
with
group
=
""
for
l
in
*lines*
if
(
search
"# group: "
l
)
do
(
setq
group
(
subseq
l
9
))
else
if
(
and
(
>
(
length
l
)
0
)
(
not
(
eq
(
aref
l
0
)
#\#
))
(
search
"fully-qualified"
l
))
do
(
push
(
mapcar
(
lambda
(
str
)
(
parse-integer
str
:radix
16
))
(
split-sequence:split-sequence
#\Space
(
string-trim
'
(
#\Space
)
(
car
(
split-sequence:split-sequence
#\;
l
)))))
(
gethash
group
*table*
)))
(
ensure-directories-exist
(
merge-pathnames
"emoji/"
(
uiop:getcwd
)))
(
loop
for
key
being
each
hash-key
of
*table*
do
(
with-open-file
(
out
(
merge-pathnames
(
format
nil
"emoji/~A.qml"
(
ppcre:regex-replace
"&"
(
delete
#\Space
(
string-capitalize
key
))
"And"
))
(
uiop:getcwd
))
:direction
:output
:if-exists
:supersede
:if-does-not-exist
:create
)
(
format
out
"/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2024 The Kazv Project
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This file is auto generated by emoji.lisp
*/
import QtQml.Models
ListModel {~%"
)
(
loop
for
i
in
(
reverse
(
gethash
key
*table*
))
do
(
format
out
" ListElement { str: '~A' }~%"
(
make-array
(
length
i
)
:element-type
'character
:initial-contents
(
mapcar
'code-char
i
))))
(
format
out
"}~%"
)))
(
quit
)
File Metadata
Details
Attached
Mime Type
text/x-lisp
Expires
Fri, Jul 18, 6:48 AM (5 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
258123
Default Alt Text
emoji.lisp (2 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment