def remove_terms(pos_synsets, remove_dict, issynset=False):
    """
    Remove synsets from the part of speech synset dictionary 
    based on the word.

    :param pos_synsets: dictionary mapping pos to list of 
                        bi-tuples, where first item is the word
                        and second item is the synset
    :type  pos_synsets: dict
    :param remove_dict: dictionary mapping pos to list of words to remove
    :type  remove_dict: dict
    :param issynset: is remove_dict refering to words or synsets
    :type  issynset: bool
    :returns: dictionary of pos_synsets after removal
    :rtype:   dict
    """

    out_dict = {}
    for pos, synsets in pos_synsets.items():
        remaining_synsets = []
        for synset in synsets:
            if issynset:
                if not (synset[1].name() in remove_dict[pos]):
                    #                     print(synset[1])
                    remaining_synsets.append(synset)
            else:
                if not (synset[0] in remove_dict[pos]):
                    remaining_synsets.append(synset)
        out_dict[pos] = remaining_synsets

    return out_dict