oneliner

2013-10-03

Given a piece of text, summarize it with a one-liner

Upstream URL

github.com/mck-/oneliner

Author

mck-

License

wtfpl
README

One-liner

Extracts a one-liner from a piece of text.

How?

  1. Counts word occurences
  2. Given each word, count word occurences immediately after this word
  3. Construct sentence by taking 1 and 2 recursively
  4. Avoids repeating a word to avoid infinite loops
  5. 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

Dependencies (3)

  • cl-ppcre
  • lisp-unit
  • split-sequence

Dependents (0)

    • GitHub
    • Quicklisp