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: Merge a line of verse with its scansion string. Do not accent dipthongs.
  
  :param line: the original Latin verse line
  :param scansion: the scansion pattern
  :return: the original line with the scansion pattern applied via macrons
  
  >>> print(ScansionFormatter().merge_line_scansion(
  ... "Arma virumque cano, Troiae qui prīmus ab ōrīs",
  ... "-  U  U -  U  U  -     UU-   -   - U  U  - -"))
  Ārma virūmque canō, Troiae quī prīmus ab ōrīs
  
  >>> print(ScansionFormatter().merge_line_scansion(
  ... "lītora, multum ille et terrīs iactātus et alto",
  ... " - U U   -     -    -   -  -   -  - U  U  -  U"))
  lītora, mūltum īlle ēt tērrīs iāctātus et ālto
  
  >>> print(ScansionFormatter().merge_line_scansion(
  ... 'aut facere, haec a te dictaque factaque sunt',
  ... ' -   U U      -  -  -  -  U  U  -  U  U  -  '))
  aut facere, haec ā tē dīctaque fāctaque sūnt
docstr_tok: ["Merge","a","line","of","verse","with","its","scansion","string",".","Do","not","accent","dipthongs",".",":","param","line",":","the","original","Latin","verse","line",":","param","scansion",":","the","scansion","pattern",":","return",":","the","original","line","with","the","scansion","pattern","applied","via","macrons",">",">",">","print","(","ScansionFormatter","(",")",".merge_line_scansion","(","...","``","Arma","virumque","cano",",","Troiae","qui","pr\u012bmus","ab","\u014dr\u012bs","''",",","...","``","-","U","U","-","U","U","-","UU-","-","-","U","U","-","-","''",")",")","\u0100rma","vir\u016bmque","can\u014d",",","Troiae","qu\u012b","pr\u012bmus","ab","\u014dr\u012bs",">",">",">","print","(","ScansionFormatter","(",")",".merge_line_scansion","(","...","``","l\u012btora",",","multum","ille","et","terr\u012bs","iact\u0101tus","et","alto","''",",","...","``","-","U","U","-","-","-","-","-","-","-","U","U","-","U","''",")",")","l\u012btora",",","m\u016bltum","\u012blle","\u0113t","t\u0113rr\u012bs","i\u0101ct\u0101tus","et","\u0101lto",">",">",">","print","(","ScansionFormatter","(",")",".merge_line_scansion","(","...","'aut","facere",",","haec","a","te","dictaque","factaque","sunt","'",",","...","'","-","U","U","-","-","-","-","U","U","-","U","U","-","'",")",")","aut","facere",",","haec","\u0101","t\u0113","d\u012bctaque","f\u0101ctaque","s\u016bnt"]
code: def merge_line_scansion(self, line: str, scansion: str) -> str:
      """
      Merge a line of verse with its scansion string. Do not accent dipthongs.
  
      :param line: the original Latin verse line
      :param scansion: the scansion pattern
      :return: the original line with the scansion pattern applied via macrons
  
      >>> print(ScansionFormatter().merge_line_scansion(
      ... "Arma virumque cano, Troiae qui prīmus ab ōrīs",
      ... "-  U  U -  U  U  -     UU-   -   - U  U  - -"))
      Ārma virūmque canō, Troiae quī prīmus ab ōrīs
  
      >>> print(ScansionFormatter().merge_line_scansion(
      ... "lītora, multum ille et terrīs iactātus et alto",
      ... " - U U   -     -    -   -  -   -  - U  U  -  U"))
      lītora, mūltum īlle ēt tērrīs iāctātus et ālto
  
      >>> print(ScansionFormatter().merge_line_scansion(
      ... 'aut facere, haec a te dictaque factaque sunt',
      ... ' -   U U      -  -  -  -  U  U  -  U  U  -  '))
      aut facere, haec ā tē dīctaque fāctaque sūnt
      """
      letters = list(line)
      marks = list(scansion)
      if len(scansion) < len(line):
          marks += ((len(line) - len(scansion)) * " ").split()
      for idx in range(0, len(marks)):
          if marks[idx] == self.constants.STRESSED:
              vowel = letters[idx]
              if vowel not in self.stress_accent_dict:
                  LOG.error(
                      "problem! vowel: {} not in dict for line {}".format(
                          vowel, line
                      )
                  )
                  pass
              else:
                  if idx > 1:
                      if (
                          letters[idx - 2] + letters[idx - 1]
                      ).lower() == "qu":
                          new_vowel = self.stress_accent_dict[vowel]
                          letters[idx] = new_vowel
                          continue
                  if idx > 0:
                      if (
                          letters[idx - 1] + vowel
                          in self.constants.DIPTHONGS
                      ):
                          continue
                      new_vowel = self.stress_accent_dict[vowel]
                      letters[idx] = new_vowel
                  else:
                      new_vowel = self.stress_accent_dict[vowel]
                      letters[idx] = new_vowel
      return "".join(letters).rstrip()
  
imports: import logging
  from cltk.prosody.lat.scansion_constants import ScansionConstants
label_desc: Use image node_id 3 for calling the ScansionFormatter obj's underlying member method code with example usage: obj.merge_line_scansion(line, scansion) and returns: str