A Template-based Method for Constrained Neural Machine Translation