add type check for Inflector::singularize