public override IEnumerable<double> Convert(object o)
{
// check for valid dictionary
if (Dictionary == null || Dictionary.Length == 0)
throw new InvalidOperationException(string.Format("{0} dictionaries do not exist.", Name));
// sanitize string
string s = "";
if (o == null || string.IsNullOrEmpty(o.ToString()) || string.IsNullOrWhiteSpace(o.ToString()))
s = StringHelpers.EMPTY_STRING;
else
s = o.ToString();
// returns single number
if (AsEnum)
yield return (double)StringHelpers.GetWordPosition(s, Dictionary, false);
// returns list
else
foreach (double val in StringHelpers.GetWordCount(s, this))
yield return val;
}