-
Notifications
You must be signed in to change notification settings - Fork 105
Update place names 978 #1013
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
base: master
Are you sure you want to change the base?
Update place names 978 #1013
Conversation
…date-place-names-978
Many place names have changed over the years. This lint looks for uses of known deprecated names and offers the new name. It doesn't attempt to include all place names. My rule of thumb was to include ones where I recognized at least the old name or the new name, and isn't too "ancient". It can: - If known, it includes the year the new name was accepted in the message. - It can handle multiple old names. It cannot yet: - Handle old place names with hyphens. - Offer multiple new names, such as with and without accents. - Recognize old names that don't use the correct case. - Recognize old names with variations in accents. - Replicate the exact whitespace between words if both the old and new names are multi-word.
|
||
// (year, new name), [old names] | ||
const RAW_PLACE_NAME_UPDATES: &[PlaceNameEntryStr] = &[ | ||
// Africa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very expensive to iterate through. Could you refactor it into a PatternLinter
to take advantage of caching?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very expensive to iterate through. Could you refactor it into a
PatternLinter
to take advantage of caching?
Really? I did my best to make it all use char slices and lazy static to convert the structure just once at startup... But I am very much a Rust noob so probably missed some important things... And yes this doesn't do caching.
I did think when I was nearly done that PatternLinter
would also work. I'll look into it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing it once at startup doesn't negate the fact that you're iterating through each element for every word in the document. Run cargo bench
and see what happens.
…date-place-names-978
Issues
#978
Description
Many place names have changed over the years. This lint looks for uses of known deprecated names and offers the new name.
It doesn't attempt to include all place names. My rule of thumb was to include ones where I recognized at least the old name or the new name, and isn't too "ancient".
It can:
It cannot yet:
How Has This Been Tested?
cargo test
passes with no problems.Checklist