Results 1 to 9 of 9
Like Tree6Likes
  • 1 Post By KevinWorkman
  • 1 Post By KevinWorkman
  • 1 Post By franco
  • 1 Post By JeffGrigg
  • 2 Post By KevinWorkman

Thread: anyone have algorithm for text compare?

  1. #1
    franco is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default anyone have algorithm for text compare?

    anyone have algorithm for text compare?
    can share link to me? thank

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    What do you mean by "compare"? Do you have any examples? Have you looked at the String API at all? What did google tell you?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    franco is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default

    compare the text inside two document

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    Again, what does compare mean? What have you tried? Where are you stuck? What part of it do you not know how to do? Where is your SSCCE?
    JeffGrigg likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    franco is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default

    sorry about that, i am new for java and this forum, compare mean find out the similarity of both document, i need a algorithm to do that compare process, because i didn't have for that

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    Sorry, but that doesn't really give any useful information. What makes a document similar? What makes it different? What do you want to do with that comparison?

    How would you do this by hand? Given two paper documents, how would you compare them? Write out rules that a child could follow to accomplish the goal, and you'll have an algorithm that should be pretty easy to translate to code.
    JeffGrigg likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    franco is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default

    Quote Originally Posted by KevinWorkman View Post
    Sorry, but that doesn't really give any useful information. What makes a document similar? What makes it different? What do you want to do with that comparison?

    How would you do this by hand? Given two paper documents, how would you compare them? Write out rules that a child could follow to accomplish the goal, and you'll have an algorithm that should be pretty easy to translate to code.
    first the compare text is like the plagiarism checker, will select two document and compare between, check the similarity between both document and come out with a report. The plagiarism checker will check both document and show the ratio of plagiarism
    JeffGrigg likes this.

  8. #8
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    With Microsoft Word documents, I would use DCOM (OLE Automation) to drive the Word program and have it figure out the differences.

    With text files, run the "diff" program.

    Also, here's a useful library:
    google-diff-match-patch - Diff, Match and Patch libraries for Plain Text - Google Project Hosting
    Jodokus likes this.

  9. #9
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    I'm sticking with my question- how would you do this by hand?
    JeffGrigg and Jodokus like this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Read text file and compare strings
    By africanhacker in forum New To Java
    Replies: 9
    Last Post: 04-01-2011, 01:53 AM
  2. Replies: 4
    Last Post: 01-20-2011, 05:19 PM
  3. Replies: 2
    Last Post: 01-26-2009, 05:28 PM
  4. Compare 5 numbers
    By Snowboardmylife in forum New To Java
    Replies: 5
    Last Post: 04-15-2008, 08:04 PM
  5. Compare 2 XML
    By Peter in forum XML
    Replies: 1
    Last Post: 07-05-2007, 03:58 AM

Posting Permissions

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