I  updated  the SubstitutionFilter.java class in order to allow regexp on
the subst filters by using the operator "~>"  to state the first  argument
is a regexp. The default behavior is maintained if no operator  (i.e.
remove string) or "=>" is used

This is convenient for mass corrections or in case we'll have some tweaks
to apply on street address names to facilitate search, for example the
style entry below (Carlos!)

highway=* & name ~ '[Aa]venida [Dd]e [Ee]l .*' { add
streettype:movend='${name|subst:Avenida De El |subst:Avenida De el
|subst:Avenida de El |subst:Avenida de el |subst:avenida De El
|subst:avenida De el |subst:avenida de El |subst:avenida de el }'}

will become

highway=* & name ~ '[Aa]venida [Dd]e [Ee]l .*' { add
streettype:movedend='${name|subst:[Aa]venida [Dd]e [Ee]l ~>}'}


Technically, the change is minimal, it is just checking the filter operator
(=> or ~>) and using replaceAll() instead of replace() if "~>" is used.

Attached the updated class - I really hope it will be included and be
useful!

Cheers,
Enrico

Attachment: SubstitutionFilter.java
Description: Binary data

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

Reply via email to