Results 1 to 9 of 9

Thread: anyone have algorithm for text compare?
- 08-08-2011, 04:35 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 6
- Rep Power
- 0
- 08-08-2011, 04:43 PM #2
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 - GameDev tutorials, free Java and JavaScript hosting!
Static Void Games forum - Come say hello!
- 08-08-2011, 04:44 PM #3
Member
- Join Date
- Aug 2011
- Posts
- 6
- Rep Power
- 0
compare the text inside two document
- 08-08-2011, 04:45 PM #4
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?
How to Ask Questions the Smart Way
Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
Static Void Games forum - Come say hello!
- 08-08-2011, 04:47 PM #5
Member
- Join Date
- Aug 2011
- Posts
- 6
- Rep Power
- 0
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
- 08-08-2011, 05:04 PM #6
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.How to Ask Questions the Smart Way
Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
Static Void Games forum - Come say hello!
- 08-08-2011, 05:16 PM #7
Member
- Join Date
- Aug 2011
- Posts
- 6
- Rep Power
- 0
- 08-08-2011, 05:18 PM #8
Member
- Join Date
- Aug 2011
- Posts
- 95
- Rep Power
- 0
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
- 08-08-2011, 05:32 PM #9
I'm sticking with my question- how would you do this by hand?
How to Ask Questions the Smart Way
Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
Static Void Games forum - Come say hello!
Similar Threads
-
Read text file and compare strings
By africanhacker in forum New To JavaReplies: 9Last Post: 04-01-2011, 01:53 AM -
How to Search, Compare, and Replace text in the TextBox?
By SHENGTON in forum CLDC and MIDPReplies: 4Last Post: 01-20-2011, 05:19 PM -
PROOF READ: Sort text file 3 different ways and compare
By VinceGuad in forum New To JavaReplies: 2Last Post: 01-26-2009, 05:28 PM -
Compare 5 numbers
By Snowboardmylife in forum New To JavaReplies: 5Last Post: 04-15-2008, 08:04 PM -
Compare 2 XML
By Peter in forum XMLReplies: 1Last Post: 07-05-2007, 03:58 AM
Bookmarks