Skip to content

zanethorn/loremipsum

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

You may import the Generator class to instantiate your generator with your own sample text and a dictionary:

>>> from loremipsum import Generator >>> >>> sample = file('data/sample.txt').read() >>> dictionary = file('data/dictionary.txt').read().split() >>> >>> g = Generator(sample, dictionary) >>> g.generate_sentence() #doctest: +ELLIPSIS (...) >>>

or just import get_sentences or get_paragraphs which interface to a module wide Generator instance.

>>> from loremipsum import get_paragraphs, get_sentences >>> >>> get_sentences(5) #doctest: +ELLIPSIS ['...', '...', '...', '...', '...'] >>> get_paragraphs(3) #doctest: +ELLIPSIS ['...', '...', '...']

Releases

No releases published

Packages

No packages published