Word frequency: Difference between revisions
Content added Content deleted
Line 2,377: | Line 2,377: | ||
// Prepare separators to parse string into array |
// Prepare separators to parse string into array |
||
CFMutableCharacterSetRef separators = fn MutableCharacterSetInit |
CFMutableCharacterSetRef separators = fn MutableCharacterSetInit |
||
⚫ | |||
⚫ | |||
⚫ | |||
// Create array of separated words |
|||
MutableCharacterSetFormUnionWithCharacterSet( separators, fn CharacterSetPuntuationSet ) |
|||
⚫ | |||
MutableCharacterSetFormUnionWithCharacterSet( separators, fn CharacterSetWhitespaceAndNewlineSet ) // Create array of separated words |
|||
CFArrayRef tempArr = fn StringComponentsSeparatedByCharactersInSet( tempStr, separators ) |
CFArrayRef tempArr = fn StringComponentsSeparatedByCharactersInSet( tempStr, separators ) |
||
Line 2,443: | Line 2,445: | ||
NSLogClear |
NSLogClear |
||
NSLog( @"%@", frequencyStr ) |
NSLog( @"%@", frequencyStr ) |
||
NSLog( @"Total words in document: %@", fn AppProperty( @"totalWords" ) ) |
NSLog( @"Total unique words in document: %@", fn AppProperty( @"totalWords" ) ) |
||
// Stop timer and log elapsed processing time |
// Stop timer and log elapsed processing time |
||
NSLog( @"Elapsed time: %f milliseconds.", ( fn CFAbsoluteTimeGetCurrent - startTime ) * 1000.0 ) |
NSLog( @"Elapsed time: %f milliseconds.", ( fn CFAbsoluteTimeGetCurrent - startTime ) * 1000.0 ) |