def to_number
      return @number_in_words unless @number_in_words.is_a?(String)

      numbers_array = make_integer_array(@number_in_words)

      memory = 0
      answer = 0
      reset = true
      numbers_array.each do |number|
        if reset || !(divisible_by_thousand? number)
          reset = false
          memory += number
        else
          memory *= number
          answer += memory
          memory = 0
          reset = true
        end
      end
      answer += memory
    end
def to_number
      return @number_in_words unless @number_in_words.is_a?(String)

      numbers_array = make_integer_array(@number_in_words)

      memory = 0
      answer = 0
      reset = true
      numbers_array.each do |number|
        if reset || !(divisible_by_thousand? number)
          reset = false
          memory += number
        else
          memory *= number
          answer += memory
          memory = 0
          reset = true
        end
      end
      answer += memory
    end
It converts number represented in words to numeral.
 Example:
   "صد و بیست و یک".to_number #=> 121