Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix artist name swapping for special cases, eg CSN&Y and apply to Ajax requests #58

Closed
eric-gilbertson opened this issue Aug 25, 2019 · 4 comments
Milestone

Comments

@eric-gilbertson
Copy link
Collaborator

eric-gilbertson commented Aug 25, 2019

Fix artist name swapping for special cases, eg CSN&Y. The name swapper reverses the <LAST>, <FRIST> name order in the ZK DB to <FIRST> <LAST> for improved readability. The problem is that the implementation munges the order for certain names. Challenge is to not apply swapping in those special cases while preserving it for the majority of names. Name swapping should also be applied to the output of Ajax requests that generate artist names, eg the onnow request.

Suggest Fix:
Do not apply name wapping if the base string contains special characters, eg '&'.

@RocketMan
Copy link
Owner

RocketMan commented Aug 25, 2019

Good idea! I like that we're refining this.

In addition to the special character test, one possible additional test to prevent unintended swapping could be this: If a single word (no spaces) follows 'and' or the final comma, then do not apply name swapping. This would prevent swapping in cases like Romain's, 'The Choir of St. John's College, Cambridge' (one word following the comma), as well as things like, 'Peter, Paul and Mary' (one word following 'and'). Counter example: 'Peter, Paul and John Smith' Here, there is more than one word following 'and', so normal swapping would apply => Paul Peter and John Smith.

[Edit: Maybe just the 'and' test above and not the comma test, as the latter seems more complex. For example, 'Van der Laan, Guus' should be swapped, but 'Jesus College, Oxford' not swapped. I am not sure there is an easy way to differentiate these. However, the 'and' case should be fairly straightforward (Peter, Paul and Mary (not swap) versus Peter, Paul and Mary Smith (swap).]

@eric-gilbertson
Copy link
Collaborator Author

I've simplified the logic do only swap names if there is a single comma and the name is not manually entered. This covers all of the above issues. Can you think of any other test cases?

@RocketMan
Copy link
Owner

Sounds good to me. It is one of those things that we can continue to finesse going forward if and as needed.

@RocketMan RocketMan added this to the v2.4.1 milestone Sep 20, 2019
@RocketMan
Copy link
Owner

Patch landed 2.4.1; closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants