Merged dependency parse with similarity; made code more pythonic