def number(request): """This functionality calls the get_numeric() functionality to detect numbers. It is called through api call Attributes: request: url parameters """ try: parameters_dict = get_parameters_dictionary(request) ner_logger.debug('Start: %s ' % parameters_dict[PARAMETER_ENTITY_NAME]) entity_output = get_number(parameters_dict[PARAMETER_MESSAGE], parameters_dict[PARAMETER_ENTITY_NAME], parameters_dict[PARAMETER_STRUCTURED_VALUE], parameters_dict[PARAMETER_FALLBACK_VALUE], parameters_dict[PARAMETER_BOT_MESSAGE], parameters_dict[PARAMETER_MIN_DIGITS], parameters_dict[PARAMETER_MAX_DIGITS]) ner_logger.debug( 'Finished %s : %s ' % (parameters_dict[PARAMETER_ENTITY_NAME], entity_output)) except TypeError as e: ner_logger.exception('Exception for numeric: %s ' % e) return HttpResponse(status=500) return HttpResponse(json.dumps({'data': entity_output}), content_type='application/json')
def number(request): """This functionality calls the get_numeric() functionality to detect numbers. It is called through api call Attributes: request: url parameters """ try: parameters_dict = get_parameters_dictionary(request) ner_logger.debug('Start: %s ' % parameters_dict[PARAMETER_ENTITY_NAME]) entity_output = get_number(parameters_dict[PARAMETER_MESSAGE], parameters_dict[PARAMETER_ENTITY_NAME], parameters_dict[PARAMETER_STRUCTURED_VALUE], parameters_dict[PARAMETER_FALLBACK_VALUE], parameters_dict[PARAMETER_BOT_MESSAGE]) ner_logger.debug('Finished %s : %s ' % (parameters_dict[PARAMETER_ENTITY_NAME], entity_output)) except TypeError, e: ner_logger.debug('Exception for numeric: %s ' % e) return HttpResponse(status=400)