The portmanteau Reference Manual

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

The portmanteau Reference Manual

This is the portmanteau Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 03:55:13 2022 GMT+0.

Table of Contents


1 Introduction

cl-portmanteau

cl-portmanteau is a library that makes a portmanteau of two words.

QuickLisp status

Definition

A portmanteau (from Wiki) - (/pɔːrtˈmæntoʊ/, /ˌpɔːrtmænˈtoʊ/; plural portmanteaus or portmanteaux /-ˈtoʊz/) or portmanteau word is a linguistic blend of words, in which parts of multiple words or their phones (sounds) are combined into a new word, as in smog, coined by blending smoke and fog, or motel, from motor and hotel. In linguistics, a portmanteau is defined as a single morph that represents two or more morphemes.

Installation and usage

CL-USER(1): (asdf:load-system 'portmanteau)

T
CL-USER(2): (portmanteau:portmanteau "mock" "documentary")

"mocumentary"
CL-USER(3):

CLI

To run cl-portmanteau in CLI mode you will need Roswell installed:

cl-portmanteau $ ros ./run.ros mock documentary
mocumentary

Tests

CL-USER(1): (asdf:load-system 'portmanteau)

T
CL-USER(2): (asdf:load-system 'portmanteau-tests)

T
CL-USER(3): (portmanteau-tests:all-tests)

Running test suite MAIN-SUITE
 Running test TOO-SHORT-TEST  <ERROR> [13:20:37] portmanteau - Both words must be longer than 3
.
 Running test MATCHING-TOO-CLOSE-TO-BEGINNING-TEST .
 Running test MATCHING-TOO-CLOSE-TO-END-TEST .
 Running test NOT-MATCHING-TEST .
 Running test MERGER-TEST ....
 Did 8 checks.
    Pass: 8 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

T
NIL
CL-USER(4):

or via Roswell:

cl-portmanteau $ ros ./run-tests.ros

Running test suite MAIN-SUITE
 Running test TOO-SHORT-TEST .
 Running test MATCHING-TOO-CLOSE-TO-BEGINNING-TEST .
 Running test MATCHING-TOO-CLOSE-TO-END-TEST .
 Running test NOT-MATCHING-TEST .
 Running test MERGER-TEST ....
 Did 8 checks.
    Pass: 8 (100%)
    Skip: 0 ( 0%)
    Fail: 0 ( 0%)

cl-portm

2 Systems

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


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

2.1 portmanteau

cl-portmanteau

Author

Sergey Polzunov <sergey@polzunov.com>

License

OSI approved 3-clause ’New BSD License’

Dependency

vom (system).

Source

portmanteau.asd.

Child Component

portmanteau.lisp (file).


3 Files

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


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

3.1 Lisp


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

3.1.1 portmanteau/portmanteau.asd

Source

portmanteau.asd.

Parent Component

portmanteau (system).

ASDF Systems

portmanteau.


3.1.2 portmanteau/portmanteau.lisp

Source

portmanteau.asd.

Parent Component

portmanteau (system).

Packages

portmanteau.

Public Interface

portmanteau (function).

Internals

4 Packages

Packages are listed by definition order.


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

4.1 portmanteau

Source

portmanteau.lisp.

Use List

common-lisp.

Public Interface

portmanteau (function).

Internals

5 Definitions

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


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

5.1 Public Interface


5.1.1 Ordinary functions

Function: portmanteau (word-a word-b &key max-win-size)

Calculate portmanteau of 2 input words

Package

portmanteau.

Source

portmanteau.lisp.


5.2 Internals


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

5.2.1 Special variables

Special Variable: *margin*
Package

portmanteau.

Source

portmanteau.lisp.

Special Variable: *min-word-size*
Package

portmanteau.

Source

portmanteau.lisp.


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

5.2.2 Ordinary functions

Function: calculate-max-window-size (word-a word-b)

Calulate max matching window size from the size
of input words by dividing length of the longest word by 3. The result must not be less than 3

Package

portmanteau.

Source

portmanteau.lisp.

Function: contains-vowel (word)
Package

portmanteau.

Source

portmanteau.lisp.

Function: filter-out-without-vowels (seq)
Package

portmanteau.

Source

portmanteau.lisp.

Function: find-matches (seq-a seq-b word-b-size)
Package

portmanteau.

Source

portmanteau.lisp.

Function: is-far-enough-from-end (idx elem word-len)

Check if the beginning of an element is placed no closer than *margin* from the end of the string

Package

portmanteau.

Source

portmanteau.lisp.

Function: is-far-enough-from-start (idx elem)

Check if the end of an element is placed no closer than *margin* from the beginning of the string

Package

portmanteau.

Source

portmanteau.lisp.

Function: is-long-enough (word &key size)
Package

portmanteau.

Source

portmanteau.lisp.

Function: merge-words (word-a index-a word-b index-b)
Package

portmanteau.

Source

portmanteau.lisp.

Function: run-moving-window (word size)
Package

portmanteau.

Source

portmanteau.lisp.

Function: valid-result (result word-a word-b)

Validate result word.
Criteria:
- result must not be smaller than one of the input words

Package

portmanteau.

Source

portmanteau.lisp.


Appendix A Indexes


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

A.1 Concepts