Giter VIP home page Giter VIP logo

spintax's People

Contributors

acelewis avatar mnmt avatar rattleycooper avatar selcuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spintax's Issues

Blank spin with leading newline

>>> import spintax
>>> set([spintax.spin("{a|b|c}") for a in range(1000)])
{'a', 'b', 'c'}
>>> set([spintax.spin("{a|\nb|\nc}") for a in range(1000)])
{'a', '\nc', '\nb'}

All good so far, then you have a leading newline:

>>> set([spintax.spin("{a\n|b\n|c}") for a in range(1000)])
{'', 'b\n', 'a\n', 'c'}

There is a blank value there?

This is on Python3.5

python setup.py failed

I already try

$ pip install spintax
Collecting spintax
Using cached https://files.pythonhosted.org/packages/4c/85/1f95b9fdd1c2c1bf07d238685b8680d17663070190b646a081855ca192ff/spintax-1.0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named setuptools

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9e8asy/spintax/

also from zipped folder

/spintax-master$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 1, in
from setuptools import setup
ImportError: No module named setuptools

I m using Python 2.7.15+

Can you help me?

Random seed is never reset

Once .spin() is called with a seed, the random generator won't be reset in subsequent calls without a seed argument.

To reproduce:

>>> import spintax
>>> spintax.spin("{foo|bar}", seed="baz")
'bar'
>>> spintax.spin("{foo|Bar}")
'foo'
>>> spintax.spin("{foo|Bar}")
'foo'
>>> spintax.spin("{foo|Bar}")
'foo'
...

Pull Request #10 should fix this.

AttributeError: module 'spintax' has no attribute 'spin'

HI,
I run this code:

import spintax
# Function to generate the super hero name
def GenerateSuperHeroName():
    SuperHeroName = spintax.spin(r"{The |}{Super|Scarlet|Commander|Hydro|Captain|Fantastic|Colossal|Nighthawk|Wild} {Mountain|Hawk|Flame|Claw|Machine|Watchman}")
    return SuperHeroName

# Only print name if it is run directly
if __name__ == "__main__":
    print(GenerateSuperHeroName())

and get this error:

AttributeError: module 'spintax' has no attribute 'spin'

Wrong result

print spintax.spin("{H|h}ell{o|O}")
ell
print spintax.spin("{H|h}ell{o|O}")
Hell
print spintax.spin("{H|h}ell{o|O}")
Hell
print spintax.spin("{H|h}ell{o|O}")
ell

add new operator

whether it is possible to make support of the operator or in square brackets
for example:
[one | two | three]
gives a random combination of all three phrases:
one three two
three two one
two three one
etc

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.