Repository navigation
Improve name:latin logic - #147
Conversation
ℹ️ Base Logs 34f2be7ℹ️ This Branch Logs 0c8d9e9 |
1ec5
left a comment
There was a problem hiding this comment.
Looks good to me at a glance. The notes below are only for completeness, but I’m glad my penchant for proper typography won’t cause OpenStreetMap Americana’s labels to be translated into QIDs going forward. 😅
| // Name tags that should be eligible for finding a latin name. | ||
| // See https://wiki.openstreetmap.org/wiki/Multilingual_names | ||
| private static final Predicate<String> VALID_NAME_TAGS = | ||
| Pattern.compile("^name:[a-z]{2,3}(-[a-z]{4})?([-_][a-z]{2,})?(-[a-z]{2})?$", Pattern.CASE_INSENSITIVE) |
There was a problem hiding this comment.
Technically, BCP 47 allows a UN M49 region code in place of an ISO 3166-1 country code, but the only extant occurrences are mere coincidences, all of them instances of mistagging.
The abc-x-extension syntax is also permitted for unregistered extensions, but name:fr-x-gallo is the only key with non-negligible use, for Gallo.
There was a problem hiding this comment.
Thanks! Added those cases and they pass now. The transliteration improvements will be a larger project, will need to tackle that in a separate change later.
* name:latin improvements * improve latin letter regex * allow region codes and x-extension's on localized names
|



Simplify/improve latin character regular expressions and limit
name:latinlookup to just language-specificname:*tags and not tags likename:prefixorname:etymology:wikidata. Does not attempt to improve transliteration, that will be a future change.Fixes #146 and partially improves #86.