def text_to_data(self, text, elt, ps):
if text is None:<EOL><INDENT>return None<EOL><DEDENT>m = Duration.lex_pattern.match(text)<EOL>if m is None:<EOL><INDENT>raise EvaluateException('<STR_LIT>', ps.Backtrace(elt))<EOL><DEDENT>d = m.groupdict()<EOL>if d['<STR_LIT:T>'] and (d['<STR_LIT:h>'] is None and d['<STR_LIT:m>'] is None and d['<STR_LIT:s>'] is None):<EOL><INDENT>raise EvaluateException('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>retval = _dict_to_tuple(d)<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise EvaluateException(str(e))<EOL><DEDENT>if self.pyclass is not None:<EOL><INDENT>return self.pyclass(retval)<EOL><DEDENT>return retval<EOL>
convert text into typecode specific data.