from common import log

def add_adjective_a(self, former, latter):  # Adds the word "a" or "an" in fornt of a random adjective and in betweet two parts of a sentance.
    adjective = queries.random_adjective(self)  # Get random adjective.

    # Apply English grammar.
    if adjective[0] == 'a':
        former = former + 'an'
    else:
        former = former + 'a'

    # Don't fail if there are no adjectives.
    if adjective:
        return '%s a %s %s' % (former, adjective, latter)
    else:
        return '%s a %s' % (former, latter)
