code: def particles(category=None):
      '''
      Returns a dict containing old greek particles grouped by category.
      '''
      filepath = os.path.join(os.path.dirname(__file__), './particles.json')
      with open(filepath) as f:
          try:
              particles = json.load(f)
          except ValueError as e:
              log.error('Bad json format in "{}"'.format(filepath))
          else:
              if category:
                  if category in particles:
                      return particles[category]
                  else:
                      log.warn('Category "{}" not contained in particle dictionary!'.format(category))
              return particlef particles(category=None):
      '''
      Returns a dict containing old greek particles grouped by category.
      '''
      filepath = os.path.join(os.path.dirname(__file__), './particles.json')
      with open(filepath) as f:
          try:
              particles = json.load(f)
          except ValueError as e:
              log.error('Bad json format in "{}"'.format(filepath))
          else:
              if category:
                  if category in particles:
                      return particles[category]
                  else:
                      log.warn('Category "{}" not contained in particle dictionary!'.format(category))
              return particles
docs: Returns a dict containing old greek particles grouped by category.