public function calculate($term)
    {
        $tokens = $this->tokenize($term);
        if (sizeof($tokens) == 0) {
            return 0;
        }

        $rootNode = $this->parse($tokens);
        if ($rootNode->isEmpty()) {
            return 0;
        }

        $calculator = $this->container->get('stringcalc_calculator');

        $result = $calculator->calculate($rootNode);

        return $result;
    }