def _read_grammar(filename):
    """
    Reads file and converts to string.
    :param filename: (str) ends in .txt, path to grammar
    :return: (str) grammar string as in https://www.nltk.org/_modules/nltk/parse/generate.html
    """
    with open(filename, 'r') as file:
        data = file.read()

    return data