import re


def GuessDataType(value, column_id=None):
  """Guess the DSPL data type of a string value.

  Defaults to 'string' if value is not an obvious integer, float, or date.
  Also, does not try to detect boolean values, which are unlikely to be used
  in DSPL tables.

  Args:
    value: A string to be evaluated.
    column_id: (Optional) Name of the column containing data; used to resolve
               ambiguities, e.g. between years and integers.

  Returns:
    One of {'date', 'integer', 'float', 'string'}
  """
  stripped_value = value.strip().replace('"', '')

  if re.search('^-?[0-9]+$', stripped_value):
    if column_id == 'year':
      return 'date'
    else:
      return 'integer'
  elif re.search('^-?[0-9]+\.[0-9]+$', stripped_value):
    return 'float'
  elif re.search('^[0-9]+(/|-)[0-9]+((/|-)[0-9]+){0,1}$', stripped_value):
    return 'date'
  else:
    return 'string'