>Yeah, CF7 and CF8 both added new operators. I tweaked it; give it
>another whirl.
Thanks - I believe I found one of the major culprits - the == which doesn't
work in 6.
I changed it to "IS" and now, with your other tweaks - it works in 6.
<cfscript> function getPoints(text, words) { var i = ""; words =
listToArray(words); for (i = 1; i LTE arrayLen(words); i = i + 1) { text =
REReplace(text, "(^|[^[:alpha:]])#words[i]#([^[:alpha:]]|$)", "\1#chr(7)#\2",
"all"); } return listLen(text, chr(7)); } function guessSex(text) { text = " "
& lCase(text) & " "; mPoints = getPoints(text, "mr.,he,him,his"); fPoints =
getPoints(text, "mrs.,ms.,miss,she,her,hers");
if (mPoints IS fPoints) { return "unknown"; }
else if (mPoints GT fPoints) { return "male"; } else { return "female"; }
}
</cfscript>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321060
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4