oneliner
2013-10-03
Given a piece of text, summarize it with a one-liner
One-liner
Extracts a one-liner from a piece of text.
How?
- Counts word occurences
- Given each word, count word occurences immediately after this word
- Construct sentence by taking 1 and 2 recursively
- Avoids repeating a word to avoid infinite loops
- Removes all punctuation marks and convert to lower-case
Why?
Why not. Are you not curious about the results?
Example
(ql:quickload 'cl-oneliner)
(cl-oneliner:oneliner "whatever wall of text you are too lazy too read")
In the functional fashion of recursion, when given this README as an example, it produces the following:
"word occurences given each"
Isn't that just poetic?
Idea sparked by @flockonus