def extract_gender_features(word):
    """ Produce features for classification.
    If you choose to add new features, be sure to delete the pickled
    classifier (or the new features will not be used).
    """
    word = word.lower()
    features = {}
    features['last_letter=%s' % word[-1]] = 1
    features['first_letter=%s' % word[0]] = 1
    if len(word) > 1:
        features['first_2=%s' % word[:2]] = 1
        features['last_2=%s' % word[-2:]] = 1
    if len(word) > 2:
        features['first_3=%s' % word[:3]] = 1
        features['last_3=%s' % word[-3:]] = 1
    if len(word) > 3:
        features['first_4=%s' % word[:4]] = 1
        features['last_4=%s' % word[-4:]] = 1
    if word[0] in 'aeiou':
        features['starts_vowel'] = 1
    else:
        features['starts_consonant'] = 1
    if word[-1] in 'aeiou':
        features['ends_vowel'] = 1
    else:
        features['ends_consonant'] = 1
    features['name=%s' % word] = 1
    return features
