def _validate_item(self, item):
if not isinstance(item, six.string_types):<EOL><INDENT>raise ValidationError(<EOL>self._record,<EOL>"<STR_LIT>".format(item.__class__)<EOL>)<EOL><DEDENT>words = item.split('<STR_LIT:U+0020>')<EOL>item_length_type = self._field.field_definition.get('<STR_LIT>')<EOL>item_max_length = self._field.field_definition.get('<STR_LIT>')<EOL>item_min_length = self._field.field_definition.get('<STR_LIT>')<EOL>if item_length_type is not None:<EOL><INDENT>if item_length_type == '<STR_LIT>':<EOL><INDENT>if item_max_length is not None:<EOL><INDENT>if len(words) > item_max_length:<EOL><INDENT>raise ValidationError(<EOL>self._record,<EOL>"<STR_LIT>".format(<EOL>self._field.name,<EOL>item_max_length<EOL>)<EOL>)<EOL><DEDENT><DEDENT>if item_min_length is not None:<EOL><INDENT>if len(words) < item_min_length:<EOL><INDENT>raise ValidationError(<EOL>self._record,<EOL>"<STR_LIT>".format(<EOL>self._field.name,<EOL>item_min_length<EOL>)<EOL>)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if item_max_length is not None:<EOL><INDENT>if len(item) > item_max_length:<EOL><INDENT>raise ValidationError(<EOL>self._record,<EOL>"<STR_LIT>".format(<EOL>self._field.name,<EOL>item_max_length<EOL>)<EOL>)<EOL><DEDENT><DEDENT>if item_min_length is not None:<EOL><INDENT>if len(item) < item_min_length:<EOL><INDENT>raise ValidationError(<EOL>self._record,<EOL>"<STR_LIT>".format(<EOL>self._field.name,<EOL>item_min_length<EOL>)<EOL>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
Validate char/word count