parameters: (book, cat)
return_statement: return ret
docstring: Format results of get_book_category_linkset for front end use by the Explorer.
      :param book: String
      :param cat: String
      :return:
docstring_summary: Format results of get_book_category_linkset for front end use by the Explorer.
      :param book: String
      :param cat: String
      :return:
docstring_tokens: Format results of get_book_category_linkset for front end use by the Explorer . : param book : String : param cat : String : return :
function: def get_book_link_collection(book, cat):
      """
      Format results of get_book_category_linkset for front end use by the Explorer.
      :param book: String
      :param cat: String
      :return:
      """
      links = get_book_category_linkset(book, cat)
  
      link_re = r'^(?P<title>.+) (?P<loc>\d.*)$'
      ret = []
  
      for link in links:
          l1 = re.match(link_re, link.refs[0])
          l2 = re.match(link_re, link.refs[1])
          if not l1 or not l2:
              continue
          ret.append({
              "r1": {"title": l1.group("title"), "loc": l1.group("loc")},
              "r2": {"title": l2.group("title"), "loc": l2.group("loc")}
          })
      return ret
function_tokens: def get_book_link_collection ( book , cat ) : links = get_book_category_linkset ( book , cat ) link_re = r'^(?P<title>.+) (?P<loc>\d.*)$' ret = [ ] for link in links : l1 = re . match ( link_re , link . refs [ 0 ] ) l2 = re . match ( link_re , link . refs [ 1 ] ) if not l1 or not l2 : continue ret . append ( { "r1" : { "title" : l1 . group ( "title" ) , "loc" : l1 . group ( "loc" ) } , "r2" : { "title" : l2 . group ( "title" ) , "loc" : l2 . group ( "loc" ) } } ) return ret