Download presentation
Presentation is loading. Please wait.
Published byAngelica Manring Modified over 3 years ago
1
Parsing a Name Homework 1
2
Cases to Consider Rest Last Rest Last Last, Rest Last, Rest Rest Last, Suffix Rest Last, Suffix Last, Rest, Suffix Last, Rest, Suffix Others??? Others??? Question: how do we tell the computer to recognize and distinguish each case from the others? Question: how do we tell the computer to recognize and distinguish each case from the others?
3
Distinguishing the Four Cases Case Rest LastRest Last Last, RestLast, Rest Rest Last, SuffixRest Last, Suffix Last, Rest, SuffixLast, Rest, Suffix Distinguishing Characteristic No Comma presentNo Comma present First Comma before First SpaceFirst Comma before First Space First Space before First CommaFirst Space before First Comma First Comma Last CommaFirst Comma Last Comma Note that one must remove extraneous white space before the strategy above works correctly Remove leading and trailing whitespaceRemove leading and trailing whitespace Replace multiple consecutive whitespace characters with single spaceReplace multiple consecutive whitespace characters with single space Remove any whitespace immediately before a commaRemove any whitespace immediately before a comma
4
Distinguishing the Four Cases Case Rest LastRest Last Last, RestLast, Rest Rest Last, SuffixRest Last, Suffix Last, Rest, SuffixLast, Rest, Suffix Distinguishing Characteristic No Comma presentNo Comma present First Comma before First SpaceFirst Comma before First Space First Space before First CommaFirst Space before First Comma First Comma Last CommaFirst Comma Last Comma After handling the suffix in the last two cases and then removing it along with its preceding comma and space, we are left with the first two cases
Similar presentations
© 2018 SlidePlayer.com Inc.
All rights reserved.
Ppt on high voltage engineering applications Ppt on area of triangle in coordinate geometry Ppt on network switching system Burn ppt on dvd Ppt on pin diode symbol Ppt on autonomous car news Ppt on model view controller framework Ppt on microsoft excel formulas Ppt on wireless technology Ppt on water pollution problems and solutions