This task builds on: Find all reflexicons using roman numerals
An autogram is a sentence that lists the count of its own letters. Below is one of the first documented autograms found by Lee Sallows in 1983:
This pangram lists four a’s, one b, one c, two d’s, twenty-nine e’s, eight f’s, three g’s, five h’s, eleven i’s, one j, one k, three l’s, two m’s, twenty-two n’s, fifteen o’s, two p’s, one q, seven r’s, twenty-six s’s, nineteen t’s, four u’s, five v’s, nine w’s, two x’s, four y’s, and one z.
The autogram (pangram) above contains exactly what it says it does as per definition. Autograms in English (using numerals in English) are very computationally intensive to find so instead we will focus on using Roman numerals (I, II, III, IV...).
Your task is to write a program* that takes as input* two strings and produces one valid autogram. We shall call the first string the "intro" - in the above autogram the intro is "This pangram lists". We shall call the second string the "last separator" and in the above autogram it is the very last "and" at the end.
* "program" can be a function or anything equivalent and input can come from stdin, function parameters or whatever is easy; use any separator you prefer in between the two strings if needed. Output should be in a human readable format - the intro must come first, then followed by the frequencies, then the last separator and the frequency of the last letter. Sorting the letters alphabetically is not required. Fillers/"dummies" are allowed (I C, I Z, etc) but are not required - the fillers can be picked from the alphabet used by the chosen language for the intro.
Here is a list of Roman numerals [1..40] for convenience:
I II III IV V VI VII VIII IX X
XI XII XIII XIV XV XVI XVII XVIII XIX XX
XXI XXII XXIII XXIV XXV XXVI XXVII XXVIII XXIX XXX
XXXI XXXII XXXIII XXXIV XXXV XXXVI XXXVII XXXVIII XXXIX XL
This is an example of an autogram in Latin (sure, use Latin to match the numerals!) (by Gilles Esposito-Farèse, 2013):
IN HAC SENTENTIA SVNT III A, I B, II C, I D, IV E, I F, I G, II H, XXXII I, I K, I L, I M, V N, I O, I P, I Q, I R, III S, V T, VII V, IV X, I Y ET I Z.
Here the intro is "IN HAC SENTENTIA SVNT" (SVNT/SUNT are both ok), and the last separator is "ET". More intros in English if you're looking for inspiration:
This sentence contains/lists/includes/has/uses
This autogram contains/lists/includes/has/uses
and last separators:
and
and last but not least
and finally
{I, V, X, L, ...}
(as required) unioned with the sets of letters present in the two input strings, or must we cover the whole modern-Latin alphabet, or the whole of an ancient-Latin alphabet (please define if so)? Note that the example given coversB
but notJ
, while neither are present in what would be the input strings (covers an ancient-Latin alphabet, I guess). \$\endgroup\$I
s? If so then you would need a numeral larger than 40 to give a valid answer. If it were something slightly smaller then some algorithms might require numerals over 40 while some might be able to to do it without them. It's up to you how you require answers to behave, since it is your challenge. \$\endgroup\$