def get_subj_text(verb):
    """
    Parameters
    ----------
    verb : a spacy Token

    Returns
    -------
    text : str 
        The text of the subject

    Raises
    ------
    AttributeError
        if the given verb is a relative clause and its head 
        is not a subject (very unlikely)
    IndexError
        if the given verb or its direct parent don't have
        any child subject
    """
    subj = None
    text = ""

    # if the verb is not of type VBD or VBN, 
    # there is no immediate dependant of type subject.
    # Instead, we try to find subject in the immediate head
    if verb.tag_ not in ["VBD", "VBN"]:
        verb = verb.head
    
    # if our verb's dep_ == "relcl" the subject will be immediate verb
    if verb.dep_ == "relcl":
        subj = verb.head
        try:
            text = subj.text
        except AttributeError:
            pass
        return text

    try:
        subj = [word for word in verb.lefts if word.dep_ in ["nsubj", "nsubjpass"]][0]
        text = subj.text
    except IndexError:
        pass
    
    return text