Recently I’ve been busy learning python. This is a short summary of what I’ve learned so far, mainly for accountability purposes.
I learned how to scrape websites using BeautifulSoup and that I should include a sleep(x) between requests so as not to hammer the site and get my IP banned.
I learned how to use NLTK to generate random sentences with a seed word using ngrams.
Couple of examples using seed words “Lady” and “Man”. Experimented with using bigrams, trigrams and quadgrams (sp?)
Lady of Chertsey , Who said , who loved to see little folks merry ; So he made them a Book , and with laughter they shook At the fun
Lady of Clare , Who said , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft , oft
Man of the Isles , Whose face with red ochre . When they silenced his clamor . By smashing that Person of Chili . There was a Young Lady whose eyes Were unique as Angels kenn he fell , from SYRIAN ground , That nasty Old Person of Chili . There was dire , As Gods , and dazling Arms ,
Lady of Parma , Which drowned that Old Man of Chertsey , Who possessed a large Cow , but buns , That dolorous Man of the air could repose ; But they gave him awake they fed them on Snails , and weighed them in scales ; When she ceased to repine , That capricious Young Lady of Ischia , Whose toilette was None
Man by him seduc’t , but on the harp , for the ease you find To Noon he fell By FONTARABBIA . For Spirits when by the Vision led His eye survay ‘d the cold . There was an Old Man of Whitehaven . There was a Young Lady of Prague , His utmost power oppos’d In dubious Battel on the will
Lady whose chin Resembled the point of Crete , Whose toilette was far from complete ; He sat on whose nose Most birds of the Wrekin , Whose head was as the bush ! ” There was an Old Man with a gong . There was horribly vague ; But in handing his daughter , Which refreshed that virulent Bull
I learned that animals from different countries have different accents. And different countries have different sounds for sounds.
And that’s it.