def isSubStringOf(term1, term2):
    """
    check if term1 is a substring of term2 on token-level
    :param term1:
    :param term2:
    :return:
    """
    if len(term1.strip()) == 0 or len(term2.strip()) == 0:
        return False

    term1_token_set = set(term1.split(' '))
    term2_token_set = set(term2.split(' '))

    matched_tokens = set(term1_token_set).intersection(set(term2_token_set))
    if len(matched_tokens) == len(term1_token_set):
        return True
    else:
        return False