You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proposed implementation is easy and should be done separately.
But when I read it I thought this should support something a bit more
complicated like falling back onto the main language if the sub-set is not
there, e.g. use es_ar if argentinian name is provided, else use es. There
must be some official algorithm for this, so we should not reinvent the
wheel.
This regular express is for the client (reader) side to handle potential fallback, correct?
NAME_LANGUAGE_PATTERN which I specified above is for the writer, which receives tags of the form:
name:language
unless we want to throw an exception where “language” isn’t specified in a specific way, using a more specific regex will just result in localized names to be thrown out.
From: Emux [mailto:[email protected]]
Sent: Tuesday, September 1, 2015 9:21 AM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
I think we should stick with the official regular expression. There will be
cases in OSM data where yet more, but wrong codes are used. We cannot cater
to every OSM data bug and probably using a few names is not the end of the
world (if it is important, this should be fixed in OSM data).
I think the fallback mechanism is difficult and not a regex problem.
Android must have an implementation of some sort as it falls back onto a
more general language when the specific one is not there. Maybe we should
just provide a simple implementation (e.g. fall back to 2-letter code if
longer code is not available, with a hook option it a user wanted a more
complicated mechanism).
changed the title [-]Preferred Language Extraction should allow more than 2 Characters for Language Specification[/-][+]Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification[/+]on Sep 2, 2015
Yes, because the data contains both “pt_br” and “pt-br,” which are obviously equivalent.
I propose that “-“ be used rather than “_” because “-“ is more common.
From: Emux [mailto:[email protected]]
Sent: Wednesday, September 9, 2015 11:18 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
As usual, there is a data quality issue in OSM. Is there really a point to
have a preferred_languages=* option? Without additional folding this does
not seem to be useful to anyone. I just cannot imagine a use case where
this makes sense.
As lincomatic's planet scan has shown, all these tags exist, but in the
whole scheme of things they are few, many of them errors, many (probably
well-) meant to mean something else, but the data such tagged is just not
useful.
To make this useful, additional folding would be needed, which would be
better spent on fixing the data in OSM.
Yes, because the data contains both “pt_br” and “pt-br,” which are
obviously equivalent.
I propose that “-“ be used rather than “_” because “-“ is more common.
From: Emux [mailto:[email protected]]
Sent: Wednesday, September 9, 2015 11:18 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Map-Writer Preferred Language Extraction should
allow more than 2 Characters for Language Specification (#663)
Is there really a point to have a preferred_languages=* option?
I'd say removing both * and - options.
1st leads to maps with practically unknown language content and 2nd is covered by not setting the option.
Not confusing the users, they should see a minimal command line API, i.e. setting only the needed languages or none.
Is there really a point to have a preferred_languages=* option?
I'd vote removing both * and - options.
1st leads to maps with practically unknown language content and 2nd is
covered by not setting the option.
Not confusing the users, they should see a minimal command line API, i.e.
setting only the needed languages or none.
—
Reply to this email directly or view it on GitHub #663 (comment)
.
That’s fine with me. I put * because it’s quite useful for testing/debugging the quality of the data, and mainly to see what languages are actually present.
From: Ludwig [mailto:[email protected]]
Sent: Thursday, September 10, 2015 11:41 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
Is there really a point to have a preferred_languages=* option?
I'd vote removing both * and - options.
1st leads to maps with practically unknown language content and 2nd is
covered by not setting the option.
Not confusing the users, they should see a minimal command line API, i.e.
setting only the needed languages or none.
—
Reply to this email directly or view it on GitHub #663 (comment)
.
changed the title [-]Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification[/-][+]Writer language improved parsing[/+]on Sep 13, 2015
Activity
lincomatic commentedon Aug 31, 2015
This appears to work OK:
or maybe should we should just use:
devemux86 commentedon Sep 1, 2015
That's a valid proposal.
Thanks @lincomatic for the regular expression examples.
ludwigb commentedon Sep 1, 2015
+1
The proposed implementation is easy and should be done separately.
But when I read it I thought this should support something a bit more
complicated like falling back onto the main language if the sub-set is not
there, e.g. use es_ar if argentinian name is provided, else use es. There
must be some official algorithm for this, so we should not reinvent the
wheel.
Ludwig.
On 1 September 2015 at 14:44, Emux [email protected] wrote:
devemux86 commentedon Sep 1, 2015
Based on http://www.w3.org/TR/xmlschema11-2/#language we could use something like:
@ludwigb fall back with regular expression or by code?
devemux86 commentedon Sep 1, 2015
Online regex debugger: https://regex101.com
lincomatic commentedon Sep 1, 2015
This regular express is for the client (reader) side to handle potential fallback, correct?
NAME_LANGUAGE_PATTERN which I specified above is for the writer, which receives tags of the form:
name:language
unless we want to throw an exception where “language” isn’t specified in a specific way, using a more specific regex will just result in localized names to be thrown out.
From: Emux [mailto:[email protected]]
Sent: Tuesday, September 1, 2015 9:21 AM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
Based on http://www.w3.org/TR/xmlschema11-2/#language we could use something like:
[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*
lincomatic commentedon Sep 1, 2015
Also, based on the example I extracted from the wiki above, the "_" may appear in a language specification as well.
devemux86 commentedon Sep 1, 2015
I wrote strictly a language regular expression (without the
name:prefix).This issue is about the writer, correct? What language we put in map file.
The reader will show what it'll find.
devemux86 commentedon Sep 1, 2015
(Following the rules in tagging is an never ending story)
We can always make regex more versatile.
ludwigb commentedon Sep 2, 2015
I think we should stick with the official regular expression. There will be
cases in OSM data where yet more, but wrong codes are used. We cannot cater
to every OSM data bug and probably using a few names is not the end of the
world (if it is important, this should be fixed in OSM data).
I think the fallback mechanism is difficult and not a regex problem.
Android must have an implementation of some sort as it falls back onto a
more general language when the specific one is not there. Maybe we should
just provide a simple implementation (e.g. fall back to 2-letter code if
longer code is not available, with a hook option it a user wanted a more
complicated mechanism).
Ludwig
On 2 September 2015 at 03:12, Emux [email protected] wrote:
devemux86 commentedon Sep 2, 2015
@ludwigb which are you referring to?
About fallback +1.
applantation commentedon Sep 2, 2015
[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*
On 3 September 2015 at 00:27, Emux [email protected] wrote:
[-]Preferred Language Extraction should allow more than 2 Characters for Language Specification[/-][+]Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification[/+]12 remaining items
devemux86 commentedon Sep 10, 2015
@lincomatic see also @ludwigb 's #624 (comment).
devemux86 commentedon Sep 10, 2015
With 94b0557 I pushed merging of '_' to '-' in writer.
lincomatic commentedon Sep 10, 2015
Yes, because the data contains both “pt_br” and “pt-br,” which are obviously equivalent.
I propose that “-“ be used rather than “_” because “-“ is more common.
From: Emux [mailto:[email protected]]
Sent: Wednesday, September 9, 2015 11:18 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
@lincomatic https://github.com/lincomatic thanks for checking that.
I'm reopening the issue to review the regular expression.
I would also like to propose that all "_" characters be rewritten as "-"
This way, "pt-br" will get merged with "pt_br," for instance.
You mean by code to make that conversion, the reason (and why not the reverse) ?
—
Reply to this email directly or view it on GitHub #663 (comment) . https://github.com/notifications/beacon/ABWzan5Wz30eo_9itNbUn_lwRQ5NAiqYks5owRgQgaJpZM4F1VTC.gif
ludwigb commentedon Sep 11, 2015
As usual, there is a data quality issue in OSM. Is there really a point to
have a preferred_languages=* option? Without additional folding this does
not seem to be useful to anyone. I just cannot imagine a use case where
this makes sense.
As lincomatic's planet scan has shown, all these tags exist, but in the
whole scheme of things they are few, many of them errors, many (probably
well-) meant to mean something else, but the data such tagged is just not
useful.
To make this useful, additional folding would be needed, which would be
better spent on fixing the data in OSM.
Ludwig
On 11 September 2015 at 07:07, lincomatic [email protected] wrote:
devemux86 commentedon Sep 11, 2015
I'd say removing both * and - options.
1st leads to maps with practically unknown language content and 2nd is covered by not setting the option.
Not confusing the users, they should see a minimal command line API, i.e. setting only the needed languages or none.
applantation commentedon Sep 11, 2015
+1
On 11 September 2015 at 14:11, Emux [email protected] wrote:
Map-Writer: improve name language pattern, #663
devemux86 commentedon Sep 11, 2015
I cannot confirm that in Java, "name:left" fails matching with 1-3.
(online regex testers may behave differently)
devemux86 commentedon Sep 11, 2015
I pushed an improved regex pattern, setting the 1st field to 1-3 characters and using non capturing group for the rest.
lincomatic commentedon Sep 11, 2015
That’s fine with me. I put * because it’s quite useful for testing/debugging the quality of the data, and mainly to see what languages are actually present.
From: Ludwig [mailto:[email protected]]
Sent: Thursday, September 10, 2015 11:41 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification (#663)
+1
On 11 September 2015 at 14:11, Emux [email protected] wrote:
—
Reply to this email directly or view it on GitHub #663 (comment) . https://github.com/notifications/beacon/ABWzavUsBumWZEJkowLvXz44QOEB8U6Rks5owm8SgaJpZM4F1VTC.gif
[-]Map-Writer Preferred Language Extraction should allow more than 2 Characters for Language Specification[/-][+]Writer language improved parsing[/+]devemux86 commentedon Sep 17, 2015
@ludwigb @lincomatic
Have you tested latest language regex pattern, is it ok?
lincomatic commentedon Sep 21, 2015
Looks good
From: Emux [mailto:[email protected]]
Sent: Wednesday, September 16, 2015 11:31 PM
To: mapsforge/mapsforge
Cc: lincomatic
Subject: Re: [mapsforge] Writer language improved parsing (#663)
@ludwigb https://github.com/ludwigb @lincomatic https://github.com/lincomatic
Have you tested latest language regex pattern, is it ok?
devemux86 commentedon Sep 22, 2015
Ok, as I have not seen either any problems, I'm closing this issue.