A method and system for mapping a number of characters in a string,
wherein the string comprises a combination of characters representing
indexed expressions and a combination of characters representing
non-indexed expressions. One embodiment produces a weight array that can
be utilized to compare a first and second string having indexed and
non-indexed expressions. In one embodiment, a method generates a set of
special weights for characters that represent indexed and non-indexed
expressions. The method then associates a weight value of an indexed
expression with the specific group of characters representing a specific
non-indexed expression, and generates a weight array by retrieving a
plurality of special weights associated with the specific group of
characters representing the specific non-indexed expression and the
associated weight value of the indexed expression.