import re
import string


def clean_string(text):
    """
    Performs basic string cleaning:
    - Clear pdf conversion md strings
    - Remove weird symbols
    - Reduce redundant white spaces

    Parameters
    ----------
    text : list
        list of strings to clean

    Returns
    -------
    text : list
        list of strings that are cleaned by the above process
    """
    # Clear line breaks
    md_break = re.compile('(\\n|\\uf0d8|\\uf0b7|\\uf0fc|\\uf020)')
    text = re.sub(md_break, ' ', text)

    # Clear symbols and numbers
    text = re.sub(
        re.compile(
            '[0-9–°“”�º…' + string.punctuation + ']'),
        ' ',
        text)

    # Clear multiple whitespace
    text = re.sub(re.compile(r'\s+'), ' ', text)
    return text