The cl-oneliner Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-oneliner Reference Manual

This is the cl-oneliner Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Sep 15 05:46:44 2022 GMT+0.

Table of Contents


1 Introduction

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


2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-oneliner

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

Author

mck-

License

wtfpl

Version

0.1.0

Dependencies
  • lisp-unit (system).
  • split-sequence (system).
  • cl-ppcre (system).
Source

cl-oneliner.asd.

Child Components

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 cl-oneliner/test

Dependency

cl-oneliner.lisp (file).

Source

cl-oneliner.asd.

Parent Component

cl-oneliner (system).

Child Component

utils.lisp (file).


4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

4.1.1 cl-oneliner/cl-oneliner.asd

Source

cl-oneliner.asd.

Parent Component

cl-oneliner (system).

ASDF Systems

cl-oneliner.


4.1.2 cl-oneliner/package.lisp

Source

cl-oneliner.asd.

Parent Component

cl-oneliner (system).

Packages

cl-oneliner.


4.1.3 cl-oneliner/utils.lisp

Dependency

package.lisp (file).

Source

cl-oneliner.asd.

Parent Component

cl-oneliner (system).

Internals

4.1.4 cl-oneliner/cl-oneliner.lisp

Dependency

utils.lisp (file).

Source

cl-oneliner.asd.

Parent Component

cl-oneliner (system).

Public Interface

oneliner (function).

Internals

4.1.5 cl-oneliner/test/utils.lisp

Source

cl-oneliner.asd.

Parent Component

test (module).


5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 cl-oneliner

Source

package.lisp.

Use List
  • cl-ppcre.
  • common-lisp.
  • lisp-unit.
  • split-sequence.
Public Interface

oneliner (function).

Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Public Interface


6.1.1 Ordinary functions

Function: oneliner (string)

Given a string, summarize the piece of text in a oneliner

Package

cl-oneliner.

Source

cl-oneliner.lisp.


6.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

6.2.1 Macros

Macro: val (alist &rest keys)

Given an alist, and a list of keys, retrieve value dot-notation style

Package

cl-oneliner.

Source

utils.lisp.

Macro: val-reversed (alist &rest keys)

Given an alist, and a list of keys, retrieve value dot-notation style (reversed)

Package

cl-oneliner.

Source

utils.lisp.


Previous: , Up: Internals   [Contents][Index]

6.2.2 Ordinary functions

Function: alist-count (string)

Given a string, return an Alist counting the words

Package

cl-oneliner.

Source

utils.lisp.

Function: alist-most-frequent (alist-count)

Given an alist-count, return most frequent item

Package

cl-oneliner.

Source

utils.lisp.

Function: alist-most-frequent-next (most-frequent)

Given an object (from alist-most-frequent), return the word that occurs most frequently as next word

Package

cl-oneliner.

Source

utils.lisp.

Function: alist-next-count (string alist)

Given the original string and the alist resulting from alist-count, count next words

Package

cl-oneliner.

Source

utils.lisp.

Function: aval (key alist)

Given alist and key, return value

Package

cl-oneliner.

Source

utils.lisp.

Function: count-words (string)

Given a string, return an alist which counts the words and the next words that come after it

Package

cl-oneliner.

Source

utils.lisp.

Function: get-count (word alist-count)

Given a word and an alist-count, return number of occurence

Package

cl-oneliner.

Source

utils.lisp.

Function: get-next-word (alist word)
Package

cl-oneliner.

Source

cl-oneliner.lisp.

Function: next-counts (word string)

Given a word and the string, return list of (word . count)

Package

cl-oneliner.

Source

utils.lisp.

Function: remove-word (alist word)

Given an alist-count and current word, return alist without word – and make sure they are also removed from all next counts

Package

cl-oneliner.

Source

cl-oneliner.lisp.

Function: simplify-word (word)

Given a word, put it to lower-case and remove all symbols

Package

cl-oneliner.

Source

utils.lisp.

Function: split-words (sentence)
Package

cl-oneliner.

Source

utils.lisp.

Function: words-sorted (sentence)
Package

cl-oneliner.

Source

utils.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   C   F   G   M   N   O   R   S   V   W  
Index Entry  Section

A
alist-count: Private ordinary functions
alist-most-frequent: Private ordinary functions
alist-most-frequent-next: Private ordinary functions
alist-next-count: Private ordinary functions
aval: Private ordinary functions

C
count-words: Private ordinary functions

F
Function, alist-count: Private ordinary functions
Function, alist-most-frequent: Private ordinary functions
Function, alist-most-frequent-next: Private ordinary functions
Function, alist-next-count: Private ordinary functions
Function, aval: Private ordinary functions
Function, count-words: Private ordinary functions
Function, get-count: Private ordinary functions
Function, get-next-word: Private ordinary functions
Function, next-counts: Private ordinary functions
Function, oneliner: Public ordinary functions
Function, remove-word: Private ordinary functions
Function, simplify-word: Private ordinary functions
Function, split-words: Private ordinary functions
Function, words-sorted: Private ordinary functions

G
get-count: Private ordinary functions
get-next-word: Private ordinary functions

M
Macro, val: Private macros
Macro, val-reversed: Private macros

N
next-counts: Private ordinary functions

O
oneliner: Public ordinary functions

R
remove-word: Private ordinary functions

S
simplify-word: Private ordinary functions
split-words: Private ordinary functions

V
val: Private macros
val-reversed: Private macros

W
words-sorted: Private ordinary functions

Jump to:   A   C   F   G   M   N   O   R   S   V   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables