[Fun] Lorem Ipsum generator

Discuss and share scripts and script files...
Stef123

Re: [Fun] Lorem Ipsum generator

Post by Stef123 » 10 Jun 2015 11:37

You know what would be the icing on the cake? To optionally get the paragraphs wrapped in html paragraph tags :ugeek:
Maybe by throwing in the letter "t", or with a checkbox, or any other way.

highend
Posts: 9065
Joined: 06 Feb 2011 00:33

Re: [Fun] Lorem Ipsum generator

Post by highend » 10 Jun 2015 12:55

Now you can wrap paragraphs in <p></p> tags...

Input examples:
10 = 10 paragraphs, between 5 and 35 sentences each (random - default values)
10,5 = 10 paragraphs, 5 sentences each
10,1-10 = 10 paragraphs, between 1 and 10 sentences each (random)
10,5-20,w = 10 paragraphs, between 5 and 20 sentences each (random), wrapped in tags
LoremIpsumGenerator_v2_by_Highend.zip
(1.93 KiB) Downloaded 67 times
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: [Fun] Lorem Ipsum generator

Post by SammaySarkar » 10 Jun 2015 13:02

Thank you all for your interest in this
.                     (lazy day today?  :kidding: )




btw, I've converted the original script to a UDF. See first post. It can now also read a file for the words.

One of the example generates paragraphs.
Alter `ceil($maxWordsCount*80/100)` this bit in that example for more random paragraph lengths
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: [Fun] Lorem Ipsum generator

Post by SkyFrontier » 10 Jun 2015 14:01

Thanks for the variations, guyz!

I was just moving towards the full randomization... luckily I've checked the forums first, today! :biggrin:
Have a nice day, all!

-yesterday I noticed how hard it is to find large bits of sample text across the net, with zero patience to look after txt e-books which could fit (or not!) my demand...
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Stef123

Re: [Fun] Lorem Ipsum generator

Post by Stef123 » 10 Jun 2015 14:47

Brilliant. :tup: Many thanks highend
And thanks to Sammay for getting this started.
@SkyFrontier - try the attached philosophy generator.
Attachments
Philosophy_Oracle.zip
(3.55 KiB) Downloaded 65 times

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: [Fun] Lorem Ipsum generator

Post by SkyFrontier » 10 Jun 2015 17:06

Haha, thank you, Stef!
A most productive approach on ipsumnation... :P
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: [Fun] Lorem Ipsum generator

Post by Irwin of Upton » 11 Jun 2015 17:19

"It can now also read a file for the words."

How to do this?

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: [Fun] Lorem Ipsum generator

Post by SammaySarkar » 11 Jun 2015 17:27

Suppose the lipsumgen function is saved in <xyscripts>\inc\lipsumgen.xyi and you have a space-separated wordlist saved as <xydata>\wordlist.txt
Then here's an example that will create a 500-word text from that file.

Code: Select all

INCLUDE "inc\LipsumGen.xyi";

"lipsumFileTest"
  text LipsumGen(500, "<xydata>\wordlist.txt");
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: [Fun] Lorem Ipsum generator

Post by Irwin of Upton » 12 Jun 2015 15:35

Will put together the first "wordlist" and try it out. Looks promising!

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: [Fun] Lorem Ipsum generator

Post by SammaySarkar » 12 Jun 2015 15:37

remember words should be separated by space.
Forget that, I just added a separator variable. You can create a |-separated wordlist and do this now: ::text lipsumgen(40, "wordlist.txt", "|");
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply