Example #1
0
def read_file(fileid):
    file_path = reuters_index.index[int(fileid)]

    try:
        reuters_article = ReutersArticle(file_path)
        file_text = reuters_article.get_all_text()
        return file_text
    except FileNotFoundError:
        return "Error Reading File: " + file_path
Example #2
0
def get_title_from_id(file_id):
    file_path = reuters_index.index[int(file_id)]
    reuters_article = ReutersArticle(file_path)
    title = urllib.parse.quote(reuters_article.get_title())
    return title