Word frequency: Difference between revisions

m
Line 2,369:
CFDictionaryRef dict
 
// BreakDepending outon capitalizedthe wordsvalue during seaarch or not as determined byof the caseSensitive Boolean function inputparameter parameterabove, lowercase incoming text
if caseSensitive == NO then textStr = fn StringLowercaseString( textStr )
 
// Trim non-alphabetic characters from string, and separate individual words with a space
CFStringRef tempStr = fn ArrayComponentsJoinedByString( fn StringComponentsSeparatedByCharactersInSet( textStr, fn CharacterSetInvertedSet( fn CharacterSetLetterSet ) ), @" " )
 
Line 2,390:
CountedSetRef freqencies = fn CountedSetWithArray( tempArr )
 
// Enumerate each word-frequenyfrequency painpair in the counted set...
EnumeratorRef enumRef = fn CountedSetObjectEnumerator( freqencies )
 
Line 2,429:
next
 
// Create an immutable output string from mutable the string
CFStringRef resultStr = fn StringWithFormat( @"%@", mutStr )
end fn = resultStr
Line 2,459:
HandleEvents
</lang>
{{Outoutput}}
<pre>
1 41095 the
715

edits