def compute_tf(document, term, type='raw'):
    """
    This function computes the raw term-frequency (TF) for a given document and term.

    :param document: array of terms (list object)
    :param term: single term
    :param type: Type of TF calculation to use, default is 'raw'. Other options are 'augmented' and 'boolean'
    :return tf: raw term frequency of term in the document
    """
    assert (type in ['raw', 'augmented', 'boolean']), "The parameter 'type' is not recognized. Please enter 'raw', 'boolean' or 'augmented' as it's value."
    tf = 0.0
    if type == 'raw':
        tf = float(document.count(term))
    if type == 'boolean':
        tf = float(term in document)
    if type == 'augmented':
        tf = 0.5 + ((0.5 * float(document.count(term))) / float(max([document.count(x) for x in document])))
    return tf