Jump to content

Word frequency: Difference between revisions

m
Line 2,361:
Task said: "Feel free to explicitly state the thoughts behind the program decisions." Thus the heavy comments.
<lang futurebasic>
 
include "NSLog.incl"
 
Line 2,427 ⟶ 2,428:
CFStringRef resultStr = fn StringWithFormat( @"%@", mutStr )
end fn = resultStr
 
 
local fn ParseTextFromWebsite( webSite as CFStringRef )
Line 2,439 ⟶ 2,441:
CFStringRef frequencyStr = fn WordFrequency( textStr, NO, NO )
// Log results and post post processing time
NSLogClear
NSLog( @"%@", frequencyStr )
NSLog( @"Total words in document: %@", fn AppProperty( @"totalWords" ) )
Line 2,445 ⟶ 2,448:
end fn
 
dispatchglobal
// Pass url for Les Misérables on Project Gutenberg and parse in background
fn ParseTextFromWebsite( @"https://www.gutenberg.org/files/135/135-0.txt" )
dispatchend
 
HandleEvents
721

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.