Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774

    A Week challenge (end 4th Nov 2007)

    Speedy String manipulation:

    The goal:

    To take a text file of a reasonably large magnitutde (such as say "windows.pas" from the delphi source or more, and then to generate a report which lists the top 20 used words, and show a count in as quick a time as you can manage! As well as list a complete list of unique words.

    Please give consideration to the user interface.

    to clarify: To count the number of unique words, punctuation and numbers dont count as a word, so "this" and "this:" and "'this'" and so on are all the same. words consist of a-z alone, but do not have to be dictionary based, so "aaaaa" is a word

    reasons: String manipulation is very common, as user input generally comes in text form (see edit, memo boxes etc), or web pages etc. This will also let you investigate file IO, as well as put your main thought towards efficiency.

    Work to be done using borland provided tools no 3rd party stuff to assist.

    If you find that too easy? Try threading it, so you can run on multiple files, so your file selection should then support multiple selection and process them all in parallel.

    reasons: threading is unavoidable, your UI should not be delayed by any processing your app does. You may choose to disable lots of stuff to prevent them continue working, but the app must not go unresponsive or users have a habbit of whining its hung, and killing it - despite the fact it was merrily doing stuff.

    There is a thread example with your copy of delphi.

    PS: usual deal - dont post your questiosn or problems here, PM me with them. Do post you're joining in, or if you need a clairificaiton of the requirements.
    Last edited by LizKimber; 10-25-2007 at 03:59 AM.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  2. #2
    Join Date
    Dec 2006
    Posts
    309
    clairificaiton of the requirements:

    Does "a" and "I" count as a word? since they are one char but used in modern english when connecting sentences or speaking in 1st person.

    "( I ) started viewing 3dbuzz.com"
    "3dbuzz is ( a ) great place to be"

    and how about company names with numbers in? for example 3Dbuzz does it class the word as 6 char long or 5?

    thank you.

  3. #3
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    3dbuzz would be 1 word of dbuzz (for this experiment the 3 would be ignored)

    a and I should count but then so would f and p
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  4. #4
    Join Date
    Sep 2006
    Posts
    18
    What if there will be "3dbuzz" and some "2dbuzz", should they be counted as one and the same?
    Giggity

  5. #5
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    yes they would because the 3 would be totally ignored.
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  6. #6
    Join Date
    Nov 2006
    Posts
    233
    Count me in, nearly done
    Guide to Learning Delphi - A list of resources and tips. If you have a question read this.
    Delphi Fusion Delphi Articles and Forum
    My Blog - Random Delphi related ramblings by a hobby programmer.
    Delphi Fusion Team - Join my SETI@home and ClimatePrediction.Net Team

    You see what power is - holding someone else's fear in your hand and showing it to them!

  7. #7
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    Great! Looking forward to seeing it
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  8. #8
    Join Date
    Nov 2006
    Posts
    233
    I think I spoke to soon there, I have stumbled into a couple of headaches with my implementation. But I'll have it done
    Guide to Learning Delphi - A list of resources and tips. If you have a question read this.
    Delphi Fusion Delphi Articles and Forum
    My Blog - Random Delphi related ramblings by a hobby programmer.
    Delphi Fusion Team - Join my SETI@home and ClimatePrediction.Net Team

    You see what power is - holding someone else's fear in your hand and showing it to them!

  9. #9
    Join Date
    Nov 2006
    Location
    UK
    Posts
    3,774
    hehe, thats one of the reasons I set this one, its something that sounds real easy but often you can stumble on it seems fast until you pump a bigger file in, or, somehow it all goes horribly wrong
    Delphi !ROCKS!
    Got a question? Read this first!!!
    "You gotta help us, Doc. We've tried nothin' and we're all out of ideas"

  10. #10
    Join Date
    Nov 2006
    Posts
    233
    Quote Originally Posted by LizRiley View Post
    hehe, thats one of the reasons I set this one, its something that sounds real easy but often you can stumble on it seems fast until you pump a bigger file in, or, somehow it all goes horribly wrong
    I forgot two magic words, CoInitialize(nil) and CoUnInitialize. I came back to it this morning and figured it out immediately. It just goes to show that debugging when tired is a bad idea.
    Guide to Learning Delphi - A list of resources and tips. If you have a question read this.
    Delphi Fusion Delphi Articles and Forum
    My Blog - Random Delphi related ramblings by a hobby programmer.
    Delphi Fusion Team - Join my SETI@home and ClimatePrediction.Net Team

    You see what power is - holding someone else's fear in your hand and showing it to them!

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •