Placeholder Text and Morse Code — Two Generators and Their Hidden Rules
Two pages that produce text rather than measure it: the lorem ipsum generator and the Morse code translator. Both run entirely in the page with no network call, and both have rules written into them that the interface does not mention.
Lorem: the count box does not mean what its limits suggest
Three controls — type (Latin / Chinese), unit (paragraphs / sentences / words), and a count with min=1 and max=50 printed on it. The count is then re-clamped in script before those limits are honoured, which changes the outcomes:
- Blank, or a non-number → 3.
- 0 → also 3, not 1. The script substitutes the default for anything it reads as zero before the "less than 1" check runs.
- 1 → 1, and stays the floor once a real number gets through.
- 500 → 50. The upper clamp does behave.
The field also commits on change rather than on each keystroke, so typing a number and leaving it there without clicking away or pressing Enter does not regenerate — the result you see belongs to the previous value.
Latin filler is built from one historical paragraph
The classic Cicero text is split on spaces and commas into a pool of 69 tokens, 64 of them distinct — dolor, ut, dolore and in recur. Because the split removes commas but leaves full stops attached to the word they followed, five tokens carry a period inside them: elit. aliqua. consequat. pariatur. laborum.
Two visible effects:
- Doubled periods and mid-sentence stops. A token that already ends in
.landing in the middle of a generated sentence reads as a full stop, and one landing at the end produces... - Random capitals. Five tokens kept the capital they had at the start of their source sentence —
Lorem,Sed,Ut,Duis,Excepteur— so a capitalised word can arrive anywhere mid-sentence and look like a proper noun.
Commas, by contrast, never survive. Whatever the source paragraph's punctuation, generated Latin text here contains none, which is why the output runs in long unbroken clauses.
Structure is fixed rather than random in length terms: a paragraph is 3–7 tokens, capitalised and closed with a period, then 2–4 more tokens and another period — five to eleven words. A sentence is 5–14 words, and all sentences land on one continuous line rather than one per line. Word mode just emits N tokens.
Chinese filler is real Chinese — and it is text about this site
The Chinese option has its own arrays, so it produces Chinese rather than Latin. Two consequences worth knowing before you drop it into a mock-up:
- Paragraph mode glues together 3–8 whole sentences from a fixed pool of 12, with no separator needed because each already ends in
。. - Sentence mode emits N of those same 12 sentences, space-separated. At any count above a handful you will see the same sentences twice, and the pool is small enough that repetition is the normal case rather than an unlucky draw.
- Word mode emits tokens from a 53-item list (
猫 工具 站 免费 在线 实用 浏览器 …), space-separated. That reads as a keyword cloud, not as prose — fine for testing line wrapping with CJK glyphs, wrong for judging how real copy will sit.
The 12 sentences describe this site and its brands, so a layout filled with Chinese lorem will visibly say things like "猫工具站是猫系列品牌的一员". If your mock-up is going to anyone's eyes, that is worth replacing.
Morse: the table is bigger than the chart
The reference grid draws 36 tiles — A to Z and 0 to 9. The translation table behind the tool has 57 entries: the same 36 plus 21 punctuation marks (. , ? ! : ; ' " ( ) [ ] { } & * @ = + - /).
So punctuation does encode correctly, even though three places on the page say it does not. Hello, world! produces proper comma and exclamation codes. What genuinely has no representation is anything outside ASCII letters, digits and those 21 marks — accented letters (café → the é becomes a question mark), currency symbols, CJK characters, and emoji. Those all come out as ?.
Letters are upper-cased before lookup, so input case does not matter.
Spaces, slashes, and the round trip that is not symmetric
- Letters are separated by one space; words are separated by
/. - The split is on any whitespace, so a line break acts as a word separator — pasting a multi-line text gives you
/where the newlines were. - The input is not trimmed. A leading or trailing space becomes an empty word and emits a stray
/at the start or end of the code.
Decoding is deliberately forgiving: unknown token sequences become ? inline rather than aborting. But the reverse mapping is one-directional, because three punctuation marks share a code — (, [ and { are all -.--., and ), ], } are all -.--.-. Encode then decode that pair set and you get { and } back regardless of what went in. Everything else round-trips, provided you decode the uppercase result the tool emits.
Playing the code: timings, and why it can overlap itself
The oscillator is a fixed 700 Hz, switched on and off with no fade, which is why the notes sound like clicks at low volume. The timings in the code are:
| Interval | Seconds | In dot lengths |
|---|---|---|
| Dot | 0.08 | 1 |
| Dash | 0.24 | 3 |
| Gap inside a character | 0.08 | 1 |
| Gap between characters | 0.20 | 2.5 |
| Gap between words | 0.40 | 5 |
Dot and dash are textbook — a dash lasts three dots. The inter-character and inter-word gaps are compressed to 2.5 and 5 dot lengths, while the page's own explanation quotes the conventional 3 and 7. The rhythm therefore reads slightly faster and more crowded than real code, which matters if you are using it to learn timings rather than to hear a word.
Three mechanical notes about playback:
- Any character that is not
.is sounded as a dash — including the?produced by an unsupported input. One accented letter in your text will insert a dash into the audio. - Each click of Play builds a fresh audio context, and there is no Stop button. Clicking twice stacks two overlapping performances; the only cure is waiting for the first to finish. Audio contexts also accumulate until you reload.
- In encode mode Play reads the result box, which is editable. Hand-tune the dots and dashes there and you can play a sequence the translator would never have produced.
What happens to your text
Neither page sends anything anywhere. Generation and translation happen in the script on the page; the only thing that leaves is the ordinary page traffic the site already makes (analytics, advertising, and the Live2D widget on desktop). Both pages keep a live example on screen — Morse starts with SOS loaded, and Lorem generates on page open — so what you see before typing is sample output, not your own.