Read an anchored short form back in the app - #62
Merged
Merged
Conversation
A line such as "-98NM9 near Old Toronto, Ontario, Canada", typed, pasted or selected in another app, is now read: the place is found by name in the website's index, then in the landmark archive, and the five characters are recovered against the archive's own coordinates for it, the ones the sender's list was drawn from. The anchor list then offers the same landmark first, so passing the place on keeps its reference. Anything short of one certain landmark is refused with the reason and the place stays where it was: nothing called that, a name several places answer to, a name that is not unique in its own region (Salem, Ontario is in the index once and not in the archive at all), or no connection. An anchored line is never recovered against wherever the screen is: -98NM9 read against London names a real place three kilometres east of Westminster, and a test fails if that path ever comes back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The app now reads the line it shares,
-98NM9 near Old Toronto, Ontario, Canada. It can arrive typed or pasted into the search field, or as text selected in another app. A line retyped without its dash or in other capitals reads too.Name, Regionmatches is kept: as written first, then folded, soTra Mhor, Munster, Irelandfinds Trá Mhór.Refused, with the reason, and nothing moves
... near Nowhereville, Ontario, Canada... near Scarborough... near Salem, Ontario, CanadaA name on its own is accepted only when nothing else in the index shares it (
CN Tower).An anchored line is never recovered against wherever the screen is. A bare short form is, on purpose: the place shown is the reader's own reference. An anchored one names its reference, and recovering it against anything else names somewhere plausible and wrong. Read against London,
-98NM9is#R0NJ0-98NM9, a real place about 2.8 km east of Westminster.PlaceState.openedrefuses rather than guessing, and a test fails if that ever changes.Checks
AnchoredTest(14 tests), on live index rows and archive entries:#G3RJM-98NM9#R0NJ0-98NM9, and taking the first of several Scarboroughs picked the English one.#G3RJM-98NM9with Old City Hall chosen in the anchor list.