emojifics 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BobbyChew
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ include LICENSE
2
+ include README.md
3
+ include schema.md
4
+ include pyproject.toml
5
+ recursive-include data *.md
6
+ recursive-include data *.csv
7
+ recursive-include tests *.py
8
+ include assets/set/README.md
9
+ include assets/set/.gitkeep
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: emojifics
3
+ Version: 0.3.0
4
+ Summary: Context-to-sign pictures: emoji-sized Unicode words from tags or short text.
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/BobbyChew/emojifics
7
+ Project-URL: Repository, https://github.com/BobbyChew/emojifics
8
+ Project-URL: Issues, https://github.com/BobbyChew/emojifics/issues
9
+ Keywords: emoji,unicode,pictograms,lexicon,signs
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Topic :: Text Processing :: Linguistic
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Dynamic: license-file
19
+
20
+ # emojifics
21
+
22
+ emojifics turns tags or a short text into an emoji-sized Unicode word. A word is depicting signs, then an optional classifier. Length follows the source. The pictures are Unicode, so a skin (the system font, or a CDN font at display) draws them. This repository does not ship emoji artwork.
23
+
24
+ See `data/grammar.md` for the word and `data/covering.md` for primaries, aliases, and cues.
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ pip install emojifics
30
+ ```
31
+
32
+ From a checkout:
33
+
34
+ ```bash
35
+ pip install -e .
36
+ python -m tests.test_examples
37
+ ```
38
+
39
+ ## Use
40
+
41
+ ```python
42
+ from emojifics import compose, compose_text, find, lookup
43
+
44
+ compose(["shark", "water", "swimmer", "boat", "blood"])
45
+ # 🦈🌊🏊🚤🩸
46
+
47
+ compose(["shark", "water", "swimmer", "boat", "blood"], classifier="movies")
48
+ # 🦈🌊🏊🚤🩸🎥
49
+
50
+ compose_text("a shark in the water, a swimmer, a boat, blood")
51
+ # 🦈🌊🏊🚤🩸
52
+
53
+ lookup("healthcare")
54
+ # None — a cue is not a sign key
55
+
56
+ find("healthcare")[0]
57
+ # cue healthcare hospital 🏥
58
+
59
+ find("🌊")[0].name
60
+ # wave
61
+ ```
62
+
63
+ ```bash
64
+ python -m emojifics compose shark water swimmer boat blood
65
+ python -m emojifics compose --text "a shark in the water, a swimmer, a boat, blood"
66
+ python -m emojifics find healthcare
67
+ python -m emojifics find 🌊
68
+ python -m emojifics lookup wave
69
+ ```
70
+
71
+ `find` prints one hit per line: `kind`, `name`, `key`, picture. It matches primaries, aliases, classifiers, cues, whole words in notes, and emoji. A compound such as `spiderman` reaches the sign it starts with. `lookup` stays an exact sign key.
72
+
73
+ ## Layout
74
+
75
+ - `emojifics/recipes.json` — signs, cues, classifiers
76
+ - `data/grammar.md` — word shape
77
+ - `data/covering.md` — how English reaches a picture
78
+ - `data/examples.csv` — tagged words
79
+ - `data/review_posts.csv` — short covering lines
80
+ - `data/cover_slices.csv` — covering slices and traps
81
+ - `schema.md` — glyphic fields
82
+
83
+ MIT license. Code and recipes are in git. Emoji binaries are not.
@@ -0,0 +1,64 @@
1
+ # emojifics
2
+
3
+ emojifics turns tags or a short text into an emoji-sized Unicode word. A word is depicting signs, then an optional classifier. Length follows the source. The pictures are Unicode, so a skin (the system font, or a CDN font at display) draws them. This repository does not ship emoji artwork.
4
+
5
+ See `data/grammar.md` for the word and `data/covering.md` for primaries, aliases, and cues.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install emojifics
11
+ ```
12
+
13
+ From a checkout:
14
+
15
+ ```bash
16
+ pip install -e .
17
+ python -m tests.test_examples
18
+ ```
19
+
20
+ ## Use
21
+
22
+ ```python
23
+ from emojifics import compose, compose_text, find, lookup
24
+
25
+ compose(["shark", "water", "swimmer", "boat", "blood"])
26
+ # 🦈🌊🏊🚤🩸
27
+
28
+ compose(["shark", "water", "swimmer", "boat", "blood"], classifier="movies")
29
+ # 🦈🌊🏊🚤🩸🎥
30
+
31
+ compose_text("a shark in the water, a swimmer, a boat, blood")
32
+ # 🦈🌊🏊🚤🩸
33
+
34
+ lookup("healthcare")
35
+ # None — a cue is not a sign key
36
+
37
+ find("healthcare")[0]
38
+ # cue healthcare hospital 🏥
39
+
40
+ find("🌊")[0].name
41
+ # wave
42
+ ```
43
+
44
+ ```bash
45
+ python -m emojifics compose shark water swimmer boat blood
46
+ python -m emojifics compose --text "a shark in the water, a swimmer, a boat, blood"
47
+ python -m emojifics find healthcare
48
+ python -m emojifics find 🌊
49
+ python -m emojifics lookup wave
50
+ ```
51
+
52
+ `find` prints one hit per line: `kind`, `name`, `key`, picture. It matches primaries, aliases, classifiers, cues, whole words in notes, and emoji. A compound such as `spiderman` reaches the sign it starts with. `lookup` stays an exact sign key.
53
+
54
+ ## Layout
55
+
56
+ - `emojifics/recipes.json` — signs, cues, classifiers
57
+ - `data/grammar.md` — word shape
58
+ - `data/covering.md` — how English reaches a picture
59
+ - `data/examples.csv` — tagged words
60
+ - `data/review_posts.csv` — short covering lines
61
+ - `data/cover_slices.csv` — covering slices and traps
62
+ - `schema.md` — glyphic fields
63
+
64
+ MIT license. Code and recipes are in git. Emoji binaries are not.
File without changes
@@ -0,0 +1,5 @@
1
+ # assets/set
2
+
3
+ Local pack. Built by `python -m emojifics install`. Binaries stay on local disk and are gitignored.
4
+
5
+ Install writes `pack-manifest.json`, Unicode chrome, and `signs.json`. It does not warehouse emoji PNG or SVG files. A display skin (system font, Noto, Twemoji) draws the same codepoints at preview time when a caller asks for that skin. Shown pictures are emoji-sized Unicode.
@@ -0,0 +1,5 @@
1
+ """Backward-compatible composer package. Prefer `python -m emojifics`."""
2
+
3
+ from emojifics.compose import compose
4
+
5
+ __all__ = ["compose"]
@@ -0,0 +1,9 @@
1
+ """Shim: python -m composer.compose still works."""
2
+
3
+ from emojifics.compose import compose, print_examples
4
+
5
+ __all__ = ["compose"]
6
+
7
+
8
+ if __name__ == "__main__":
9
+ print_examples()
@@ -0,0 +1,9 @@
1
+ """Shim: python -m composer.install (same as python -m emojifics install)."""
2
+
3
+ from emojifics.install import install, main
4
+
5
+ __all__ = ["install", "main"]
6
+
7
+
8
+ if __name__ == "__main__":
9
+ raise SystemExit(main())
@@ -0,0 +1,199 @@
1
+ group,title,text,cover,eg_word,notes
2
+ weather,rainfall,the rainfall,rain,🌧️,liked slice
3
+ weather,downpour,a sudden downpour,rain,🌧️,liked slice
4
+ weather,drizzle,the drizzle,rain,🌧️,liked slice
5
+ weather,blizzard,a blizzard hit,snow,❄️,liked slice
6
+ weather,snowfall,snowfall overnight,snow,❄️,liked slice
7
+ weather,snowflake,one snowflake,snow,❄️,liked slice
8
+ weather,whiteout,a highway whiteout,snow,❄️,liked slice
9
+ weather,twister,a twister touched down,tornado,🌪️,liked slice
10
+ weather,whirlwind,a whirlwind,tornado,🌪️,liked slice
11
+ weather,funnel cloud,a funnel cloud,tornado,🌪️,compound lock vs cloud
12
+ weather,gale,a gale overnight,wind,💨,liked slice
13
+ weather,gale force,gale-force conditions,wind,💨,liked slice
14
+ weather,thunderstorm,a thunderstorm,lightning,⚡,liked slice
15
+ weather,thunderstorms,the thunderstorms,lightning,⚡,liked slice
16
+ weather,thunderbolt,a thunderbolt,lightning,⚡,liked slice
17
+ weather,cloudburst,a cloudburst,rain,🌧️,qwen had tried heart
18
+ weather,hailstone,hailstone,snow,❄️,qwen had tried heart
19
+ transport,aeroplane,the aeroplane,airplane,✈️,liked slice
20
+ transport,flight delayed,flight delayed,skull|airplane,💀✈️,dark humor: skull then plane
21
+ transport,flight delay,flight delay,skull|airplane,💀✈️,dark humor: skull then plane
22
+ transport,jet engine,a jet engine,airplane,✈️,not jet ski
23
+ transport,airliner,the airliner,airplane,✈️,liked slice
24
+ transport,railway,the railway,train,🚆,liked slice
25
+ transport,rail yard,a rail yard,train,🚆,liked slice
26
+ transport,city shuttle,city passenger shuttle,bus,🚌,liked slice
27
+ transport,school bus,the school bus,bus,🚌,compound lock vs school
28
+ transport,freight hauler,large freight hauler,truck,🚛,liked slice
29
+ transport,articulated lorry,articulated lorry,truck,🚛,liked slice
30
+ transport,lorry,a lorry,truck,🚛,liked slice
31
+ transport,automobile,an automobile,car,🚗,liked slice
32
+ transport,motorist,a motorist,car,🚗,liked slice
33
+ transport,ferry dock,ferry dock,ship,🚢,liked slice
34
+ transport,ferry,the ferry,ship,🚢,liked slice
35
+ food,sourdough,the sourdough,bread,🍞,liked slice
36
+ food,baguette,a baguette,bread,🍞,liked slice
37
+ food,ale,an ale,beer,🍺,liked slice
38
+ food,stein,a stein,beer,🍺,liked slice
39
+ food,oktoberfest,oktoberfest,beer,🍺,liked slice
40
+ food,cafe,the cafe,coffee,☕,liked slice
41
+ food,morning brew,morning brew,coffee,☕,news paraphrase
42
+ food,caffeine,caffeine,coffee,☕,liked slice
43
+ food,pepperoni,pepperoni,pizza,🍕,liked slice
44
+ food,shortcake,shortcake,cake,🍰,liked slice
45
+ food,chai,a cup of chai,tea,🍵,lock vs coffee
46
+ food,toast to,a toast to the couple,wine,🍷,salute not bread
47
+ people,lady,the lady,woman,👩,liked slice
48
+ people,infant,an infant,baby,👶,liked slice
49
+ people,newborn,a newborn,baby,👶,liked slice
50
+ people,pregnant,she is pregnant,woman|baby,👩👶,short word
51
+ people,kid,the kid,child,🧒,liked slice
52
+ people,toddler,a toddler,child,🧒,liked slice
53
+ people,grandchild,a grandchild,child,🧒,liked slice
54
+ people,lips,her lips,mouth,👄,liked slice
55
+ people,lipstick,lipstick,mouth,👄,makeup lock
56
+ animals,kitty,a kitty,cat,🐱,liked slice
57
+ animals,best friend,man's best friend,dog,🐕,apostrophe cue
58
+ animals,equine,equine,horse,🐴,liked slice
59
+ animals,dressage,dressage,horse,🐴,liked slice
60
+ animals,pork,pork,pig,🐷,meat lock vs steak
61
+ animals,bumblebee,a bumblebee,bee,🐝,liked slice
62
+ animals,honeybee,a honeybee,bee,🐝,liked slice
63
+ animals,mane,a mane,lion,🦁,liked slice
64
+ animals,moo,a moo,cow,🐮,liked slice
65
+ animals,tortoise,a tortoise,turtle,🐢,liked slice
66
+ animals,terrapin,a terrapin,turtle,🐢,liked slice
67
+ sky,sunny,sunny,sun,☀️,liked slice
68
+ sky,sunshine,the sunshine,sun,☀️,liked slice
69
+ sky,crescent,a crescent,moon,🌙,liked slice
70
+ sky,ramadan,ramadan,moon,🌙,liked slice
71
+ sky,deciduous,deciduous,tree,🌳,liked slice
72
+ sky,astronomy,astronomy,star,⭐,liked slice
73
+ buildings,camping,camping,tent,⛺,liked slice
74
+ buildings,chapel,a chapel,church,⛪,liked slice
75
+ buildings,suburban,suburban,house,🏠,liked slice
76
+ buildings,suburbia,suburbia,house,🏠,liked slice
77
+ buildings,busy streets,busy streets,city,🏙️,liked slice
78
+ buildings,steeple,steeple spire,church,⛪,liked slice
79
+ objects,archer,an archer,bow,🏹,liked slice
80
+ objects,hatchet,a hatchet,axe,🪓,liked slice
81
+ objects,library,the library,book,📖,liked slice
82
+ objects,hocho,a hocho,knife,🔪,liked slice
83
+ leftover,snowy peak,snowy peak,mountain,⛰️,liked slice
84
+ leftover,sandstorm,a sandstorm,desert,🏜️,liked slice
85
+ leftover,dune,a dune,desert,🏜️,liked slice
86
+ leftover,moonlit,moonlit,night,🌃,liked slice
87
+ leftover,musical note,a musical note,music,🎵,liked slice
88
+ leftover,musical,a musical,music,🎵,liked slice
89
+ leftover,grizzly,a grizzly,bear,🐻,liked slice
90
+ leftover,antarctica,antarctica,penguin,🐧,liked slice
91
+ leftover,eruption,an eruption,volcano,🌋,liked slice
92
+ leftover,sailing,sailing,sailboat,⛵,liked slice
93
+ leftover,yacht,a yacht,sailboat,⛵,not ocean liner
94
+ leftover,resort,the resort,hotel,🏨,not sailboat
95
+ leftover,campus,the campus,school,🏫,liked slice
96
+ leftover,classroom,a classroom,school,🏫,not school bus
97
+ leftover,skyscraper,the skyscraper,tower,🗼,liked slice
98
+ leftover,dusk,dusk,sunset,🌇,liked slice
99
+ leftover,misty morning,a misty morning,fog,🌫️,not sunrise
100
+ leftover,thick mist,thick mist,fog,🌫️,liked slice
101
+ leftover,cab,a cab,taxi,🚕,liked slice
102
+ leftover,copter,a copter,helicopter,🚁,liked slice
103
+ leftover,cycling,cycling,bicycle,🚲,liked slice
104
+ leftover,subway,the subway,metro,🚇,liked slice
105
+ leftover,motorbike,a motorbike,motorcycle,🏍️,liked slice
106
+ leftover,masjid,a masjid,mosque,🕌,liked slice
107
+ leftover,call to prayer,call to prayer,mosque,🕌,liked slice
108
+ leftover,minaret,a minaret,mosque,🕌,not tower
109
+ leftover,martini,a martini,cocktail,🍸,liked slice
110
+ leftover,scotch,scotch,whiskey,🥃,liked slice
111
+ leftover,whisky,whisky,whiskey,🥃,spelling
112
+ leftover,sparkling wine,sparkling wine,champagne,🍾,not wine glass
113
+ leftover,cheddar,cheddar,cheese,🧀,liked slice
114
+ leftover,nigiri,nigiri,sushi,🍣,liked slice
115
+ leftover,pine,pine,evergreen,🌲,not deciduous tree
116
+ leftover,toadstool,a toadstool,mushroom,🍄,liked slice
117
+ leftover,four-leaf,four-leaf,clover,🍀,liked slice
118
+ leftover,four leaf,four leaf,clover,🍀,unhyphenated
119
+ leftover,fire truck,a fire truck,fire_engine,🚒,not articulated truck
120
+ leftover,hot dog,a hot dog,hotdog,🌭,not hot plus dog
121
+ leftover,hamburger,a hamburger,burger,🍔,liked slice
122
+ leftover,frankfurter,a frankfurter,hotdog,🌭,liked slice
123
+ leftover,pho,pho,ramen,🍜,liked slice
124
+ leftover,gyoza,gyoza,dumpling,🥟,liked slice
125
+ leftover,jiaozi,jiaozi,dumpling,🥟,liked slice
126
+ leftover,pierogi,pierogi,dumpling,🥟,liked slice
127
+ leftover,potsticker,a potsticker,dumpling,🥟,liked slice
128
+ leftover,empanada,an empanada,dumpling,🥟,liked slice
129
+ leftover,t-rex,a t-rex,trex,🦖,liked slice
130
+ leftover,sauropod,a sauropod,dinosaur,🦕,liked slice
131
+ leftover,brontosaurus,a brontosaurus,dinosaur,🦕,liked slice
132
+ leftover,sorcerer,a sorcerer,mage,🧙,liked slice
133
+ leftover,pixie,a pixie,fairy,🧚,liked slice
134
+ leftover,dracula,dracula,vampire,🧛,liked slice
135
+ leftover,cowgirl,a cowgirl,cowboy,🤠,liked slice
136
+ leftover,jack-o-lantern,jack-o-lantern,pumpkin,🎃,liked slice
137
+ leftover,futbol,futbol,soccer,⚽,liked slice
138
+ leftover,stoplight,a stoplight,traffic_light,🚦,liked slice
139
+ leftover,eyeglasses,eyeglasses,glasses,👓,liked slice
140
+ leftover,earbud,an earbud,headphones,🎧,liked slice
141
+ leftover,graduation,graduation,graduate,🎓,liked slice
142
+ leftover,maize,maize,corn,🌽,liked slice
143
+ leftover,cemetery,a cemetery,headstone,🪦,liked slice
144
+ leftover,tombstone,a tombstone,headstone,🪦,liked slice
145
+ leftover,8ball,8ball,pool,🎱,liked slice
146
+ leftover,billiard,billiard,pool,🎱,liked slice
147
+ leftover,meatballs,meatballs,spaghetti,🍝,liked slice
148
+ leftover,porkchop,a porkchop,steak,🥩,liked slice
149
+ leftover,claus,claus,santa,🎅,liked slice
150
+ leftover,hot pepper,hot pepper,chili,🌶️,not hot face
151
+ leftover,orienteering,orienteering,compass,🧭,liked slice
152
+ leftover,ringed planet,a ringed planet,saturn,🪐,liked slice
153
+ leftover,home run,a home run,baseball,⚾,not home plus run
154
+ leftover,hole in one,a hole in one,golf,⛳,not hole
155
+ leftover,email,email,envelope,✉️,one word
156
+ leftover,slam dunk,a slam dunk,basketball,🏀,liked slice
157
+ leftover,free throw,a free throw,basketball,🏀,liked slice
158
+ leftover,three pointer,a three pointer,basketball,🏀,liked slice
159
+ leftover,touchdown,a touchdown,football,🏈,liked slice
160
+ leftover,puck,a puck,hockey,🏒,liked slice
161
+ leftover,karate,karate,martial_arts,🥋,liked slice
162
+ leftover,judo,judo,martial_arts,🥋,liked slice
163
+ leftover,taekwondo,taekwondo,martial_arts,🥋,liked slice
164
+ leftover,racquet,a racquet,tennis,🎾,liked slice
165
+ leftover,surfing,surfing,surf,🏄,liked slice
166
+ leftover,surfer,a surfer,surf,🏄,liked slice
167
+ leftover,icecream,icecream,ice_cream,🍦,one word
168
+ leftover,drumstick,a drumstick,poultry,🍗,not drum
169
+ leftover,grape,a grape,grapes,🍇,singular
170
+ leftover,sleuth,a sleuth,detective,🕵️,liked slice
171
+ leftover,painter,a painter,artist,🎨,liked slice
172
+ leftover,merperson,a merperson,mermaid,🧜,liked slice
173
+ leftover,jester,a jester,clown,🤡,liked slice
174
+ leftover,microphone,a microphone,singer,🎤,liked slice
175
+ leftover,spanner,a spanner,mechanic,🔧,liked slice
176
+ leftover,hardhat,a hardhat,worker,👷,liked slice
177
+ leftover,theatre,theatre,stage,🎭,liked slice
178
+ leftover,magician,a magician,wand,🪄,liked slice
179
+ leftover,hiking,hiking,hike,🥾,liked slice
180
+ leftover,selfie,a selfie,camera,📷,liked slice
181
+ leftover,bacteria,bacteria,microbe,🦠,liked slice
182
+ leftover,amoeba,an amoeba,microbe,🦠,liked slice
183
+ leftover,arachnid,an arachnid,spider,🕷️,liked slice
184
+ leftover,genetics,genetics,dna,🧬,liked slice
185
+ leftover,smoking,smoking,cigarette,🚬,liked slice
186
+ leftover,cartography,cartography,map,🗺️,liked slice
187
+ leftover,bday,bday,birthday,🎂,liked slice
188
+ trap,weather app,the weather app,cloud|phone,☁️📱,app not rain
189
+ trap,bridal shower,a bridal shower,bride|gift,👰🎁,wedding gift not rain
190
+ trap,jet ski,jet ski,wave|boat,🌊🚤,watercraft not airplane
191
+ trap,semi finals,semi finals,trophy|gold,🏆🥇,tournament not truck
192
+ trap,school closed,a school closed,school,🏫,school bus lock must not steal this
193
+ trap,flurry,in a flurry of activity,run|alarm,🏃⏰,hurry not snow
194
+ trap,dashing away,dashing away,run|door,🏃🚪,leaving not wind
195
+ trap,high voltage,high voltage lines,lightning|exclamation,⚡❗,zap plus bang
196
+ trap,loaf around,loaf around,,,must not pick bread
197
+ trap,chocolate bar,chocolate bar,chocolate,🍫,not beer
198
+ trap,bar exam,the bar exam,,,must not pick beer
199
+ trap,restaurant,at the restaurant,,,must not pick bread or wine
@@ -0,0 +1,166 @@
1
+ # Covering: primaries, aliases, cues
2
+
3
+ Readers: this is the **recipe graph** and the **cover algorithm**. Compose does not need an LLM. The tables in `emojifics/recipes.json` *are* the knowledge. Live counts live in that file (`recipe_version` today `0.3.27`). Grammar of the emitted word is `grammar.md`. Glyphic fields are `schema.md`.
4
+
5
+ ## Three English kinds, one picture
6
+
7
+ A **picture** is one Unicode sign (shown emoji / symbol at emoji size; parked Gardiner/hiero on the same row). English reaches that picture in three ways:
8
+
9
+ | Kind | Where | Is it a lexicon key? | `lookup("…")` | `compose(["…"])` | `cover_context("…")` |
10
+ |------|--------|----------------------|---------------|------------------|----------------------|
11
+ | **Primary** | `signs` row with `emoji` (and optional `role`, `gardiner`, `hiero`, `notes`) | Yes | Yes | Yes | Yes, via the key’s surface forms |
12
+ | **Alias** | `signs` row with `alias_of` → another key | Yes | Yes | Yes | Yes, via *this* key’s surface forms (same picture) |
13
+ | **Cue** | `aboutness` map: phrase → one `signs` key, or a short `|`-separated word | **No** | **No** | **No** | Yes: the phrase in the haystack emits the **target key(s)** in order |
14
+
15
+ ```
16
+ healthcare ──cue──► hospital ──primary──► 🏥
17
+ water ──alias─► wave ──primary──► 🌊
18
+ wave ────────► wave ──primary──► 🌊
19
+ ```
20
+
21
+ **Primary** = the main English name for the picture (`wave`, `hospital`).
22
+ **Alias** = another *callable* name for the **same** picture (`water` → `wave`). Not a second emoji.
23
+ **Cue** = English that is *about* a picture (or a short word of pictures) but must not become a sign (`healthcare` is not a hospital drawing; covering still wants 🏥). `dark_humor()` is a closed inject: listed cues get skull first (`flight delayed` → 💀✈️). It is not a mood detector. Tagged `compose(["airplane"])` stays the plane.
24
+
25
+ Do not add a new picture because English varied. That is a cue (or an alias). Add a picture when Unicode already has the thing (♿, 🔋), or a post has a load-bearing fact with **no** sign. Stretch pictures (🛢️ for a flotation barrel) stay empty.
26
+
27
+ ## Recipe schema (the DB)
28
+
29
+ `emojifics/recipes.json` is one blob:
30
+
31
+ ```json
32
+ {
33
+ "recipe_version": "0.3.27",
34
+ "classifiers": { "movies": "🎥" },
35
+ "signs": {
36
+ "wave": { "emoji": "🌊", "gardiner": "N35", "hiero": "𓈖", "notes": "ocean / water surface" },
37
+ "ocean": { "alias_of": "wave" },
38
+ "water": { "alias_of": "wave" },
39
+ "hospital": { "emoji": "🏥" }
40
+ },
41
+ "aboutness": {
42
+ "healthcare": "hospital",
43
+ "tiger shark": "shark",
44
+ "high voltage": "lightning|exclamation"
45
+ },
46
+ "dark_humor": ["flight delayed", "flight delay"]
47
+ }
48
+ ```
49
+
50
+ ```mermaid
51
+ erDiagram
52
+ RECIPES ||--o{ SIGN : signs
53
+ RECIPES ||--o{ CUE : aboutness
54
+ RECIPES ||--o{ CLASSIFIER : classifiers
55
+ SIGN ||--o| SIGN : alias_of
56
+ SIGN ||--|| PICTURE : depicts
57
+ CUE }o--|| SIGN : target
58
+
59
+ RECIPES {
60
+ string recipe_version
61
+ }
62
+ SIGN {
63
+ string key PK
64
+ string alias_of "empty on primary"
65
+ string emoji "primary only"
66
+ string role "logogram default"
67
+ string notes
68
+ string gardiner "parked"
69
+ string hiero "parked"
70
+ }
71
+ CUE {
72
+ string phrase PK
73
+ string concepts "one key, or several in order"
74
+ }
75
+ CLASSIFIER {
76
+ string key PK
77
+ string emoji
78
+ }
79
+ PICTURE {
80
+ string unicode
81
+ }
82
+ ```
83
+
84
+ | Object | Cardinality | Rule |
85
+ |--------|-------------|------|
86
+ | Primary → picture | 1 → 1 | One depicting Unicode cell. No second primary for the same emoji. |
87
+ | Alias → primary | many → 1 | `alias_of` chains resolve in `load_lexicon()` (`_resolve_alias`). Cycles drop. An alias may override `role` / `notes` only. |
88
+ | Cue → concept key(s) | many → 1..n | Targets must exist in `signs`. May be a primary **or** an alias (`seaside` → `sea` → same 🌊 as `wave`). One English span may emit a **short word** (`high voltage` → `lightning`, `exclamation`). Cover **emits the named targets in order**, not a rewritten primary. |
89
+ | Classifier | separate map | Mute mark appended last by tagged `compose(..., classifier=)`. Not a covering table. Some signs also have `role=classifier`. |
90
+
91
+ Pack export (`python -m emojifics install`): aliases are **flattened** into `signs.json` / `chrome.json` (`lexicon_emoji` includes every resolved key). Aboutness is copied as `{cue, concept}` rows. Runtime compose still reads the package blob, not the pack, unless the caller overrides.
92
+
93
+ ## Which English belongs where
94
+
95
+ | If the English… | Put it as | Why |
96
+ |-----------------|-----------|-----|
97
+ | Is the usual name of the picture, and callers should tag it | Primary | `compose(["wave"])` |
98
+ | Is another usual name of the **same** picture (`ocean`, `swimmer`) | Alias | Tagged compose and surface scan both work |
99
+ | Is about the picture but would be a false sign if it were a key (`healthcare`, `medicare`) | Cue | `lookup` stays honest; cover still hits |
100
+ | Needs several pictures to describe the thing without the false friend (`bridal shower`, `jet ski`) | Cue to a short `|` word | One span, several pictures. Do not leave it empty |
101
+ | Is grammar / closed-class spray (`hand`, `present`, `one-man`’s `man`) | `PHRASE_SKIP` in `compose.py`, not a cue | Cover must not treat it as a picture |
102
+ | Stands for **sound**, not the object (`be` 🐝) | `role=phonogram` | Tagged compose only; cover skips |
103
+
104
+ Cues are **not** aliases with the picture omitted. An alias is a key. A cue is haystack English.
105
+
106
+ ## Find
107
+
108
+ `lookup` is an exact sign key. `find` searches the same graph:
109
+
110
+ | Query | Hits |
111
+ |-------|------|
112
+ | `wave` | the primary, then aliases (`water`, `ocean`, `sea`) |
113
+ | `healthcare` | the cue. `lookup("healthcare")` stays `None` |
114
+ | `aquatic` | the shark note |
115
+ | `🌊` | every key that draws that picture, primary first |
116
+
117
+ `python -m emojifics find healthcare` prints `kind`, `name`, `key`, and the picture, one hit per line.
118
+
119
+ ## Cover algorithm
120
+
121
+ `cover_context(text)` in `emojifics/compose.py`. Deterministic. No WordNet, no embeddings, no LLM at runtime.
122
+
123
+ ```mermaid
124
+ flowchart TD
125
+ T[raw text] --> N["_normalize_phrase"]
126
+ N --> H["haystack with spaces"]
127
+ H --> S["scan surface forms of every signs key"]
128
+ H --> C["scan aboutness cue phrases"]
129
+ S --> F["hit list: start, end, concept key, length"]
130
+ C --> F
131
+ F --> G["sort longest span first"]
132
+ G --> O["drop overlapping spans"]
133
+ O --> R["restore left-to-right order"]
134
+ R --> U["drop duplicate pictures"]
135
+ U --> K["concept keys"]
136
+ K --> W["compose: pictures in order, optional classifier last"]
137
+ ```
138
+
139
+ 1. **Normalize.** Lowercase, strip URLs and combining marks, `U.S.` / `U.S.A.` → `usa`, keep `[a-z0-9]` runs as tokens, wrap in spaces.
140
+ 2. **Surface scan.** For each `signs` key that is not `PHRASE_SKIP` and not `role=phonogram`, generate `_phrase_forms` (spacing, simple plurals, a small irregular list). Match as `" {phrase} "` in the haystack. The hit’s concept is **that key** (so `water` in prose emits `water`, which resolves to 🌊).
141
+ 3. **Cue scan.** For each `aboutness` pair `(cue, concepts)`, keep concepts that are in the lexicon and not skipped. If the cue is listed in `dark_humor`, wrap with `dark_humor()` (skull first, then the thing). Match the cue the same way as a surface form. The hit occupies the **whole cue span** and emits the **sequence** (`healthcare` → `hospital`; `flight delayed` → `skull`, `airplane`).
142
+ 4. **Greedy spans.** Sort hits by longer phrase first, then leftmost. Occupied character ranges cannot overlap. Then sort keepers by start index.
143
+ 5. **Unique pictures.** Walk keepers in span order, then each sequence in order; skip if that key has no picture or the picture was already kept. Length follows distinct load-bearing pictures, not a five-count.
144
+
145
+ Do not leave a load-bearing thing empty when the inventory can describe it with a short word. False friends still must not steal the wrong picture (`bridal shower` is 👰🎁, not rain).
146
+
147
+ `scan_text` is step 2 only (helper). `compose_text` is `cover_context` then `compose`. Tagged `compose(concepts)` skips the haystack: it resolves each key through `load_lexicon()` (aliases included) and emits unique pictures in caller order.
148
+
149
+ Minimum cue / phrase length in the scanner is **3** characters (`_add_phrase_hits`). Prefer multiword cues (`quality care`, `law enforcement`).
150
+
151
+ ## Worked row
152
+
153
+ Post says “quality care at the hospital.”
154
+
155
+ | Span | Kind | Emits | Picture |
156
+ |------|------|-------|---------|
157
+ | `hospital` | primary surface | `hospital` | 🏥 |
158
+ | `quality care` | cue | `doctor` | 🩺 |
159
+
160
+ `healthcare` is not in that sentence, so that cue does not fire. `lookup("quality care")` is still `None`.
161
+
162
+ ## Cue seeds
163
+
164
+ Compose does not load a thesaurus or a model. A cue lands only when its target is already a sign, the cue is not itself a sign key, it is at least 3 characters, and the fixture replay still locks.
165
+
166
+ Do not clone CLDR, emojilib, Fluent, Twemoji, or Noto into this repository. Do not vendor emoji artwork.
@@ -0,0 +1 @@
1
+ concept,notes
@@ -0,0 +1,5 @@
1
+ group,name,title,genre,concepts,eg_word,notes
2
+ word,shark,Shark word,,shark|water|swimmer|boat|blood,🦈🌊🏊🚤🩸,depicting
3
+ word,fish_boat,Fish water boat,,fish|water|boat,🐟🌊🚤,short word
4
+ word,old_keys,Old Unicode,,banned|old_phone|white_smile,🈲☎️☺️,emoji size
5
+ word,phonogram,Tagged sounds,,be|aye|inn,🐝👁️🏨,tagged only
@@ -0,0 +1,69 @@
1
+ # Grammar
2
+
3
+ EG writes hieroglyphics: pictures of things, used the way Egyptian signs were used.
4
+
5
+ v1 **pictures** are emoji-sized Unicode (color emoji, dingbats, old keyboard-hidden signs). The **word** still follows Egyptian structure. Egyptian lineart is parked.
6
+
7
+ This is not a Middle Egyptian translator.
8
+
9
+ Recipes in git. Artwork (emoji packs) in a local pack after install. Use sources EG is allowed to use: Unicode interchange; **MIT and other keepable licenses** after review.
10
+
11
+ ## Sign roles
12
+
13
+ The same sign can do different jobs, as in Egyptian:
14
+
15
+ | Role | Job | Spoken? |
16
+ |------|-----|---------|
17
+ | Logogram / pictogram | The picture is the word | Yes |
18
+ | Phonogram | The picture stands for sound (rebus). Tagged compose only; never cover. | Yes (sound) |
19
+ | Determinative / classifier | Mute class mark, usually last, names the kind of thing | No |
20
+
21
+ ## Word
22
+
23
+ ```
24
+ [depicting and/or phonetic signs…] [classifier(s)]
25
+ ```
26
+
27
+ - Variable length. No required hyphen. No required leading mark.
28
+ - Compose is deterministic. No LLM required. Collisions OK.
29
+ - Default reading direction: left to right.
30
+ - Quadrats are a **display** grouping (pairs in virtual squares). The composed string stays linear Unicode. Do not insert Egyptian format controls (U+13430+) into emoji words.
31
+
32
+ ## Picture vars
33
+
34
+ Visualize the context **minimally but comprehensively** through picture vars (each depicting sign is a slot whose value is a picture).
35
+
36
+ - Comprehensive: every load-bearing fact gets a picture if the list has one. Keep adjacency. No generic pad.
37
+ - Minimal: as few vars as will cover it. No required width. No spraying every match from a long phrase.
38
+ - Scale: cover length is commensurate with the source. A tweet is a few pictures. An article with more load-bearing facts is a longer word. Do not freeze tweet-width. Do not pad a long empty text.
39
+ - Tagged input: emit exactly the caller’s vars, in order.
40
+ - Free text: describe the context with inventory pictures (`cover_context`). Unusual-but-recognizable is fine. Do not only transcribe keys that happen to appear. A cue may fill several vars for one English span. Do not leave a thing empty when a short word can describe it. Primaries, aliases, and cues: `covering.md`.
41
+ - Classifier is an extra var at the end, optional.
42
+ - Phonograms are depicting vars that stand for sound. Callers tag them. Cover never picks them.
43
+
44
+ ## Scripts
45
+
46
+ Shown compose is **emoji** (including Unicode symbols at emoji size). Old “banned” / keyboard-hidden signs belong here when they are Unicode RGI — keitai ideographs, text-default dingbats with U+FE0F.
47
+
48
+ `script=hiero` still exists in code. Gardiner/Unicode hieroglyph fields stay on signs in `recipes.json`. They are **not** a shown product surface. Do not invent a hieroglyph for “film camera.” Do not mix lineart into a shown emoji word.
49
+
50
+ ## Sources
51
+
52
+ - Unicode / system emoji, including dingbats and keitai signs at emoji size.
53
+ - MIT-licensed emoji artwork is a **good** source.
54
+ - Review a third-party repo before clone or vendor. No Apple/Google sheets. No Discord packs. No title-look drawings of logos, stills, or packages.
55
+ - Emoji binaries stay off git.
56
+
57
+ ## Spirit (Egyptian order)
58
+
59
+ Depicting signs first. Classifier last, if present.
60
+
61
+ | context | EG word |
62
+ |---------|---------|
63
+ | fish, water, boat | `🐟🌊🚤` |
64
+ | shark, water, swimmer, boat, blood | `🦈🌊🏊🚤🩸` |
65
+ | same, classified as film | `🦈🌊🏊🚤🩸🎥` |
66
+ | prohibition, ghost, city, lightning, flashlight | `🚫👻🏙️⚡🔦` |
67
+ | ship, iceberg, wave, down, cold | `🚢🧊🌊⬇️🥶` |
68
+ | banned, old phone, white smile | `🈲☎️☺️` |
69
+ | be, aye, inn (tagged phonograms) | `🐝👁️🏨` |
@@ -0,0 +1,4 @@
1
+ id,title,blurb,eg_word,cover,text
2
+ clinic,Clinic day,Original covering line.,🏥🩺,hospital|doctor,The clinic offered quality care.
3
+ shore,Shore,Original covering line.,🦈🌊🏊,shark|water|swimmer,A shark moved through the water toward a swimmer.
4
+ clinic_long,Clinic afternoon,Original longer line with more facts.,🏥🩺🚑🧒🤒💊💰,hospital|doctor|ambulance|child|sick|pill|money,"The clinic offered quality care. An ambulance brought a child with a fever. A pill cost money."