added str2dict and maxSim to js