Java port of Chris Dyer's fast_align