def simple_features(tag, token_index, len_tags, beginning_context,
    ending_context):
    """Return simple features from token"""
    token, postag, _, _ = tag
    features = ['bias', 'token.lower=%s' % token.lower(), 
        'token.suffix[-3:]=%s' % token[-3:], 'token.suffix[-2:]=%s' % token
        [-2:], 'token.isupper=%s' % token.isupper(), 'token.istitle=%s' %
        token.istitle(), 'token.isdigit=%s' % token.isdigit(), 'postag=%s' %
        postag, 'postag[:2]=%s' % postag[:2]]
    if token_index == 0:
        features.append('BOS')
    elif token_index == len_tags - 1:
        features.append('EOS')
    len_context = len(beginning_context)
    for i, (token, postag, _, _) in enumerate(beginning_context):
        context_index = len_context - i
        features.extend(['-%d:token.lower=%s' % (context_index, token.lower
            ()), '-%d:token.istitle=%s' % (context_index, token.istitle()),
            '-%d:token.isupper=%s' % (context_index, token.isupper()), 
            '-%d:postag=%s' % (context_index, postag), '-%d:postag[:2]=%s' %
            (context_index, postag[:2])])
    for context_index, (token, postag, _, _) in enumerate(ending_context, 1):
        features.extend(['+%d:token.lower=%s' % (context_index, token.lower
            ()), '+%d:token.istitle=%s' % (context_index, token.istitle()),
            '+%d:token.isupper=%s' % (context_index, token.isupper()), 
            '+%d:postag=%s' % (context_index, postag), '+%d:postag[:2]=%s' %
            (context_index, postag[:2])])
    return features
