nlcalc package

class nlcalc.NLCalculator[source]

Bases: object

Natural Language Mathematical Calculator.

This class can be used to parse mathematical statements in natural language.


Calculate the output after parsing input.

Parameters:text (str) – A string value which should be parsed
Returns:The final result
Return type:int or float
Raises:ValueError – If the text cannot be succesfully parsed and evaluated to get a result.

Whether strict mode is enabled for the calculator instance.