class_docstr: Class for reading and processing standard format marker files and strings.
class_docstr_tok: ["Class","for","reading","and","processing","standard","format","marker","files","and","strings","."]
docstr: Return an iterator that returns the next field in a ``(marker, value)``
  tuple, where ``marker`` and ``value`` are unicode strings if an ``encoding``
  was specified in the ``fields()`` method. Otherwise they are non-unicode strings.
  
  :param strip: strip trailing whitespace from the last line of each field
  :type strip: bool
  :param unwrap: Convert newlines in a field to spaces.
  :type unwrap: bool
  :param encoding: Name of an encoding to use. If it is specified then
      the ``fields()`` method returns unicode strings rather than non
      unicode strings.
  :type encoding: str or None
  :param errors: Error handling scheme for codec. Same as the ``decode()``
      builtin string method.
  :type errors: str
  :param unicode_fields: Set of marker names whose values are UTF-8 encoded.
      Ignored if encoding is None. If the whole file is UTF-8 encoded set
      ``encoding='utf8'`` and leave ``unicode_fields`` with its default
      value of None.
  :type unicode_fields: sequence
  :rtype: iter(tuple(str, str))
docstr_tok: ["Return","an","iterator","that","returns","the","next","field","in","a","``","(","marker",",","value",")","``","tuple",",","where","``","marker","``","and","``","value","``","are","unicode","strings","if","an","``","encoding","``","was","specified","in","the","``","fields","(",")","``","method",".","Otherwise","they","are","non-unicode","strings",".",":","param","strip",":","strip","trailing","whitespace","from","the","last","line","of","each","field",":","type","strip",":","bool",":","param","unwrap",":","Convert","newlines","in","a","field","to","spaces",".",":","type","unwrap",":","bool",":","param","encoding",":","Name","of","an","encoding","to","use",".","If","it","is","specified","then","the","``","fields","(",")","``","method","returns","unicode","strings","rather","than","non","unicode","strings",".",":","type","encoding",":","str","or","None",":","param","errors",":","Error","handling","scheme","for","codec",".","Same","as","the","``","decode","(",")","``","builtin","string","method",".",":","type","errors",":","str",":","param","unicode_fields",":","Set","of","marker","names","whose","values","are","UTF-8","encoded",".","Ignored","if","encoding","is","None",".","If","the","whole","file","is","UTF-8","encoded","set","``","encoding='utf8","'","``","and","leave","``","unicode_fields","``","with","its","default","value","of","None",".",":","type","unicode_fields",":","sequence",":","rtype",":","iter","(","tuple","(","str",",","str",")",")"]
code: def fields(
      self,
      strip=True,
      unwrap=True,
      encoding=None,
      errors="strict",
      unicode_fields=None,
  ):
      """
      Return an iterator that returns the next field in a ``(marker, value)``
      tuple, where ``marker`` and ``value`` are unicode strings if an ``encoding``
      was specified in the ``fields()`` method. Otherwise they are non-unicode strings.
  
      :param strip: strip trailing whitespace from the last line of each field
      :type strip: bool
      :param unwrap: Convert newlines in a field to spaces.
      :type unwrap: bool
      :param encoding: Name of an encoding to use. If it is specified then
          the ``fields()`` method returns unicode strings rather than non
          unicode strings.
      :type encoding: str or None
      :param errors: Error handling scheme for codec. Same as the ``decode()``
          builtin string method.
      :type errors: str
      :param unicode_fields: Set of marker names whose values are UTF-8 encoded.
          Ignored if encoding is None. If the whole file is UTF-8 encoded set
          ``encoding='utf8'`` and leave ``unicode_fields`` with its default
          value of None.
      :type unicode_fields: sequence
      :rtype: iter(tuple(str, str))
      """
      if encoding is None and unicode_fields is not None:
          raise ValueError("unicode_fields is set but not encoding.")
      unwrap_pat = re.compile(r"\n+")
      for mkr, val in self.raw_fields():
          if unwrap:
              val = unwrap_pat.sub(" ", val)
          if strip:
              val = val.rstrip()
          yield (mkr, val)
  
imports: import codecs
  import re
  from io import StringIO
  from xml.etree.ElementTree import Element, ElementTree, SubElement, TreeBuilder
  from nltk.data import PathPointer, find
label_desc: Use image node_id 5 for calling the StandardFormat obj's underlying member method code with example usage: obj.fields(strip, unwrap, encoding, errors, unicode_fields) without return types