code: def find_mecab_dictionary(names):
      
      suggested_pkg = names[0]
      paths = [
          os.path.expanduser('~/.local/lib/mecab/dic'),
          '/var/lib/mecab/dic',
          '/var/local/lib/mecab/dic',
          '/usr/lib/mecab/dic',
          '/usr/local/lib/mecab/dic',
          '/usr/lib/x86_64-linux-gnu/mecab/dic',
      ]
      full_paths = [os.path.join(path, name) for path in paths for name in names]
      checked_paths = [path for path in full_paths if len(path) <= MAX_PATH_LENGTH]
      for path in checked_paths:
          if os.path.exists(path):
              return path
  
      error_lines = [
          "Couldn't find the MeCab dictionary named %r." % suggested_pkg,
          "You should download or use your system's package manager to install",
          "the %r package." % suggested_pkg,
          "",
          "We looked in the following locations:"
      ] + ["\t%s" % path for path in checked_paths]
  
      skipped_paths = [path for path in full_paths if len(path) > MAX_PATH_LENGTH]
      if skipped_paths:
          error_lines += [
              "We had to skip these paths that are too long for MeCab to find:",
          ] + ["\t%s" % path for path in skipped_paths]
  
      raise OSError('\n'.join(error_lines))
docs: Find a MeCab dictionary with a given name. The dictionary has to be
      installed separately -- see wordfreq's README for instructions.