Word frequency counter