
       Token Numeral NumeralData{TNumeral.value = units}:
       _) -> double $ hundreds + units
      _ -> Nothing
  }

ruleCompositeHundredsAndTens :: Rule
ruleCompositeHundredsAndTens = Rule
  { name = "integer 100..999"
  , pattern =
    [ oneOf [100,200..900]
    , oneOf [10,20..90]
    ]
  , prod = \case
      (Token Numeral NumeralData{TNumeral.value = hundreds}:
       Token Numeral NumeralData{TNumeral.value = tens}:
       _) -> double $ hundreds + tens
      _ -> Nothing
  }

ruleDotSpelledOut :: Rule
ruleDotSpelledOut = Rule
  { name = "one point 2"
  , pattern =
    [ dimension Numeral
    , regex "წერტილი|მთელი"
    , Predicate $ not . hasGrain
    ]
  , prod = \case
      (Token Numeral nd1:_:Token Numeral nd2:_) ->
        double $ TNumeral.value nd1 + decimalsToDouble (TNumeral.value 
rulePowersOfTen :: Rule
rulePowersOfTen = Rule
  { name = "powers of tens"
  , pattern =
    [ regex "(ათასი?|მილიონი?|მილიარდი?)"
    ]
  , prod = \case
      (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of
        "ათასი" -> double 1e3 >>= withGrain 3 >>= withMultipliable
        "ათას" -> double 1e3 >>= withGrain 3 >>= withMultipliable
        "მილიონი"  -> double 1e6 >>= withGrain 6 >>= withMultipliable
        "მილიონ"  -> double 1e6 >>= withGrain 6 >>= withMultipliable
        "მილიარდი"  -> double 1e9 >>= withGrain 9 >>= withMultipliable
        "მილიარდ"  -> double 1e9 >>= withGrain 9 >>= withMultipliable
        _          -> Nothing
      _ -> Nothing
  }
rulePowersOfTen = Rule
  { name = "powers of tens"
  , pattern =
    [ regex "(ათასი?|მილიონი?|მილიარდი?)"
    ]
  , prod = \case
      (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of
        "ათასი" -> double 1e3 >>= withGrain 3 >>= withMultipliable
        "ათას" -> double 1e3 >>= withGrain 3 >>= withMultipliable
        "მილიონი"  -> double 1e6 >>= withGrain 6 >>= withMultipliable
        "მილიონ"  -> double 1e6 >>= withGrain 6 >>= withMultipliable
        "მილიარდი"  -> double 1e9 >>= withGrain 9 >>= withMultipliable
        "მილიარდ"  -> double 1e9 >>= withGrain 9 >>= withMultipliable
        _          -> Nothing
      _ -> Nothing
  }