mochitako 0.2.0
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.
- package/README.md +118 -0
- package/data/words.json +6640 -0
- package/dist/cli.mjs +6811 -0
- package/dist/index.d.mts +56 -0
- package/dist/index.mjs +6785 -0
- package/package.json +58 -0
- package/schema/words.schema.json +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# mochitako
|
|
2
|
+
|
|
3
|
+
A curated, machine-readable vocabulary of cute, slightly strange
|
|
4
|
+
Japanese-inspired words — plus a small slug generator as its reference
|
|
5
|
+
implementation.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ mochitako
|
|
9
|
+
mochimochi-tako
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## The vocabulary
|
|
13
|
+
|
|
14
|
+
`data/words.json` is the artifact. Every entry looks like:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"value": "purin",
|
|
19
|
+
"reading": "プリン",
|
|
20
|
+
"kind": "food",
|
|
21
|
+
"vibes": ["sweet"],
|
|
22
|
+
"weirdness": 1.0,
|
|
23
|
+
"roles": ["prefix", "suffix"]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- `value` — lowercase ASCII romaji, safe for slugs and identifiers
|
|
28
|
+
- `reading` — Japanese orthography (hiragana / katakana)
|
|
29
|
+
- `kind` — lexical category: `texture`, `mood`, `motion`, `sound`,
|
|
30
|
+
`nature`, `food`, `creature`, `object`, `concept`, `trait`
|
|
31
|
+
- `vibes` — mood tags: `sleepy`, `fluffy`, `happy`, `nature`, `weather`,
|
|
32
|
+
`motion`, `sweet`, `mysterious`, `tiny`, `weird`
|
|
33
|
+
- `weirdness` (0–1) — how out-of-place the word feels
|
|
34
|
+
- `roles` — which slug slots the word can occupy (`prefix` / `suffix`)
|
|
35
|
+
|
|
36
|
+
The corpus holds 921 words (500 prefix-eligible, 500 suffix-eligible;
|
|
37
|
+
79 entries play both roles), giving 250,000 possible combinations. Compose it however you like —
|
|
38
|
+
`mochimochi_tako`, `MochimochiTako`, `もちもちたこ` — the schema is at
|
|
39
|
+
`schema/words.schema.json`.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Library:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import {
|
|
47
|
+
words, // all 921 entries
|
|
48
|
+
prefixes, // entries whose roles include "prefix"
|
|
49
|
+
suffixes, // entries whose roles include "suffix"
|
|
50
|
+
generate,
|
|
51
|
+
generateMany,
|
|
52
|
+
createGenerator,
|
|
53
|
+
} from "mochitako";
|
|
54
|
+
|
|
55
|
+
generate(); // "kosokoso-purin"
|
|
56
|
+
generate({ vibe: "sleepy" }); // "utouto-azarashi"
|
|
57
|
+
generate({ vibe: "weird", chaos: 1 });
|
|
58
|
+
generateMany(10, { seed: "tako" }); // deterministic
|
|
59
|
+
|
|
60
|
+
const gen = createGenerator({ seed: "octopus" });
|
|
61
|
+
gen(); gen(); // a deterministic stream
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Raw JSON (any language, via the npm tarball):
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import corpus from "mochitako/words.json" with { type: "json" };
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
CLI:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
mochitako # one random slug
|
|
74
|
+
mochitako -n 5 # five slugs
|
|
75
|
+
mochitako --vibe sleepy # only sleepy-mood words
|
|
76
|
+
mochitako --chaos 0.5 # each word may ignore the vibe filter 50% of the time
|
|
77
|
+
mochitako --seed tako # deterministic output
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## How the generator works
|
|
81
|
+
|
|
82
|
+
A slug is `<prefix>-<suffix>` drawn from the two role-filtered pools.
|
|
83
|
+
`chaos` is the probability that each pick ignores the vibe filter and draws
|
|
84
|
+
from the whole pool instead, weighted toward weirder words. `chaos 0` gives
|
|
85
|
+
`utouto-azarashi`; `chaos 1` gives `mochimochi-tako` and `kosokoso-purin`.
|
|
86
|
+
|
|
87
|
+
## Curation policy
|
|
88
|
+
|
|
89
|
+
A word belongs here if it is: romanizable Japanese (or a loanword naturalized
|
|
90
|
+
into it), pronounces cleanly, carries a concrete image or feeling, and
|
|
91
|
+
combines amusingly with words from other categories. Abstract evaluations
|
|
92
|
+
(`beautiful`, `nice`) are out; textures, creatures, foods, and odd little
|
|
93
|
+
objects are in.
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
Requires Node.js >= 22 (runs TypeScript directly) and pnpm.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
pnpm install
|
|
101
|
+
pnpm cli # node src/cli.ts
|
|
102
|
+
pnpm test # vitest — includes corpus invariant checks
|
|
103
|
+
pnpm typecheck # tsc --noEmit
|
|
104
|
+
pnpm lint # biome check
|
|
105
|
+
pnpm build # tsdown → dist/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Dictionary evaluation
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
pnpm eval:serve # open http://127.0.0.1:4318/
|
|
112
|
+
# answers save automatically to evaluation/results/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Compare two names with one side held constant. Each session ends after ten
|
|
116
|
+
questions; skip, undo, and resume are supported without entering scores or
|
|
117
|
+
managing JSON. Existing browser-only answers can be imported once from a backup. See [the evaluation guide](evaluation/README.md) for sampling,
|
|
118
|
+
optional backup/reporting, and interpretation limits.
|