sort lexical weights for before comparison. Different perl version output lexical weights in different order