Unit tests for wordEncoder.