FUNCTION: Word2Charge - returns the charge of a word
CALLING SEQUENCE:
- Word2Charge(w)
- TAB[Word2Charge](w)
-
PARAMETERS:
- w = any word
SYNOPSIS:
- The Word2Charge function computes the charge of the word w.
- When called with the second argument 'vector', it returns the charge
vector, the sum of the components of this vector being the charge.
This option is defined only when the word contains at least as many 1's
as 2's, as many 2's as 3's and so on.
- Whenever there is a conflict between the function name Word2Charge and
another name used in the same session, use the long form
TAB['Word2Charge'].
EXAMPLES:
> with(TAB):
> Word2Charge(w[2,3,1,1,2,3,4], 'vector');
[0, 1, 0, 0, 1, 1, 2]
> Word2Charge(w[2,3,1,1,2,3,4]);
5
SEE ALSO: Word2CoCharge