The lyrics Reference Manual

This is the lyrics Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:59:04 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 lyrics

Song lyrics with local database

Author

Mihai Olteanu <>

License

GPLv3

Version

0.1

Dependencies
  • drakma (system).
  • plump (system).
  • lquery (system).
  • cl-ppcre (system).
  • sqlite (system).
  • alexandria (system).
  • bordeaux-threads (system).
  • defmemo (system).
Source

lyrics.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 lyrics/lyrics.asd

Source

lyrics.asd.

Parent Component

lyrics (system).

ASDF Systems

lyrics.


3.1.2 lyrics/package.lisp

Source

lyrics.asd.

Parent Component

lyrics (system).

Packages

lyrics.


3.1.3 lyrics/lyrics.lisp

Dependency

package.lisp (file).

Source

lyrics.asd.

Parent Component

lyrics (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 lyrics

Source

package.lisp.

Use List
  • common-lisp.
  • defmemo.
  • drakma.
  • sqlite.
Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: lyrics (artist song)

Memoized lyrics search. Search the lyrics for the given artist and song name. If the lyrics are not in the db, try and extract them from one of the supported lyrics websites. If found, save the lyrics the db and return them. If not found, return nil.

Package

lyrics.

Source

lyrics.lisp.

Function: search-song (lyrics)

Return a list of entries, where each entry is a list with the artist name, the song name and the verse line where the lyrics appears. The artist name and song can be used to request the full lyrics. There can be multiple entries for the same artist/song combination.

Package

lyrics.

Source

lyrics.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *db*
Package

lyrics.

Source

lyrics.lisp.

Special Variable: *raw-websites*
Package

lyrics.

Source

lyrics.lisp.

Special Variable: *websites*

List of structures, where each structure is a lyrics website

Package

lyrics.

Source

lyrics.lisp.


5.2.2 Ordinary functions

Function: case-insensitive-regex (regex)

Transform a ’day’ string into ’[dD][aA][yY]’ for a case insensitive search.

Package

lyrics.

Source

lyrics.lisp.

Function: copy-website (instance)
Package

lyrics.

Source

lyrics.lisp.

Function: find-lyrics (website artist song)

See if this website hosts the lyrics for this artist and song. If yes, then use the css selectors to extract the lyrics. If not, return nil, and move along. Maybe other sites host them.

Package

lyrics.

Source

lyrics.lisp.

Function: lyrics-from-db (artist song)

Get the lyrics from the db, if they exists. Return nil otherwise.

Package

lyrics.

Source

lyrics.lisp.

Function: make-website (&key name url-template separator css-selector)
Package

lyrics.

Source

lyrics.lisp.

Function: request-lyrics (list-of-artists-and-songs)

Start an asynchronous request for lyrics. The argument is a list of artist-name and song-name lists. This is a batch request for lyrics. The actual lyrics can be later retrieved from the database since this function only returns the thread that is started for the request.

Package

lyrics.

Source

lyrics.lisp.

Function: save-lyrics-to-db (artist song lyrics)

Save the lyrics for future retrieval and return them.

Package

lyrics.

Source

lyrics.lisp.

Function: setup-db ()

Create a sqlite table in ~/ if one does not already exist.

Package

lyrics.

Source

lyrics.lisp.

Function: url (website artist song)

Create a valid url from the website pattern. First, the artist and song string must be prepared by replacing the spaces with the website separator and then the final url is prepared by replacing the aritst-name and song-name in the template.

Package

lyrics.

Source

lyrics.lisp.

Reader: website-css-selector (instance)
Writer: (setf website-css-selector) (instance)
Package

lyrics.

Source

lyrics.lisp.

Target Slot

css-selector.

Reader: website-name (instance)
Writer: (setf website-name) (instance)
Package

lyrics.

Source

lyrics.lisp.

Target Slot

name.

Function: website-p (object)
Package

lyrics.

Source

lyrics.lisp.

Reader: website-separator (instance)
Writer: (setf website-separator) (instance)
Package

lyrics.

Source

lyrics.lisp.

Target Slot

separator.

Reader: website-url-template (instance)
Writer: (setf website-url-template) (instance)
Package

lyrics.

Source

lyrics.lisp.

Target Slot

url-template.


5.2.3 Structures

Structure: website
Package

lyrics.

Source

lyrics.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: name
Readers

website-name.

Writers

(setf website-name).

Slot: url-template
Readers

website-url-template.

Writers

(setf website-url-template).

Slot: separator
Readers

website-separator.

Writers

(setf website-separator).

Slot: css-selector
Readers

website-css-selector.

Writers

(setf website-css-selector).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   F   L   M   R   S   U   W  
Index Entry  Section

(
(setf website-css-selector): Private ordinary functions
(setf website-name): Private ordinary functions
(setf website-separator): Private ordinary functions
(setf website-url-template): Private ordinary functions

C
case-insensitive-regex: Private ordinary functions
copy-website: Private ordinary functions

F
find-lyrics: Private ordinary functions
Function, (setf website-css-selector): Private ordinary functions
Function, (setf website-name): Private ordinary functions
Function, (setf website-separator): Private ordinary functions
Function, (setf website-url-template): Private ordinary functions
Function, case-insensitive-regex: Private ordinary functions
Function, copy-website: Private ordinary functions
Function, find-lyrics: Private ordinary functions
Function, lyrics: Public ordinary functions
Function, lyrics-from-db: Private ordinary functions
Function, make-website: Private ordinary functions
Function, request-lyrics: Private ordinary functions
Function, save-lyrics-to-db: Private ordinary functions
Function, search-song: Public ordinary functions
Function, setup-db: Private ordinary functions
Function, url: Private ordinary functions
Function, website-css-selector: Private ordinary functions
Function, website-name: Private ordinary functions
Function, website-p: Private ordinary functions
Function, website-separator: Private ordinary functions
Function, website-url-template: Private ordinary functions

L
lyrics: Public ordinary functions
lyrics-from-db: Private ordinary functions

M
make-website: Private ordinary functions

R
request-lyrics: Private ordinary functions

S
save-lyrics-to-db: Private ordinary functions
search-song: Public ordinary functions
setup-db: Private ordinary functions

U
url: Private ordinary functions

W
website-css-selector: Private ordinary functions
website-name: Private ordinary functions
website-p: Private ordinary functions
website-separator: Private ordinary functions
website-url-template: Private ordinary functions