Sometime between 1996 and 1997 (I think it was in Mr. Kavanagh's geometry class), I asked Ted Graham if he could recommend a good book because I respected his taste in books. Ted recommended that I read Umberto Eco's Name of the Rose. The book was not available at the library, but I managed to find another book by the same author.
In Umberto Eco's Foucault's Pendulum, three editors find meaning in random phrases generated by a computer program called Abulafia. The program takes a text file as input and generates random phrases as output.
{ source_text : Source Text ? Text from which to Extract Random Words }
{ word_count_per_concept : # of Words per Concept ? Number of Words to Include in Each Phrase }
{ concept_count : # of Concepts ? Number of Phrases to Generate }
# CrossCompute
source_text_path = 'selected-reminders.txt'
word_count_per_concept = 7
concept_count = 3
target_folder = '/tmp'
import re
source_text = open(source_text_path, 'rt').read()
source_text = re.sub(r'[^a-zA-Z\s]', '', source_text)
source_text = source_text.lower()
words = source_text.split()
import random
concept_lines = []
for concept_index in range(concept_count):
random_words = random.choices(words, k=word_count_per_concept)
concept_lines.append(' '.join(random_words))
concept_lines
from os.path import join
target_path = join(target_folder, 'concepts.txt')
with open(target_path, 'wt') as target_file:
target_file.write('\n'.join(concept_lines))
print('concepts_text_path = %s' % target_path)
Study each concept carefully to determine its secret meaning.
{ concepts_text : Concepts ? Determine the Secret Meaning Behind each Phrase }