loremipsum.js
No description.

File Location

arty/closure/goog/loremipsum/text/loremipsum.js

Classes

goog.text.LoremIpsum
Generates random strings of "lorem ipsum" text, based on the word distribution of a sample text, using the words in a dictionary.

Public Protected Private

Global Functions

goog.text.LoremIpsum.arrayLength_(array) number
Returns the length of an array. Written as a function so it can be used as a function parameter.
Arguments:
array : Array
The array to check.
Returns: number  The length of the array.
code »
goog.text.LoremIpsum.chooseClosest(valuestarget) number
Find the number in the list of values that is closest to the target.
Arguments:
values : Array.<number>
The values.
target : number
The target value.
Returns: number  The closest value.
code »
goog.text.LoremIpsum.getWordInfo_(word) Array
Gets info about a word used as part of the lorem ipsum algorithm.
Arguments:
word : string
The word to check.
Returns: Array  A two element array. The first element is the size of the word. The second element is the delimter used in the word.
code »
goog.text.LoremIpsum.isNotEmptyOrWhitepace_(text) boolean
Returns the text is not empty or just whitespace.
Arguments:
text : string
The text to check.
Returns: boolean  Whether the text is nether empty nor whitespace.
code »
goog.text.LoremIpsum.randomChoice_(array) *
Picks a random element of the array.
Arguments:
array : Array
The array to pick from.
Returns: *  An element from the array.
code »
goog.text.LoremIpsum.randomNormal_(musigma)
Generates a random number for a normal distribution with the specified mean and sigma.
Arguments:
mu : number
The mean of the distribution.
sigma : number
The sigma of the distribution.
code »
goog.text.LoremIpsum.splitParagraphs_(text) Array.<string>
Splits a piece of text into paragraphs.
Arguments:
text : string
The text to split.
Returns: Array.<string>  An array of paragraphs.
code »
goog.text.LoremIpsum.splitSentences_(text) Array.<string>
Splits a piece of text into sentences.
Arguments:
text : string
The text to split.
Returns: Array.<string>  An array of sentences.
code »
goog.text.LoremIpsum.splitWords_(text) Array.<string>
Splits a piece of text into words..
Arguments:
text : string
The text to split.
Returns: Array.<string>  An array of words.
code »

Directory text

File Reference