Java to Python Port of Syntactic by Omer Shapira.