Coder Social home page Coder Social logo

commandlord / gerneratore Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 5 KB

A small Library, in Python3, to make a Generator really easy and fast.

Home Page: https://commandlord.github.io/GerneratOre/

Python 100.00%
generator python3 python python-3 generate string-generator string strings array-input

gerneratore's Introduction

GerneratOre

This is a generator to create strings. To generate a string put the configuration array into the generate function.


genreate(config)
> generated String

The configuration array is were you build the actual generator. It is like a own little programming language.

The structure of the configure array:

conf = [ words, structure ]

The structure of the words array contains all collections of words:

words = [ collection_1, collection_2, ... , collection_n ]

A collection array contains a list of words of the same type and category. For better overall view and future features, provide a short description.

collection = [ description, word_1, word_2, ... , word_n ]

The structure array is the core of GeneratOre. Here is the "code" to generate the string out of the words. But there is not only one structure array, there can be multiple ones, inside each other. The first place of every structure is the probability of it, we come to that later.

structure = [ probability, event_1, event_2,..., event_n]

There are two different types of events.

  1. Select a random word from a word collection. This works by writing the position of the collection inside words. If you type -1 nothing will happen, this will be useful for the other option.

  2. Decide between multiple structures. This works with an array of structures. One of them will be randomly selected based on the probability. The greater the value of it in comparison, the greater the chance.

structure = [ 1(probability), 5(collection), 6(collection), [ 
                                                            [2(probability), 8(collection), 7(collection)], 
                                                            [5(probability), 7(collection)], 
                                                            [2(probability),-1(nothing)] 
                                                            ](decision)
                                                            , 5(collection) ]

gerneratore's People

Contributors

commandlord avatar

Watchers

 avatar

Forkers

coder-hangout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.