https://github.com/mmower/wordmash
Mash words together to create new words
https://github.com/mmower/wordmash
Last synced: about 2 months ago
JSON representation
Mash words together to create new words
- Host: GitHub
- URL: https://github.com/mmower/wordmash
- Owner: mmower
- License: epl-1.0
- Created: 2014-09-25T21:56:19.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-26T13:29:26.000Z (over 10 years ago)
- Last Synced: 2025-02-07T14:45:40.226Z (3 months ago)
- Language: Clojure
- Size: 145 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wordmash
If you've ever wanted to create a nonsense English dictionary then Wordmash is for you. Wordmash "mashes together" words from a dictionary to form new words that are somewhat like the originals.
To create a new word, Wordmash takes two randomly selected words from the original dictionary, selects a random mid-point for each word, and
splits them to form two beginnings and two endings. It then takes the first beginning and second ending and makes a new word. Here's an example:1. Randomly choosen words "unbalance" and "guayacan"
* For "unbalance" select random mid-point, e.g. 3
* Split "unbalance" at 3 to form "unb" and "alance"
* For "guayacan" select random mid-point, e.g. 4
* Split "guayacan" at 4 to form "guay" and "acan"
* Combine "unb" with "acan" to form new word "unbacan"Wordmash includes some simple rules that try to ensure generated words seem English-like for example not allowing endings like i, u, v, or j, or allowing words with a q not followed by a u. The default rules are defined in `resources/rules.edn`.
## Usage
lein uberjar
cat /usr/share/dict/words | java -jar target/wordmash-0.1.3-SNAPSHOT-standalone.jar []Pass in the dictionary of words you want to use as a source via stdin, the mashed dictionary will be written to stdout. By default 500
words are generated but you can pass a word-count argument to generate more or less words.To use a custom rules files pass the path to your own edn file using the `RULESFILE` environment variable:
RULESFILE=/my/rules.edn java -jar ...
Rules are regular expression patterns, see the resources/rules.edn file for the format. The map keys are purely for describing the rules.
## License
Copyright © 2014 Matt Mower
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.