Each alignment contributes some information to the error report.  These reports for each alignment need to be gone through and combined into one report.


    :returns: Dictionary containing the error counts on context base
    :rtype: dict()

def combine_context_errors(self):
    """Each alignment contributes some information to the error report.  These reports for each alignment need to be gone through and combined into one report.


    :returns: Dictionary containing the error counts on context base
    :rtype: dict()

    """
    r = {}
    if self._target_context_errors: r = self._target_context_errors
    for k in [x.get_context_target_errors() for x in self._alignment_errors]:
      for b in k:
        if b not in r: r[b] = {}
        for c in k[b]:
          if c not in r[b]: r[b][c] = {}
          for a in k[b][c]:
            if a not in r[b][c]: 
              r[b][c][a] = {}
              r[b][c][a]['total'] = 0
              r[b][c][a]['types'] = {}
            r[b][c][a]['total'] += k[b][c][a]['total']
            for type in k[b][c][a]['types']:
              if type not in r[b][c][a]['types']: r[b][c][a]['types'][type] = 0
              r[b][c][a]['types'][type] += k[b][c][a]['types'][type]
    self._target_context_errors = r
    r = {}
    if self._query_context_errors: r = self._query_context_errors
    for k in [x.get_context_query_errors() for x in self._alignment_errors]:
      for b in k:
        if b not in r: r[b] = {}
        for c in k[b]:
          if c not in r[b]: r[b][c] = {}
          for a in k[b][c]:
            if a not in r[b][c]: 
              r[b][c][a] = {}
              r[b][c][a]['total'] = 0
              r[b][c][a]['types'] = {}
            r[b][c][a]['total'] += k[b][c][a]['total']
            for type in k[b][c][a]['types']:
              if type not in r[b][c][a]['types']: r[b][c][a]['types'][type] = 0
              r[b][c][a]['types'][type] += k[b][c][a]['types'][type]
    self._query_context_errors = r