Retired

Shorten composite Full Name (retired)

Description
Loading description...
Strings
Regular Expressions
Fundamentals
  • Please sign in or sign up to leave a comment.
  • wthit56 Avatar

    JS starting code has an erroneous extra {.

    I'm a UK guy. We use Mr. Not sure what the Wikipedia article was saying with that, but it's not right. Likely the same with the suffixes (though it's so rare to see one, I can't speak to experience with that.) I think it just depends on the situation, the context. A TV channel might drop the dots, a legal document might keep them, etc.

    Just giving an example isn't enough. There is some amount of spec below that, but some things are left out--making it an incomplete spec. And making the resulting code kinda brittle, that passes only the tests you've written but it would fail other real-world cases.

  • andreapt82 Avatar
     Why do you put all this things in the same array?
    

    prefixes -> [ 'Mister', 'Mr.', 'Mr', 'Madame', 'Mrs.', 'Mrs', 'Miss', 'Ms.', 'Ms' ] suffixes -> [ 'Senior', 'Sr.', 'Sr', 'Junior', 'Jr.', 'Jr' ]

    Like "Junior" and "Jr". Must be to a map from what may be translated and the final word and no all the thing together.

    If you submmit a pull request this way your partners of the team will say bad things of you...

    • wthit56 Avatar

      I think it's just to show you what counts? Or something? They should just put it in the spec, in my opinion.

  • Voile Avatar
    given John Dallas junior-> J. Dallas Jr
    expected 'J. D. Junior' to equal 'J. Dallas Jr'
    

    It's not mentioned anywhere that prefix/suffix checking should be case-insensitive.

  • Voile Avatar

    Random tests:

    given Mrs. Mohammad Eugenia Carlos McLaughlin Sr -> Mrs M. E. C. McLaughlin Sr
    expected 'Mrs M. E. C. Mclaughlin Sr' to equal 'Mrs M. E. C. McLaughlin Sr'
    
    given Santino Marlen Hosea O'Hara Jr -> S. M. H. O'Hara Jr
    expected 'S. M. H. O\'hara Jr' to equal 'S. M. H. O\'Hara Jr'
    

    It is unclear how the spec Every element of the returning string should be capitalized should be interpreted with name parts containing multiple uppercase letters.

    And in the end, no matter what the expected behaviour is, it should be in the fixed tests to make sure it's tested. Sometimes it does not appear in the random tests.

  • Voile Avatar

    Prefix + First Name + Last Name + Suffix

    the string can include more than one First Name

    These two statements in description contradict with each other. It should be "one or more First Name(s)".

  • Voile Avatar

    Preloaded prefixes and suffixes are arrays like this:

    [ 'Mister', 'Mr.', 'Mr', 'Madame', 'Mrs.', 'Mrs', 'Miss', 'Ms.', 'Ms' ]
    

    How are we supposed to comprehend this data structure? When I see Mister I do not know what it's supposed to map to, unless I refer to the expected result or the description. (Or in other words, these preloaded arrays are pretty useless.)

  • IevgenT Avatar

    In the tests there is variant with 'jr', but in description is said that can be only 'Jr' variant.

  • daniloxxv Avatar

    This comment has been hidden.

  • ZED.CWT Avatar
     given Ms Lily Jerrod Schmeler -> Mrs L. J. Schmeler
    expected 'Ms L. J. Schmeler' to equal 'Mrs L. J. Schmeler'
     given Ms. Edna Deshawn Darien Smitham -> Mrs E. D. D. Smitham
    expected 'Ms E. D. D. Smitham' to equal 'Mrs E. D. D. Smitham'