This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abrahamlincoln 11.22 | |
| andrewjackson 18.56 | |
| andrewjohnson 14.73 | |
| benjaminharrison 15.99 | |
| billclinton 9.18 | |
| chesterarthur 16.36 | |
| coolidge 12.60 | |
| eisenhower 11.28 | |
| franklinpierce 18.55 | |
| franklinroosevelt 11.08 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bachmann: | |
| Flesh-Kincaid Grade Level: 8.47 | |
| Flesh Reading Ease Score: 65.88 | |
| Sentences: 232 | |
| Words: 4,113 | |
| Averaage Syllables per Word: 1.45 | |
| Average Words per Sentence: 17.73 | |
| cain: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require(tm) | |
| require(wordcloud) | |
| require(RColorBrewer) | |
| presidentplot <- function(president) | |
| { | |
| u <- Corpus(DirSource(paste("/Users/someuser/projects/blog/presidents/txt/", president, sep="", collapse="")), readerControl = list(reader = readPlain)) | |
| ap.corpus <- tm_map(u, removePunctuation) | |
| ap.corpus <- tm_map(ap.corpus, tolower) | |
| ap.corpus <- tm_map(ap.corpus, function(x) removeWords(x, stopwords("english"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| BASEDIRECTORY="/Users/someuser/projects/blog/presidents/txt" | |
| # Make it as non-html as possible and save the file in .txt | |
| function cleanup() { | |
| awk '/\/article/{f=0}/div id=transcript class=indent>/{f=1;next}f' $1 | sed 's/<div>//g' | sed 's/<\/div>//g' | sed 's/<p>//g' | sed 's/<\/p>//g' | sed 's/ //g' | sed 's/<br\/>//g' | sed 's/mdash;//g' > $1.txt | |
| } | |
| function get_speech() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mandelbrot[c_] := Module[{z = 0, i = 0}, While[i < 100 && Abs[z] < 2, z = z^2 + c; i++]; i]; | |
| DensityPlot[Mandelbrot[xc + I yc], {xc, -2, 1}, {yc, -1.5, 1.5}, | |
| PlotPoints -> 275, Mesh -> False, Frame -> False, | |
| ColorFunction -> (If[# != 1, Hue[#], Hue[0, 0, 0]] &)] |