class_docstr: Users can specify which scansion symbols to use in the formatting.
  
  >>> print(ScansionFormatter().hexameter( "-UU-UU-UU---UU--"))
  -UU|-UU|-UU|--|-UU|--
  >>> constants = ScansionConstants(unstressed="˘",             stressed= "¯", optional_terminal_ending="x")
  >>> formatter = ScansionFormatter(constants)
  >>> print(formatter.hexameter( "¯˘˘¯˘˘¯˘˘¯¯¯˘˘¯¯"))
  ¯˘˘|¯˘˘|¯˘˘|¯¯|¯˘˘|¯¯
class_docstr_tok: ["Users","can","specify","which","scansion","symbols","to","use","in","the","formatting",".",">",">",">","print","(","ScansionFormatter","(",")",".hexameter","(","``","-UU-UU-UU","--","-UU","--","''",")",")","-UU|-UU|-UU|","--","|-UU|","--",">",">",">","constants","=","ScansionConstants","(","unstressed=","''","\u02d8","''",",","stressed=","``","\u00af","''",",","optional_terminal_ending=","''","x","''",")",">",">",">","formatter","=","ScansionFormatter","(","constants",")",">",">",">","print","(","formatter.hexameter","(","``","\u00af\u02d8\u02d8\u00af\u02d8\u02d8\u00af\u02d8\u02d8\u00af\u00af\u00af\u02d8\u02d8\u00af\u00af","''",")",")","\u00af\u02d8\u02d8|\u00af\u02d8\u02d8|\u00af\u02d8\u02d8|\u00af\u00af|\u00af\u02d8\u02d8|\u00af\u00af"]
docstr: Format a string of hexameter metrical stress patterns into foot divisions
  
  :param line: the scansion pattern
  :return: the scansion string formatted with foot breaks
  
  >>> print(ScansionFormatter().hexameter( "-UU-UU-UU---UU--"))
  -UU|-UU|-UU|--|-UU|--
docstr_tok: ["Format","a","string","of","hexameter","metrical","stress","patterns","into","foot","divisions",":","param","line",":","the","scansion","pattern",":","return",":","the","scansion","string","formatted","with","foot","breaks",">",">",">","print","(","ScansionFormatter","(",")",".hexameter","(","``","-UU-UU-UU","--","-UU","--","''",")",")","-UU|-UU|-UU|","--","|-UU|","--"]
code: def hexameter(self, line: str) -> str:
      """
      Format a string of hexameter metrical stress patterns into foot divisions
  
      :param line: the scansion pattern
      :return: the scansion string formatted with foot breaks
  
      >>> print(ScansionFormatter().hexameter( "-UU-UU-UU---UU--"))
      -UU|-UU|-UU|--|-UU|--
      """
      mylist = list(line)
      items = len(mylist)
      idx_start = items - 2
      idx_end = items
      while idx_start > 0:
          potential_foot = "".join(mylist[idx_start:idx_end])
          if (
              potential_foot == self.constants.HEXAMETER_ENDING
              or potential_foot == self.constants.SPONDEE
          ):
              mylist.insert(idx_start, self.constants.FOOT_SEPARATOR)
              idx_start -= 1
              idx_end -= 2
          if potential_foot == self.constants.DACTYL:
              mylist.insert(idx_start, "|")
              idx_start -= 1
              idx_end -= 3
          idx_start -= 1
      return "".join(mylist)
  
imports: import logging
  from cltk.prosody.lat.scansion_constants import ScansionConstants
label_desc: Use image node_id 2 for calling the ScansionFormatter obj's underlying member method code with example usage: obj.hexameter(line) and returns: str