Advertisement
Matthen

Self Zipf

Nov 20th, 2011
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. source = Import[NotebookFileName[], "Plaintext"];
  2. words = Select[
  3. StringTrim /@ StringSplit[source, {" ", "[", "]", "\n"}],
  4. StringLength[#] > 0 &];
  5. ListPlot[Map[#[[2]] &, SortBy[Tally[words], -#[[2]] &]],
  6. PlotRange -> All, Joined -> True]
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement