Substring returns full string

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Substring returns full string

gbbickerton
I have
(ncn=yes | rcn=yes) { name '${rcnname | substring:1:14}'} [0x10018 resolution 22 continue with_actions]
in my lines file, rcnname is 123456789123456789 for test purposes,  I get the full string showing on the map in basecamp not the  1 - 14 substring am I doing something wrong ?
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

steve sgalowski
i am unshure why , but gbbickerton , is always ending up in my spam , box from this list 

has this e-mail been tanted on black lists , does any one else have this problem on the list ?


On Fri, Nov 28, 2014 at 6:32 AM, gbbickerton <[hidden email]> wrote:
I have
(ncn=yes | rcn=yes) { name '${rcnname | substring:1:14}'} [0x10018
resolution 22 continue with_actions]
in my lines file, rcnname is 123456789123456789 for test purposes,  I get
the full string showing on the map in basecamp not the  1 - 14 substring am
I doing something wrong ?



--
View this message in context: http://gis.19327.n5.nabble.com/Substring-returns-full-string-tp5825603.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Gerd Petermann
Hi Steve,

you are right, I don't even find it as spam in my outlook.com mailbox.

Gerd

steve sgalowski wrote
i am unshure why , but gbbickerton , is always ending up in my spam , box
from this list

has this e-mail been tanted on black lists , does any one else have this
problem on the list ?


On Fri, Nov 28, 2014 at 6:32 AM, gbbickerton <[hidden email]> wrote:

> I have
> (ncn=yes | rcn=yes) { name '${rcnname | substring:1:14}'} [0x10018
> resolution 22 continue with_actions]
> in my lines file, rcnname is 123456789123456789 for test purposes,  I get
> the full string showing on the map in basecamp not the  1 - 14 substring am
> I doing something wrong ?
>
>
>
> --
> View this message in context:
> http://gis.19327.n5.nabble.com/Substring-returns-full-string-tp5825603.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

gbbickerton
I have not had this problem with my email before that I know of, however it does not solve my problem what I want is a way to shorten names to say the first two words as some are very long.
 I have also tried  
{ name '${rcnname|part:"\s<2"}'} but I am not sure how to separate at spaces I have tried ' ' etc without success
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Gerd Petermann
Hi,

try without the blanks:
(ncn=yes | rcn=yes) { name '${rcnname|substring:1:14}'} [0x10018 resolution 22 continue with_actions]

Gerd

gbbickerton wrote
I have not had this problem with my email before that I know of, however it does not solve my problem what I want is a way to shorten names to say the first two words as some are very long.
 I have also tried  
{ name '${rcnname|part:"\s<2"}'} but I am not sure how to separate at spaces I have tried ' ' etc without success
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Gerd Petermann
Hi Steve,

I don't know where to fix that.
In <a class="header" href="eclipse-javadoc:%E2%98%82=mkgmap/src%3Cuk.me.parabola.mkgmap.osmstyle.actions%7BValueBuilder.java%E2%98%83ValueBuilder">ValueBuilder.addFilter()
we receive the string  " substring:1:14"
(with the leading blank) and that is not removed, so we don't match "substring".

Gerd

> Date: Fri, 28 Nov 2014 01:04:50 -0700

> From: [hidden email]
> To: [hidden email]
> Subject: Re: [mkgmap-dev] Substring returns full string
>
> Hi,
>
> try without the blanks:
> (ncn=yes | rcn=yes) { name '${rcnname|substring:1:14}'} [0x10018 resolution
> 22 continue with_actions]
>
> Gerd
>
>
> gbbickerton wrote
> > I have not had this problem with my email before that I know of, however
> > it does not solve my problem what I want is a way to shorten names to say
> > the first two words as some are very long.
> > I have also tried
> > { name '${rcnname|part:"\s<2"}'} but I am not sure how to separate at
> > spaces I have tried ' ' etc without success
>
>
>
>
>
> --
> View this message in context: http://gis.19327.n5.nabble.com/Substring-returns-full-string-tp5825603p5825665.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Steve Ratcliffe
On 28/11/14 08:24, Gerd Petermann wrote:
> I don't know where to fix that.
> In ValueBuilder
> <eclipse-javadoc:%E2%98%82=mkgmap/src%3Cuk.me.parabola.mkgmap.osmstyle.actions%7BValueBuilder.java%E2%98%83ValueBuilder>.addFilter()
> we receive the string  " substring:1:14"
> (with the leading blank) and that is not removed, so we don't match
> "substring".

OK I will look into it. I'm a bit surprised - there is a test that has
spaces around the '|' symbols.

..Steve
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Steve Ratcliffe
In reply to this post by Gerd Petermann

Hi Gerd

> In ValueBuilder

> we receive the string  " substring:1:14"
> (with the leading blank) and that is not removed, so we don't match

OK, so this works if you quote the argument:
   '${rcnname | substring:"1:14"}'

but not with the old syntax.

The attached patch fixes this and I think it is safe against
breaking existing styles.  If it does break old styles, then
it will have to be un-applied - in general the old syntax
is ambiguous.

I've added an error check for when an unknown filter is seen,
which should make it obvious when something like this happens.

..Steve

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Spaces_around__|__fails_with_old_arg_syntax_.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Gerd Petermann
Hi Steve,

I tried it with a few popular styles and saw no error message, so
I think it will not cause problems.

Gerd

Steve Ratcliffe wrote
Hi Gerd

> In ValueBuilder

> we receive the string  " substring:1:14"
> (with the leading blank) and that is not removed, so we don't match

OK, so this works if you quote the argument:
   '${rcnname | substring:"1:14"}'

but not with the old syntax.

The attached patch fixes this and I think it is safe against
breaking existing styles.  If it does break old styles, then
it will have to be un-applied - in general the old syntax
is ambiguous.

I've added an error check for when an unknown filter is seen,
which should make it obvious when something like this happens.

..Steve

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Spaces_around__|__fails_with_old_arg_syntax_.patch (2K) <http://gis.19327.n5.nabble.com/attachment/5825704/0/Spaces_around__%7C__fails_with_old_arg_syntax_.patch>
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

Steve Ratcliffe
On 28/11/14 13:43, GerdP wrote:
> I tried it with a few popular styles and saw no error message, so
> I think it will not cause problems.

OK thanks I will commit it then.

..Steve
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Substring returns full string

gbbickerton
May i suggest  that a test is made to check that the string is long enough before applying this filter otherwise an exception occurs .It would be unsafe to use this filter in any style without such a test.