#!/usr/bin/env python

#
# Add a singleton feature to the misc column of all tokens of a certain form.
#
# Format
#   add_misc_features.py filename > transform.conll
#

import argparse

import pyconll

parser = argparse.ArgumentParser()
parser.add_argument('filename', help='The name of the file to transform')
args = parser.parse_args()

corpus = pyconll.load_from_file(args.filename)
for sentence in corpus:
    for token in sentence:
        if token.lemma == 'dog' and token.upos == 'VERB':
            token.misc['Polysemous'] = True

# Print to standard out which can then be redirected.
print(corpus.conll())

@@ -504,38 +504,249 @@
     
-token.misc%5B'Polysemous'%5D = Tru
+# Note: This means that 'Polysemous' will be present as a singleton%0A            # in the token line. To remove 'Polysemous' from the token's%0A            # features, call del token.misc%5B'Polysemous'%5D%0A            token.misc%5B'Polysemous'%5D = Non
 e%0A%0A#

Update example with correct form, and with comment.