Imagine mapping English to short codes, like “a”, “aa”, “abc”, “cde”, separated by spaces. How would you do it?
In my opinion, this is very mathematical: because combinations of any finite alphabet are orderable, they are countable in the set-theoretic sense (like integers). Whereas it is difficult to conceive of a good “ordering” on the elements of English, but it is a good paradigm to explore and learn something from.
You can proceed from concepts, or a compression algorithm on sentences, for example.
You could take a frequency list of strings from an English corpus and make a basic algorithm that compresses each string to the first letter - if the letter is already taken, next it seeks the first letter of each word, if possible, to form a partial or total acrostic - it can also choose to add a numerical suffix, like a1, a2, a39, etc. It can also take common letters from words, like ‘cabbage’ becomes cbg.
What algorithm would you design?
This is a simple, non-ideal example, in Algol. I don’t think it works perfectly. Work in progress.
It iterates over strings of letters from shortest to longest.
begin
file f := stand out to "map-english-to-short-codes";
char array alphabet[1:26];
alphabet := ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
int i := 1;
while i <= upb alphabet do
begin
printf(stand out, "Is %c a word? (1 for yes, 0 for no)", alphabet[i]);
int response;
scanf(stand in, "%d", response);
if response = 1 then
begin
printf(stand out, "What is its shortcut?");
char array shortcut[1:10];
scanf(stand in, "%s", shortcut);
printf(f, "%c %s\n", alphabet[i], shortcut);
end;
i := i + 1;
end;
end
I am picturing making a tree of strings, like
(a, an)
(an, and)
(and, andy)
(and, andrew)
(bat, batch)
(bat, batter)
(batter, battery)
What is interesting here, is that in one direction, the tree is not totally ordered, but starting from the longest strings, every string has only one “parent” string.
This could be a way to find an ordering on English words, and map them into all possible alphabet arrangements, a, aa, ab, abc, abcd, abdd,
etc.