-
protected, static _nChs(setName, begin, end)
-
Add char sets of a language
Parameters:
Name |
Type |
Description |
setName |
String
|
CharSet name, for example: hiragana, kanji, Arabic suppliment |
begin |
Number
|
integer value: begining of the charSet |
end |
Number
|
integer value: end of the charSet |
-
protected, static _nTrans(transName, opts)
-
Creates a new transformation method
Parameters:
Name |
Type |
Description |
transName |
String
|
transformation name (function name), for example: hiragana2Katakana |
opts |
Array.<Object>
|
Array of options |
Example
{//If the charset exists and we use all of it
setName: "<name of the charset",
offset: <number>
},
{//otherwise
begin: <number>,
end: <number>,
offset: <number>
}
-
-
Verify if all text's characters belong to the current charSet
Parameters:
Name |
Type |
Description |
text |
String
|
the text to verify |
Returns:
Boolean
- the text contains some chars of the current charset or not
-
static contains(text) → {Boolean}
-
Verify if all text's characters belong to the current charSet
Parameters:
Name |
Type |
Description |
text |
String
|
the text to verify |
Returns:
Boolean
- the text contains some chars of the current charset or not
-
static gcharverify(charSet) → {object}
-
Get an object with verification functions
contains: returns a function which verifies if the text contains
at least one of the charsets
all : returns a function which verifies if all the chacaters of the text
are in this charset
Parameters:
Name |
Type |
Description |
charSet |
String
|
the name of the charset |
Returns:
object
- object with verifying functions
-
static getCharSetFunctions(charSet) → {object}
-
Get an object with verification functions
contains: returns a function which verifies if the text contains
at least one of the charsets
all : returns a function which verifies if all the chacaters of the text
are in this charset
Parameters:
Name |
Type |
Description |
charSet |
String
|
the name of the charset |
Returns:
object
- object with verifying functions
-
static getTransDesc(transName) → {Text}
-
Get the description of the transformation function
Parameters:
Name |
Type |
Description |
transName |
String
|
name of the transformation function |
Returns:
Text
- description
-
-
Get the the transformation function
Parameters:
Name |
Type |
Description |
transName |
String
|
name of the transformation function |
Returns:
function
- a function which transforms a given text
-
static gtrans(transName) → {function}
-
Get the the transformation function
Parameters:
Name |
Type |
Description |
transName |
String
|
name of the transformation function |
Returns:
function
- a function which transforms a given text
-
static gtransdesc(transName) → {Text}
-
Get the description of the transformation function
Parameters:
Name |
Type |
Description |
transName |
String
|
name of the transformation function |
Returns:
Text
- description
-
static lchars() → {Array.<String>}
-
Returns the available charsets for the current language
Returns:
Array.<String>
- a set of strings containing the names of charsets
-
static listCharSets() → {Array.<String>}
-
Returns the available charsets for the current language
Returns:
Array.<String>
- a set of strings containing the names of charsets
-
-
Returns the available transformations for the current language
(Static version)
Returns:
Array.<String>
- a set of strings containing the names of transformation functions
-
static ltrans() → {Array.<String>}
-
Returns the available transformations for the current language
(Static version)
Returns:
Array.<String>
- a set of strings containing the names of transformation functions
-
abstract, static nbr2str(num) → {String}
-
A function which returns the pronounciation of a number in the destination
language (this must be overriden)
Parameters:
Name |
Type |
Description |
num |
Number
|
A number to be transformed into letters |
Returns:
String
- the pronounciation
-
-
Sets the current charset we are using for functions
Parameters:
Name |
Type |
Description |
charSet |
String
|
the name of the charset |
-
-
Sets the current transformations for the current object
Parameters:
Name |
Type |
Description |
transName |
String
|
the name of transformation method |
-
-
Transforms a text from a charset to another
Parameters:
Name |
Type |
Description |
text |
String
|
text to be transformed |
Returns:
Text
- transformed text