Class SpazShortText

Defined in: spazshorttext.js.

Class Summary
Constructor Attributes Constructor Name and Description
 

A library to shorten text

Method Summary
Method Attributes Method Name and Description
 
addMap(search, replase, israw)

this adds a new mapping to the basemaps and processes the base maps into regexes again

 

internal function to generate the default long -> short maps

 

returns the map

 

This processes the base maps into the this.map object of regexes and replacements

 
shorten(text)

shortens the given text according to the map

Class Detail

SpazShortText()

A library to shorten text

Method Detail

addMap(search, replase, israw)

this adds a new mapping to the basemaps and processes the base maps into regexes again

Parameters:
{string} search
{string} replase
{boolean} israw
is true, this mapping won't be altered at all when processed into a regex

genBaseMaps()

internal function to generate the default long -> short maps

{object} getMaps()

returns the map

Returns:
{object}

processBaseMaps()

This processes the base maps into the this.map object of regexes and replacements

{string} shorten(text)

shortens the given text according to the map

Parameters:
{string} text
Returns:
{string}