-
Notifications
You must be signed in to change notification settings - Fork 122
Combined name for basque language #2484
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: dev
Are you sure you want to change the base?
Conversation
I don't know what's wrong with the linter :( |
The linter is unrelated, I'm testing a fix but you can ignore that for now |
My expertise in python is quite limited. AFAIK, the assertion should be true or false, not None... I guess I'm missing something |
The test functions ( assert doesn't need to receive a real True or False, just something truthy or falsey :) |
Thank you for the PR submission. But first. This way of doing, it is a good practice attested by the community ? There is wiki page of forum about this ? |
I do not see what's the problem in this clause versus the rest of assertions I added
osmose-backend/plugins/Name_Multilingual.py Lines 368 to 378 in 6e17766
|
Basque community is not such, but standalone mappers. Due to the language (and the recent history) you know the naming is somehow conflictive. Besides, basque names plus spanish names generates a very long names (example, and also note the renaming the users do after normalization). This combined way is very usual in the basque country, much simpler than having By far, osmose name-multilingual error is one of the most repeated issues: |
Regarding the failing test: assert self.p.way(None, {"name": u"Vicente Blasco Ibañez kalea / Calle Vicente Blasco Ibáñez", "name:es": u"Calle Vicente Blasco Ibáñez", "name:eu": u"Vicente Blasco Ibañez kalea"}, None) means: check that there IS an issue with this combination of tags. (The analyser returns None at least something Falsely if there's nothing to complain about) However, the following piece of code: [
{"name": tags["name:"+lang[0]].strip()},
{"name": tags["name:"+lang[1]].strip()},
{"name": tags["name:"+lang[0]].strip() + separator + tags["name:"+lang[1]].strip()},
{"name": tags["name:"+lang[1]].strip() + separator + tags["name:"+lang[0]].strip()},
{"name": self.merge_sp_eu(tags["name:"+lang[0]], tags["name:"+lang[1]]).strip()}
] gives the following result on this input (for valid [
{'name': 'Calle Vicente Blasco Ibáñez'},
{'name': 'Vicente Blasco Ibañez kalea'},
{'name': 'Calle Vicente Blasco Ibáñez / Vicente Blasco Ibañez kalea'},
{'name': 'Vicente Blasco Ibañez kalea / Calle Vicente Blasco Ibáñez'},
{'name': ''}
] As you can see, the 4th option equals the p.s.: I'm a bit worried the |
I was misunderstanding how the |
Any reason to keep it open? |
I haven't had the time to review it yet, busy times. Sorry for the wait |
plugins/Name_Multilingual.py
Outdated
assert self.p.way(None, {"name": "Calle San Diego", "name:es": "", "name:eu": "San Diego kalea"}, None) | ||
assert self.p.way(None, {"name": "Kale Nagusia", "name:es": "Calle Mayor", "name:eu": ""}, None) |
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.
assert self.p.way(None, {"name": "Calle San Diego", "name:es": "", "name:eu": "San Diego kalea"}, None) | |
assert self.p.way(None, {"name": "Kale Nagusia", "name:es": "Calle Mayor", "name:eu": ""}, None) | |
assert self.p.way(None, {"name": "Calle San Diego"}, None) | |
assert self.p.way(None, {"name:eu": "San Diego kalea"}, None) | |
assert self.p.way(None, {"name:es": "Calle Mayor"}, None) | |
assert self.p.way(None, {"name": "Calle San Diego", "name:eu": "San Diego kalea"}, None) | |
assert self.p.way(None, {"name": "Calle San Diego", "name:es": "", "name:eu": "San Diego kalea"}, None) | |
assert self.p.way(None, {"name": "Kale Nagusia", "name:es": "Calle Mayor"}, None) | |
assert self.p.way(None, {"name": "Kale Nagusia", "name:es": "Calle Mayor", "name:eu": ""}, None) |
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.
I'd say the failing test come from this change. As I understand, it's not the same, since what I was testing in the first clause was the presence of name
and name:eu
, with different values, and not name:es
. And similar for the second one: name
and name:es
different, and no name:eu
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.
No sure to understand your response. The function should not fails.
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.
Look at the failing job: it fails just for these changes you made. Undo these changes and letś try again.
AFAI understand you're not testing the same case I did, aren't you? I wanted to test the cases I before-commented: two tags, name and name:lang, different values each other. It should warn the user "hey, something is missing here"
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.
I remove when there is only name
.
The code should not crash, even if there is nothing to be done.
I add few tests, than fails. Please can you review my changes. |
@Crashillo I think, there is a misunderstanding here. The tests need to pass for only one name variant. Actually it crash. The plugin could not crash, it stops the whole check for the "country". I cannot merge a plugin that crash. See. I run it on real data, and as I expected, it crash.
|
I don't understand what do you mean with this. The goal of the PR is about allowing the combined form as a valid result. Look at the following table: it has a more readable view of the test cases. I hope you understand what's the purpose of this PR:
|
Due to the so long names presents in the Basque country, both basque and spanish ways, is quite common they're shorted through the common parts.
This PR introduces a function to merge two names, as another valid form for naming inside the sp_eu rule
For instance: