All Projects → schmich → Spicy Proton

schmich / Spicy Proton

Licence: mit
Generate a random English adjective-noun word pair in Ruby

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Spicy Proton

Gofakeit
Random fake data generator written in go
Stars: ✭ 2,193 (+2785.53%)
Mutual labels:  random, generator
Baba Core
Mini-language for creating random text generators.
Stars: ✭ 127 (+67.11%)
Mutual labels:  random, generator
Keygen Php
A fluent PHP random key generator.
Stars: ✭ 93 (+22.37%)
Mutual labels:  random, generator
Randomix
🎲 An open source app to choose randomly between numbers, answers, options and so on.
Stars: ✭ 24 (-68.42%)
Mutual labels:  random, generator
prestashop-shop-creator
Generate random demo data to test your PrestaShop shop.
Stars: ✭ 22 (-71.05%)
Mutual labels:  generator, random
Jnanoid
A unique string ID generator for Java.
Stars: ✭ 147 (+93.42%)
Mutual labels:  random, generator
Rando Php
RandoPhp is a open source library that implements random generators (Integer, Char, Byte, Sequences, Boolean) and take random sample from arrays
Stars: ✭ 107 (+40.79%)
Mutual labels:  random, generator
random-restaurant-generator
An Android app that queries Yelp's API for a random restaurant near you
Stars: ✭ 15 (-80.26%)
Mutual labels:  fun, random
Roguesharp
A .NET Standard class library providing map generation, path-finding, and field-of-view utilities frequently used in roguelikes or 2D tile based games. Inspired by libtcod
Stars: ✭ 316 (+315.79%)
Mutual labels:  random, generator
Randomdatagenerator
This is a configurable generator to create random data like Lorum Ipsum Text, Words, Text Patterns, First/Last Names, MAC-Addresses, IP-Addresses, Guids and DateTime.
Stars: ✭ 45 (-40.79%)
Mutual labels:  random, generator
Readme Md Generator
📄 CLI that generates beautiful README.md files
Stars: ✭ 9,184 (+11984.21%)
Mutual labels:  generator
Mmarkdown
Interpret mmd fenced code blocks in a markdown file and generate a cooler version of it.
Stars: ✭ 67 (-11.84%)
Mutual labels:  generator
Jsoncsharpclassgenerator
JsonCSharpClassGenerator from http://jsonclassgenerator.codeplex.com/
Stars: ✭ 70 (-7.89%)
Mutual labels:  generator
Openapi Mock Generator
Progressive Web App for generating mocked data from an OpenAPI specification
Stars: ✭ 72 (-5.26%)
Mutual labels:  generator
Guaka
The smartest and most beautiful (POSIX compliant) Command line framework for Swift 🤖
Stars: ✭ 1,145 (+1406.58%)
Mutual labels:  generator
The forge
Our groundbreaking, lightning fast PWA CLI tool
Stars: ✭ 70 (-7.89%)
Mutual labels:  generator
Icongenerator
🍱 A macOS app to generate app icons
Stars: ✭ 1,144 (+1405.26%)
Mutual labels:  generator
Telosys Cli
Telosys v 3 CLI - Command Line Interface
Stars: ✭ 66 (-13.16%)
Mutual labels:  generator
Cameron
An avatar generator for Go.
Stars: ✭ 66 (-13.16%)
Mutual labels:  generator
Vwgen
Vulnerable Web applications Generator
Stars: ✭ 75 (-1.32%)
Mutual labels:  generator

Spicy::Proton

Generate a random English adjective-noun word pair. Works with Ruby 1.9.x and newer.

Gem Version Build Status

Quick Start

gem install spicy-proton

require 'spicy-proton'

puts Spicy::Proton.pair
# => "decadent-inquisition"

Usage

Option 1: Class methods

When generating single or infrequent specimens, class methods are faster and use less memory.

require 'spicy-proton'

Spicy::Proton.adjective             # => "extreme"
Spicy::Proton.noun                  # => "loan"
Spicy::Proton.pair                  # => "opportune-spacesuit"
Spicy::Proton.pair(':')             # => "hip:squash"
Spicy::Proton.adverb                # => "energetically"
Spicy::Proton.verb                  # => "refrained"
Spicy::Proton.format('%a/%a/%n')    # => "dapper/festive/fedora"
Spicy::Proton.format('%b %v')       # => "artfully stained"

# With length constraints.
Spicy::Proton.adjective(max: 5)     # => "dank"
Spicy::Proton.noun(min: 10)         # => "interpolation"
Spicy::Proton.adjective(length: 8)  # => "medieval"
Spicy::Proton.noun(min: 5, max: 7)  # => "dolphin"
Spicy::Proton.adverb(min: 0)        # => "prophetically"
Spicy::Proton.verb(max: 100)        # => "sparkles"

Option 2: Instance methods

When generating multiple specimens, instance methods are faster. The instance keeps the word corpus in memory. The instance methods are the same as their class method counterparts.

require 'spicy-proton'

gen = Spicy::Proton.new
1000.times do 
  gen.adjective
  gen.noun(min: 7)
  gen.pair
  gen.pair('.')
  gen.adverb(length: 6)
  gen.verb(max: 5)
  gen.format('The %a %n %b %v the %n.')
end

Instances also provide raw word lists in length order:

gen.adjectives    # => ["aft", "apt", "bad", "big", ...]
gen.nouns         # => ["ad", "ax, "ox", "pi", ...]
gen.adverbs       # => ["no", "aft", "ago", "all", ...]
gen.verbs         # => ["am", "be", "do", "go", ...]

Credits

Inspired by btford/adj-noun. Thanks to NLTK for the word corpus.

License

Copyright © 2017 Chris Schmich
MIT License. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].