import re


def get_entries(fname):
    """
    Get AMR entries from files
    Args:
        fname: path to input

    Returns: original amr string with meta info and amr string without meta info

    """
    with open(fname) as f:
        data = f.read()
    entries = []
    original_entries = []
    for e in data.split('\n\n'):
        lines = [l.strip() for l in e.splitlines()]
        lines = [l for l in lines if (l and not l.startswith('#'))]
        string = ' '.join(lines)
        string = string.replace('\t', ' ')      # replace tabs with a space
        string = re.sub(' +', ' ', string)      # squeeze multiple spaces into a single
        if string:
            entries.append( string )
            original_entries.append(e)
    return original_entries, entries