I've need a function which convert a paragraph into the line, sort each space separated set of characters and fill it back to paragraph.
In:
Supposedly there are over one million words in the English Language. We trimmed some fat to take away really odd words and determiners. Then we grabbed the most popular words and built this word randomizer. Just keep clicking generate chances are you won't find a repeat
out:
English Just Language Supposedly Then We a and and are are. away built chances clicking determiners fat find generate grabbed in keep million. most odd one over popular randomizer really repeat some t take the. the there this to trimmed we won word'words words words you
Trying to adopt function from EmacsWiki
(defun sort-words (reverse beg end)
"Sort words in region alphabetically, in REVERSE if negative.
Prefixed with negative \\[universal-argument], sorts in reverse.
The variable `sort-fold-case' determines whether alphabetic case
affects the sort order.
See `sort-regexp-fields'."
(interactive "*P\nr")
(sort-regexp-fields reverse "\\w+" "\\&" beg end))