| | 57 | *[height][height =~ /^[0-9]+\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 58 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 59 | set height_meter_autofix; |
| | 60 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," m"); |
| | 61 | assertMatch: "node height=6.78 meters"; |
| | 62 | assertMatch: "way height=5 metre"; |
| | 63 | assertMatch: "node height=2m"; |
| | 64 | assertNoMatch: "node height=2 m"; |
| | 65 | assertNoMatch: "relation height=5"; |
| | 66 | } |
| | 67 | *[height][height =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 68 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 69 | set height_foot_autofix; |
| | 70 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," ft"); |
| | 71 | assertMatch: "node height=6.78 foot"; |
| | 72 | assertMatch: "way height=5 Feet"; |
| | 73 | assertMatch: "node height=2ft"; |
| | 74 | assertNoMatch: "node height=2 ft"; |
| | 75 | assertNoMatch: "relation height=5"; |
| | 76 | } |
| | 100 | *[maxheight][maxheight =~ /^[1-9][0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 101 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 102 | set maxheight_meter_autofix; |
| | 103 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," m"); |
| | 104 | assertMatch: "node maxheight=6.78 meters"; |
| | 105 | assertMatch: "way maxheight=5 metre"; |
| | 106 | assertMatch: "node maxheight=2m"; |
| | 107 | assertNoMatch: "node maxheight=2 m"; |
| | 108 | assertNoMatch: "relation maxheight=5"; |
| | 109 | } |
| | 110 | *[maxheight][maxheight =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 111 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 112 | set maxheight_foot_autofix; |
| | 113 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," ft"); |
| | 114 | assertMatch: "node maxheight=6.78 foot"; |
| | 115 | assertMatch: "way maxheight=5 Feet"; |
| | 116 | assertMatch: "node maxheight=2ft"; |
| | 117 | assertNoMatch: "node maxheight=2 ft"; |
| | 118 | assertNoMatch: "relation maxheight=5"; |
| | 119 | } |
| | 145 | *[maxlength][maxlength =~ /^[1-9][0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 146 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 147 | set maxlength_meter_autofix; |
| | 148 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," m"); |
| | 149 | assertMatch: "node maxlength=6.78 meters"; |
| | 150 | assertMatch: "way maxlength=5 metre"; |
| | 151 | assertMatch: "node maxlength=2m"; |
| | 152 | assertNoMatch: "node maxlength=2 m"; |
| | 153 | assertNoMatch: "relation maxlength=5"; |
| | 154 | } |
| | 155 | *[maxlength][maxlength =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 156 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 157 | set maxlength_foot_autofix; |
| | 158 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," ft"); |
| | 159 | assertMatch: "node maxlength=6.78 foot"; |
| | 160 | assertMatch: "way maxlength=5 Feet"; |
| | 161 | assertMatch: "node maxlength=2ft"; |
| | 162 | assertNoMatch: "node maxlength=2 ft"; |
| | 163 | assertNoMatch: "relation maxlength=5"; |
| | 164 | } |
| | 165 | *[maxlength][maxlength =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| | 166 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| | 167 | fixAdd: concat("maxlength=", replace(tag("maxlength"), ",", ".")); |
| | 168 | set maxlength_separator_autofix; |
| | 169 | assertMatch: "node maxlength=5,5"; |
| | 170 | assertMatch: "node maxlength=12,00"; |
| | 171 | assertMatch: "way maxlength=12,5 ft"; |
| | 172 | assertNoMatch: "node maxlength=12,000"; |
| | 173 | assertNoMatch: "node maxlength=3,50,5"; |
| | 174 | assertNoMatch: "way maxlength=3.5"; |
| | 175 | assertNoMatch: "node maxlength=4"; |
| | 176 | } |
| | 177 | *[maxlength][maxlength !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxlength_separator_autofix!.maxlength_meter_autofix!.maxlength_foot_autofix { |
| | 178 | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}"); |
| | 179 | assertMatch: "node maxlength=something"; |
| | 180 | assertMatch: "way maxlength=-5"; |
| | 181 | assertMatch: "node maxlength=0"; |
| | 182 | assertNoMatch: "node maxlength=4"; |
| | 183 | assertNoMatch: "node maxlength=3.5"; |
| | 184 | assertNoMatch: "way maxlength=2 m"; |
| | 185 | assertNoMatch: "node maxlength=14 ft"; |
| | 186 | assertNoMatch: "node maxlength=10'"; |
| | 187 | assertNoMatch: "node maxlength=16'3\""; |
| | 188 | } |
| | 189 | |
| | 190 | *[width][width =~ /^[0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 191 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 192 | set width_meter_autofix; |
| | 193 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," m"); |
| | 194 | assertMatch: "node width=6.78 meters"; |
| | 195 | assertMatch: "way width=5 metre"; |
| | 196 | assertMatch: "node width=2m"; |
| | 197 | assertNoMatch: "node width=2 m"; |
| | 198 | assertNoMatch: "relation width=5"; |
| | 199 | } |
| | 200 | *[width][width =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 201 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 202 | set width_foot_autofix; |
| | 203 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," ft"); |
| | 204 | assertMatch: "node width=6.78 foot"; |
| | 205 | assertMatch: "way width=5 Feet"; |
| | 206 | assertMatch: "node width=2ft"; |
| | 207 | assertNoMatch: "node width=2 ft"; |
| | 208 | assertNoMatch: "relation width=5"; |
| | 209 | } |
| | 233 | *[maxwidth][maxwidth=~ /^[0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 234 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 235 | set maxwidth_meter_autofix; |
| | 236 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," m"); |
| | 237 | assertMatch: "node maxwidth=6.78 meters"; |
| | 238 | assertMatch: "way maxwidth=5 metre"; |
| | 239 | assertMatch: "node maxwidth=2m"; |
| | 240 | assertNoMatch: "node maxwidth=2 m"; |
| | 241 | assertNoMatch: "relation maxwidth=5"; |
| | 242 | } |
| | 243 | *[maxwidth][maxwidth =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 244 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 245 | set maxwidth_foot_autofix; |
| | 246 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," ft"); |
| | 247 | assertMatch: "node maxwidth=6.78 foot"; |
| | 248 | assertMatch: "way maxwidth=5 Feet"; |
| | 249 | assertMatch: "node maxwidth=2ft"; |
| | 250 | assertNoMatch: "node maxwidth=2 ft"; |
| | 251 | assertNoMatch: "relation maxwidth=5"; |
| | 252 | } |
| 149 | | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|lbs))?$/] { |
| | 274 | *[maxaxleload][maxaxleload =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/] { |
| | 275 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| | 276 | fixAdd: concat("maxaxleload=", replace(tag("maxaxleload"), ",", ".")); |
| | 277 | set maxaxleload_separator_autofix; |
| | 278 | assertMatch: "node maxaxleload=5,5"; |
| | 279 | assertMatch: "way maxaxleload=12,00"; |
| | 280 | assertNoMatch: "node maxaxleload=12,000"; |
| | 281 | assertNoMatch: "way maxaxleload=3,50,5"; |
| | 282 | assertNoMatch: "node maxaxleload=3.5"; |
| | 283 | assertNoMatch: "way maxaxleload=4"; |
| | 284 | } |
| | 285 | *[maxaxleload][maxaxleload !~ /^(([0-9]+\.?[0-9]*( (t|kg|st|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxaxleload_separator_autofix { |
| | 286 | throwWarning: tr("unusual value of {0}: tonne is default; point is decimal separator; if units, put space then unit", "{0.key}"); |
| | 287 | assertMatch: "node maxaxleload=something"; |
| | 288 | assertMatch: "way maxaxleload=-5"; |
| | 289 | assertNoMatch: "node maxaxleload=2"; |
| | 290 | assertNoMatch: "way maxaxleload=6'6\""; |
| | 291 | assertNoMatch: "node maxaxleload=2.5"; |
| | 292 | assertNoMatch: "way maxaxleload=7 kg"; |
| | 293 | } |
| | 294 | |
| | 295 | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/] { |