FUNCTION: Word2Key - left or right key
 
CALLING SEQUENCE:
-   Word2Key(w)
-   TAB[Word2Key](w)
-  
   
PARAMETERS:
- w =  any word
 
 
SYNOPSIS:
-  The Word2Key function returns the left or the right key of a given  word.
  By default, it returns the left key.
 
 
-  When called with the optionnal parameter 'right', it returns  the  right
  key corresponding to the word w. Using 'left' as option,  is  equivalent
  to Word2Key(w).
 
 
-  The left key of  a  word  w is  the set of left columns in the orbit of:
 
                     PermOnCTab(perm, Word2CTab(w))
 
 
-  The right  key of a word w is the set of right columns  in the orbit of:
 
                     PermOnCTab(perm, Word2CTab(w))
 
 
-  When called an extra 'nil' argument, the Word2Key returns the nilplactic
  corresponding key (either left or  right). By  default, it  returns  the
  left nilplactic key. Whenever the word  is  not  a reduced decomposition,
  it returns [].
 
 
-  Whenever there is a conflict between  the  function  name  Word2Key  and
  another   name   used   in   the   same   session, use   the  long  form
  TAB['Word2Key'].
 
 
EXAMPLES:
> with(TAB):
> Word2Key(w[5,6,2,4,3,7,1]);
 
                        [[5], [5, 2], [5, 4, 2, 1]]
 
> Word2Key(w[5,6,2,4,3,7,1], 'right');
 
                         [[7, 4, 3, 1], [7, 3], [7]]
 
> Word2Key(w[3,2,1,3,2]);
 
                             [[3, 2], [3, 2, 1]]
 
> Word2Key(w[3,2,1,3,2], 'left', 'nil');
 
                             [[2, 1], [3, 2, 1]]
 
SEE ALSO: PermOnCTab PermOnTab