def split_articles(textdict, doccats, date_cut):
    """
    split given articles into "current" (after date_cut (inclusive)) and "old" articles (before date_cut)

    Inputs:
        textdict: a dict with {articleid: article text}
        doccats: a dict with {articleid: publication date}
        date_cut: strings with dates in the format "%YYYY-%MM-%DD", e.g. '2017-01-22'
    Returns:
        textdict: a dict with {articleid: article text}
        doccats: a dict with {articleid: 'current'/'old' depending on publication date}
    """
    # sort articles based on date_cut
    ids_current = [aid for aid in doccats if doccats[aid] >= date_cut]
    ids_old = [aid for aid in doccats if doccats[aid] < date_cut]
    textdict = {aid: textdict[aid] for aid in ids_old + ids_current}
    doccats = {aid: 'current' for aid in ids_current}
    doccats.update({aid: 'old' for aid in ids_old})
    return textdict, doccats