ruleLatentTempTempAbaixoDeZero :: Rule
ruleLatentTempTempAbaixoDeZero = Rule
  { name = "<latent temp> temp abaixo de zero"
  , pattern =
    [ dimension Temperature
    , regex "((graus?)|\x00b0)?( abaixo (de)? zero)"
    ]
  , prod = \tokens -> case tokens of
      (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->
        case TTemperature.unit td of
          Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $
            td {TTemperature.value = - v}
          _ -> Just . Token Temperature $ td {TTemperature.value = - v}
      _ -> Nothing
  }
ruleLatentTempTempAbaixoDeZero :: Rule
ruleLatentTempTempAbaixoDeZero = Rule
  { name = "<latent temp> temp abaixo de zero"
  , pattern =
    [ dimension Temperature
    , regex "((graus?)|\x00b0)?( abaixo (de)? zero)"
    ]
  , prod = \tokens -> case tokens of
      (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->
        case TTemperature.unit td of
          Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $
            td {TTemperature.value = - v}
          _ -> Just . Token Temperature $ td {TTemperature.value = - v}
      _ -> Nothing
  }
ruleLatentTempTempAbaixoDeZero = Rule
  { name = "<latent temp> temp abaixo de zero"
  , pattern =
    [ dimension Temperature
    , regex "((graus?)|\x00b0)?( abaixo (de)? zero)"
    ]
  , prod = \tokens -> case tokens of
      (Token Temperature td@(TemperatureData {TTemperature.value = v}):_) ->
        case TTemperature.unit td of
          Nothing -> Just . Token Temperature . withUnit TTemperature.Degree $
            td {TTemperature.value = - v}
          _ -> Just . Token Temperature $ td {TTemperature.value = - v}
      _ -> Nothing
  }