Skip to main content

This is a random word generator module

Project description

Random Word Generator

License: MIT PyPI Open Source? Yes! Python3 made-with-python install code quality Code Score

   logo

How to install this library?

pip3 install Random-Word-Generator

OR

pip install Random-Word-Generator

Which other python packages are needed to be installed?

  • No need of any external packages
  • Only Python version >= 3 is required

What this library does?

It helps us to generate random words i.e random noise in text data which is helpful in many text augmentation based tasks, NER, etc.

Which methods are available currently in this library?

Method Args Description
.generate() None This will return a randomly generated word
.getList(num_of_words) num_of_words This will return list of random words

Setting to look out before generating random words

Basic

from RandomWordGenerator import RandomWord

# Creating a random word object
rw = RandomWord(max_word_size,
                constant_word_size=True,
                include_digits=False,
                special_chars=r"@_!#$%^&*()<>?/\|}{~:",
                include_special_chars=False)
Args Data Type Default Description
max_word_size int 10 Represents maximum length of randomly generated word
constant_word_size bool True Represents word length of
randomly generated word
include_digits bool False Represents whether or not to include digits in generated words
special_chars regex/string r"@_!#$%^&*()<>?/\\
|}{~:"
Represents a regex string of all specials character you want to include in generated words
include_special_chars bool False Represents inclusion of special characters in generated words

How to get started with this library?

  1. Simple random word generation with constant word size

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5)
    
    print(rw.generate())
    
    Output will be some random word like
    > hdsjq
    
  2. Simple random word generation with variable word size

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=False)
    
    print(rw.generate())
    
    Output will be some random word like
    > gw
    
  3. Random word generation with constant word size and including special character included

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=True,
                    special_chars=r"@#$%.*",
                    include_special_chars=True)
    
    print(rw.generate())
    
    Output will be some random word like
    > gsd$
    
  4. If we want randomly generated words in list we just have to input the argument with number of words we want

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=False)
    
    print(rw.getList(num_of_random_words=3))
    
    Output will be some random word like
    > ['adjse', 'qytqw', ' klsdf', 'ywete', 'klljs']
    
    

Application

  • In cases where we need to add random noise in text
  • Name Entity Relation extraction based tasks
  • Text Data Augmentation based tasks

Author

I will be happy to connect with you guys!!

Linkedin

Twitter

Any suggestions are most welcome.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Random-Word-Generator-1.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

Random_Word_Generator-1.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file Random-Word-Generator-1.3.tar.gz.

File metadata

  • Download URL: Random-Word-Generator-1.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for Random-Word-Generator-1.3.tar.gz
Algorithm Hash digest
SHA256 c8de42f54ca0a096fe735c0ab8ed47e0db9ac1bcdbe20ac4aa285610e3792674
MD5 48ca519208fd8af3e63088e192cf0ad0
BLAKE2b-256 8b60088c690d74a401525e12c122c6f55657d4fab3d5a979c5dd3c740d8d2f17

See more details on using hashes here.

File details

Details for the file Random_Word_Generator-1.3-py3-none-any.whl.

File metadata

  • Download URL: Random_Word_Generator-1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.7

File hashes

Hashes for Random_Word_Generator-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3db2eee1f9681805455b5b25a1160be65b3466068ac55a26b2a76a118f7fc42d
MD5 c7498fb0adf07d45566d9b01111f5c39
BLAKE2b-256 a0d105105007461548a5f23fc5426fef12a5acdee2e8b9047609139190151826

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page