P
A
R
A
G
R
A
M

the art of letter transposition

para-

(beside, beyond)

gramma

(letter, writing)

From the ancient Greek wordplay of Lycophron, who rearranged the letters of King Ptolemy's name to create flattering phrases, through John Taylor's 17th-century "Great Anagram" tradition, to modern computational linguistics where algorithms enumerate every possible transposition of a string -- the paragram has always lived at the intersection of language and mathematics. It is the proof that meaning is fragile, that a single displaced letter can collapse one word into another, revealing hidden kinships between terms that only pretend to be strangers.

the algorithm

 1  function paragram(word) {
 2    let letters = word.split('');
 3    let possibilities = [];
 4
 5    // for each letter, consider its neighbor
 6    for (let i = 0; i < letters.length - 1; i++) {
 7      let transposed = [...letters];
 8
 9      // the moment of transformation:
10      // two letters trade places,
11      // and meaning shivers.
12
13      [transposed[i], transposed[i+1]] =
14        [transposed[i+1], transposed[i]];
15
16      possibilities.push(
17        transposed.join('')
18      );
19    }
20
21    // what was one word
22    // becomes many,
23    // each a shadow of the original,
24    // each a possible world.
25
26    return possibilities;
27  }
P
A
R
A
G
R
A
M
.dev