Marcelo de Moraes Serpa <celose...@gmail.com> writes: > Hi list, > > How hard would it be to parse a bunch of org files and build an elisp data > structure (Hash?) that represents a tagcloud? All tags in all headlines and > subtrees should be taken into account (for all org files that are parsed). > Could I use org-element to help me parse this or is there a better way? > > I'm just learning the org API, and I've only done a bunch of elisp hacks, > so any insight would be greatly appreciated! > > Thanks, > > - Marcelo.
My favorite method of getting word frequencies from text files is the following. Sometimes it is easier to just Org-mode files as text files rather than to use e-lisp. # -*- shell-script -*- many=20 # to print the 20 most popular words cat org-file.org \ |tr -cs A-Za-z '\n' \ |tr A-Z a-z \ |sort \ |uniq -c \ |sort -rn \ |sed ${many}q \ |sed 's/^ *//' \ |sed 's/\([^ ]*\) \([^ ]*\)/\2:\1/' \ |tr '\n' ' ' \ |sed 's/ $/\n/' Adapted from http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/ Best, -- Eric Schulte http://cs.unm.edu/~eschulte