contains_hangul() checks the argument only if it is either a regular string or a unicode string; also added a default value to the reduce funciton