Suppose an algebraic torus acts on a polynomial ring compatibly with the grading. If each variable is a weight vector, then each monomial is also a weight vector. Use this method to obtain the weight of a monomial.
The object getWeights is a method function.