Ideas for algorithm to display how many words in a sentence differ?

For example......
sentenceA: I went to the store today.
sentenceB: I want to the store tdoay.
...easy case...compare word by word, we see one difference. BUT, this fails in a case such as the one below:
sentenceA: I went to the store today.
sentenceB: I went went to the store today.
....if we just compare word by word, it will fail on the 3rd word, and all the subsequent words will not match as well. We want this case to be returned as 1 error.
Any ideas? I've tried some algoriths that read both sentences both forward and backwards and compares, and this helps with the extra inserted words, but it is not foolproof/ideal for all cases.
Maybe I am missing some obvious way to accomplish this?
Thanks alot for any ideas/inspiration guys!

turbo, I thought about this again. I'd still recommend you look at some texts on compiler construction. The scanner (in your case) would return one word at a time. If punctuation is not significant in your case, then the scanner should ignore things like periods, commas, etc.
In a compiler situation, the parser compares the token against a grammar to determine if the token fits any of the rules. In your case, the "rule" could simply be the contents of one of the documents in a "tokenized" format (meaning, if the punctuation is not significant, the tokenized list omits those). The "tokenized" contents of the second document could be compared against that of the first one.
I have not dealt with compiler writing for quite a few years and so some of the concepts are quite rusty. One of those is the error handling and restarting the parsing process. If I may, that's the area you may want to check. Methinks you ought to be able to adapt that approach to fit your requirements. Just a parser can count the number of errors, yours should be able to keep track of the number of mismatches.
Hope this helps!
Cheers!

Similar Messages

  • Where do you see how many words you've typed?

    I am writing a paper for school and its only supposed to be 500 words long, where do i see how many words i've typed?

    Go to the Document inspector & click the Info tab or Edit > Writing Tools > Show Statistics.
    If you get Pages '09, the word count is in the bottom left of each document.

  • How to display how many days my tasks is late?

    Hi All,
    I'm looking for decision how to display the number of days in my project and for any task that is late, according to progress line. I can display the progress line, I can insert the new field with
    status but I need to display how many days of some tasks are late?Thanks :)
    Boriana Petrova MCT, MCTS, MCITP, MOS- Master

    Hi Boriana,
    Progress line and finish variance are 2 different features:
    Progress line is calculated based on the status date or any given progress date,
    Finish variance is calculated as follow : finish - baseline finish
    Thus it might be the expected behavior to have a progress line showing different information than the finish variance.
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • In version 6 iTunes displayed how many songs I had. Will version 11.1.3 do this?

    In version 6 of iTunes it displayed how many songs I had in my library.  I upgraded this weekend to iTunes version 11.1.3 and I do not see a way to get a song count.

    The standard form for an iTunes filename is:
    <Artist>\<Album>\[D-]## <Name>[ S].<Ext>
    where AlbumArtist is used for Artist when non-blank, D is an optional leading disc number displayed if D>1 or no. of discs is >1, and S is an optional suffix created when two duplicates would otherwise be given the same filename.
    If your library is clear of duplicates turn Keep iTunes Media folder organized off under Edit > Preferences > Advanced, then turn it back on again.
    If you have duplicates see this post.
    tt2

  • After installing lion and updating to pages 4.1 cannot view my document content after I open the document.  Shows how many pages I have and how many words in word count, but no words...

    after installing lion and updating to pages 4.1 cannot view my document content after I open the document.  Shows how many pages I have and how many words in word count, but no words...

    Same problem. Tried reinstalling Pages. Didn't help. The behavior is like I am typing with a white font on a white background, but I am not.

  • Trial period for adobe cs6 is how many days?

    I have install trial for Photoshop CS6 on 2nd June 2014 and today it shows 0 days remaining. trial period for adobe cs6 is how many days?

    Adobe trial software expired early
    Mylenium

  • How to get Reports for specific User that how many password has been reset using FIM SSPR in FIM 2010 R2 SSPR

    Hi,
    How to get Reports for specific User that how many password has been reset using FIM SSPR in FIM 2010 R2 SSPR
    Regards
    Anil Kumar

    Hello there Anil,
    A simple way to quickly get a overview is to look at the request history within the portal environment (note that this will expire in a few day based on your environment, after that you would need to FIM Reporting Module - but you could increase this to
    maybe 60 days to so, watch the DB size).
    To do this you could create some custom search scopes of do some custom queries. The creator of the SSPR activities always has the same GUID so you can use that so search.
    In your search scope you can use the following XPath to play with.
    - All Password Reset Requests - /Request[Creator='b0b36673-d43b-4cfa-a7a2-aff14fd90522' and Operation='Put']
    - All Completed Password Reset Requests - /Request[Creator='b0b36673-d43b-4cfa-a7a2-aff14fd90522' and RequestStatus=‘Completed']
    You can play with the "RequestStatus".
    Hope this helps.
    Almero Steyn (http://www.puttyq.com) [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or "Helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer
    faster.]

  • I no longer am able to see how many emails I have in my inbox ever since I upgraded to iOS 7 is there a way for me to see how many emails are in my inbox now?

    I no longer am able to see how many emails I have in my inbox ever since I upgraded to iOS 7 is there a way for me to see how many emails are in my inbox now?

    I have the same problem - I'd like to see the total number of emails I have in each folder when I'm in the folder - it used to be at the top of the screen but since upgrading to iOS7 it's gone.  It now only shows how many emails are unread when you're in the folder list. 
    Gumby20133, I tried double clicking the Home button but nothing happened when I swiped up on the mail preview thumbnail - please could you explain what I was doing wrong?  Actually, even if I could do that, would I have to do it every time I wanted to see the total amount of emails in each folder?  As what I'm looking for is a way to permanently have the amount of emails showing in each folder - is there any way I can do that?
    Thanks!
    Janet

  • If I buy the Small Business Complete CC for $49.99/mo how many computers can I install

    If I buy the Small Business Complete CC for $49.99/mo how many computers can I install & run this on? 

    You can install it on any number of computers but can activate & use it twice only(on the same or different computer)
    Please refer to: http://www.adobe.com/legal/licenses-terms.html
    Regards
    Rajshree

  • How can I print the tutors for numbers app, and how many pgs are there

    can I print out a hard copy of tutor for numbers that I have purchased. If so about how many pgs are there-thks

    Ask the Tutor for Numbers app developer >  Contact Us - Noteboom Productions

  • HT201304 i cant remember my password i put on for my restriction setting. how many times cani try before i get locked out, and what domi do ifi can't remember it?

    i cannot remeber my password i put on when i restricted my account ..( caution for 10 yr old daughter) but now i can't remember it. i' m on my 9th try ... will  get locked out after a certain amount of attempts... any suggestions .  i dont want to have to start over ( i think i read that somewhere how many tries do i get?

    Not sure if there is a limit for the number of attempts for it, but if you can't remember the restrictions code then was it on the iPad when you last backed up ? If not then you can restore to that backup and it should be removed. If it was on the iPad when you last backed up then the only way to remove it is to reset the iPad back to factory defaults and you can then re-sync your content back to the iPad - you won't be able to restore to the backup as that will keep the code in place.

  • Mail avatar no longer displays how many new messages

    Mail used to show the number of unread messages in its avatar --a number would appear in a little red circle--but that no longer happens.  Is that a new Mavericks thing?  Notifications are fine if you're working in Mail but I want to see how many unread messages there are before I open Mail.
    What's going on?

    Timothy,
    It depends upon where the Mail application is installed. Since Mail is by default, usually installed in the Macintosh HD/Applications folder, the "Computer" Collection should include the Helvetica font.
    ;~)

  • How to search for perticular Bookmark present in many word files at once

    Hi all,
    We have templates created through Word 2003. We have created the Bookmarks in that some are fetched from database and others are from a XML file, through the code.
    We do Alt+i+k and the list of bookmarks present in that template appears.
    So, If I want to search for suppose a bookmark named 'GC_F_faxnumber' which is bookmark for fax number, I need to go through alll templates (there are about 500 template) one by one and then find it out.
    I need this work to be done ASAP. Could you please help me in how do I find out a bookmark in number of word files or templates the bookmark is located and in which all templates it is present.
    Thanks in advance.:)

    Hi,
    For this requirement, I think you need to iterate to open these files and use
    Bookmarks.Exists method to check whether the specify bookmark is exist or not.
    There is a link that may benefit you:
    # GoTo Bookmark in a Word Document using Excel VBA
    http://answers.microsoft.com/en-us/office/forum/office_2003-word/goto-bookmark-in-a-word-document-using-excel-vba/6161709e-5419-4cc4-9c8f-7a2cd5f56d6a
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • The 27 inch iMac and the thunderbolt display how many hertz

    i want to play 3d games so i ask this question.

    Please navigate on this page to Support - Tech Specs - then find the model you're interested in. That is where you will find specifications for each model.
    You also need to be more specific when asking a question, 27' iMacs come in a variety of configurations with different GPUs and CPUs, RAM etc so  you need to specify which iMac, which GPU and which CPU you're most interested in. Also you need to state in which OS you plan to run the games OS X or MS Windows. If you plan to run Windows then you need to specifiy how you will be loading Windows Boot Camp or virtualization.
    In other words there are many factors to take into account.
    You can also look at the variety of benchmark sites that test that kind of thing. Use Google to find them.

  • Ideas for a Bad Display

    I don't have a PBG4 15" but I'd like to get one. I'm just going by what I've heard and want to ask someone if they'll try this and see if it helps the lines.
    First this is the first PB to have on board AirPort, so try disabling AirPort and BlueTooth as well and see if that helps.
    I wonder if the lines have anything to do with being on battery/AC. I have heard stories of wavy PB screens on AC.
    Do those with the issue ever notice the lines move? that would be a dead on interference problem IMO.
    And if someone is willing to open up their PB, does moving the video cable and/or toying with shielding on the display/display cable/GPU help any? I wonder if maybe interference is generated within the LCD panal. Will someone look at theirs with the backlight completely off and report their findings?
    Finally, it seems like this may be an issue with the brightness of the LCD (which is why i'm curious of how it would look with no backlight)
    Will someone put an all black image on the monitor and see if it's noticable then? maybe even post a picture so others can see?
    Does anyone notice some difference in the lines if they flex the LCD panel slightly (pull the left side in and push the right out) or if they tap or push on the LCD from either the back or the front?
    Thanks to anyone who replies with some answers.
    Hopefully I can get a 15" soon. I really want to get a PowerBook. This knowledge of the screen issue has set me back some on it. I'd love to get a 17" if it didn't have this issue which it seems like it doesn't but that's really too big for what I want (I have a desktop here with a 24" widescreen CRT that gets 2304x1440 so I will use the desktop when I wanna push pixels) and it's way too expensive.
    Thanks for anyone and everyone's time.
    --Ryan

    I suggest you go to an Apple store and try those things out on your own, or just go buy one.
    I'm not about to take mine apart, but I'll say that it has nothing to do with AirPort or Bluetooth,
    being plugged in to the AC adapter or battery,
    the faint white horizontal lines do not move (but there are diagonal moving lines in certain colors, especially on the top left part of the screen),
    I'm about 99.9% sure it has nothing to do with the brightness,
    the lines are not noticeable on white, black, or pure red, green or blue with full RGB values,
    and flexing the screen doesn't do anything at all (except put unnecessary strain on the display)
    This is either a problem with the LCD, or the graphic card, and right now, I'm banking on LCD (since the lines don't show up on an external monitor.)

Maybe you are looking for

  • Audio/MIDI Sync Errors

    After working perfectly for months, I now am getting audio MIDI Sync error messages. The result is no audio output either from audio instruments or recorded audio. I am using a MOTU 896HD and audio thru itunes works as long as Logic is not running at

  • Use of @Transactional in Hibernate Data Access Object

    Hello I have just started using Hibernate 3 along with Spring framework using MyEclipse and Oracle 10g. I have started with a basic application having a single database table Customer which is represented by an annotation based POJO. Then created a s

  • Customer & vendor balance transfer to Profit centre

    Hi Experts this is Geetareddy . pls could any body help to me abt how customer & vendor balance transfer to Profit centre thanks get points Geeta

  • How to create graph based on sql query

    Hi all, I am using jdev 10.1.3.3 My requirement is need to ctreate graph(pie chart) based on sql query ex: select count(empno) from emp group by deptno; and also i need to give link on graph. If i click 10 deptno part in pie chart only 10 deptno empl

  • Encore Chapter Points

    I'm having problems placing chapter points where I want them in Encore.  I haven't figured out what is limiting placement.  Any ideas you have would be most appreciated!  I'm using CS4 on a right speedy beefed up pc, in case you're wondering.