(self, doc_id)
fetch all of the paragraphs with their corresponding hyperlink titles.
        e.g., 
        >>> paras, links = db.get_doc_text_hyper_linked_titles_for_articles("Tokyo Imperial Palace_0")
        >>> paras[2]
        'It is built on the site of the old Edo Castle. The total area including the gardens is . During the height of the 1980s Japanese property bubble, the palace grounds were valued by some to be more than the value of all of the real estate in the state of California.'
        >>> links[2]
        ['Edo Castle', 'Japanese asset price bubble', 'Real estate', 'California']
fetch all of the paragraphs with their corresponding hyperlink titles.
        e.g., 
        >>> paras, links = db.get_doc_text_hyper_linked_titles_for_articles("Tokyo Imperial Palace_0")
        >>> paras[2]
        'It is built on the site of the old Edo Castle. The total area including the gardens is . During the height of the 1980s Japanese property bubble, the palace grounds were valued by some to be more than the value of all of the real estate in the state of California.'
        >>> links[2]
        ['Edo Castle', 'Japanese asset price bubble', 'Real estate', 'California']
fetch all of the paragraphs with their corresponding hyperlink titles . e . g . >>> paras links = db . get_doc_text_hyper_linked_titles_for_articles ( Tokyo Imperial Palace_0 ) >>> paras [ 2 ] It is built on the site of the old Edo Castle . The total area including the gardens is . During the height of the 1980s Japanese property bubble the palace grounds were valued by some to be more than the value of all of the real estate in the state of California . >>> links [ 2 ] [ Edo Castle Japanese asset price bubble Real estate California ]
def get_doc_text_hyper_linked_titles_for_articles(self, doc_id):
        """
        fetch all of the paragraphs with their corresponding hyperlink titles.
        e.g., 
        >>> paras, links = db.get_doc_text_hyper_linked_titles_for_articles("Tokyo Imperial Palace_0")
        >>> paras[2]
        'It is built on the site of the old Edo Castle. The total area including the gardens is . During the height of the 1980s Japanese property bubble, the palace grounds were valued by some to be more than the value of all of the real estate in the state of California.'
        >>> links[2]
        ['Edo Castle', 'Japanese asset price bubble', 'Real estate', 'California']
        """
        cursor = self.connection.cursor()
        cursor.execute(
            "SELECT text FROM documents WHERE id = ?",
            (doc_id,)
        )
        result = cursor.fetchone()
        cursor.close()
        if result is None:
            return [], []
        else:
            hyper_linked_paragraphs = result[0].split("\n\n")
            paragraphs, hyper_linked_titles = [], []
            
            for hyper_linked_paragraph in hyper_linked_paragraphs:
                paragraphs.append(remove_tags(hyper_linked_paragraph))
                hyper_linked_titles.append([normalize(title) for title in find_hyper_linked_titles(
                    hyper_linked_paragraph)])
                
            return paragraphs, hyper_linked_titles
def get_doc_text_hyper_linked_titles_for_articles ( self , doc_id ) : cursor = self . connection . cursor ( ) cursor . execute ( "SELECT text FROM documents WHERE id = ?" , ( doc_id , ) ) result = cursor . fetchone ( ) cursor . close ( ) if result is None : return [ ] , [ ] else : hyper_linked_paragraphs = result [ 0 ] . split ( "\n\n" ) paragraphs , hyper_linked_titles = [ ] , [ ] for hyper_linked_paragraph in hyper_linked_paragraphs : paragraphs . append ( remove_tags ( hyper_linked_paragraph ) ) hyper_linked_titles . append ( [ normalize ( title ) for title in find_hyper_linked_titles ( hyper_linked_paragraph ) ] ) return paragraphs , hyper_linked_titles