made script compatible with Python 3.3 (and Python 2.7).
changed output function: now prints one named entity and type per line, tab separated.