Then the gestures of our world, and the labours of precipitous walls of the same peculiar risk was Weena had fallen. Were mere touch of evergreens, the day or online at a score or re-use it takes a difference to economise my .... Upon? Day, an idea that that hasty conclusions upon the bushes all the house now make out his life of hypertrophied raspberry .... Me of the method of social question that experience of them I could do not think that seemed to break open .... Not know of the house, I was loose, and the limited right or 1.E.9. Vertical movement. And the first time. Seen me, was even satisfy myself and now I saw a thick darkness. Tail-coat permitted, and told you. I supposed the current of white animal in a refund set it as startled them. That long day. Art of her in the house. Season all Time Machine. Said to wash and when it related to associate it was destined, at my tree burst into the horror to her, .... Morlocks were none. Beheld a nightmare sensation of metalwork. I put them was the forest. Softness of the time, too, I found the balloons, save for her Fear. Is my comfort; but there in the accepted it was absolutely unknown things before them, in among the subsiding stir and ....
30行ほどのプログラムでThe Time Machineを解析して作成しています。
<入力部>
原文を単語に分割、小文字化
記号などの入ったものをいくつか削除
<文書作成部>
最初の単語をランダムに選出
原文でその単語につながっている単語を抽出(同じ単語でも追加していく)*1
その中から次の単語をランダムに選出
その単語の最期が. ?または単語の長さが20を越えたら ....を追加
最後に文の先頭を大文字化
おそるべきことにプログラム
*1をその都度計算しているのに(遅いロジック)colabolatryで実行時間0秒表示です。
(一単語ずつThe Time Machineを全検索かけてることになります)
わけのわからない文章が山のようにできます。
人間同士が共通理解を高めるために文法とかあるのかなと思いました。
<作成ソース>
https://colab.research.google.com/drive/1EcBsXrrcVJw2TAaG3xLqnZRVfZ8LEqdO?usp=sharing
<参考文献>
https://www.gutenberg.org/files/35/
こちらからtxtデータを取得してコラボラトリのセッション ストレージにアップロードが必要です。