| | 302 | *[min_height][min_height =~ /^-?[0-9]+(\.[0-9]+)?(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 303 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 304 | fixAdd: concat("min_height=", get(regexp_match("(-?[0-9.]+)( )*(.+)",tag("min_height")),1)," m"); |
| | 305 | set min_height_meter_autofix; |
| | 306 | assertMatch: "node min_height=6.78 meters"; |
| | 307 | assertMatch: "node min_height=5 metre"; |
| | 308 | assertMatch: "node min_height=2m"; |
| | 309 | assertNoMatch: "node min_height=2 m"; |
| | 310 | assertNoMatch: "node min_height=5"; |
| | 311 | } |
| | 312 | *[min_height][min_height =~ /^-?[0-9]+(\.[0-9]+)?(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 313 | throwWarning: tr("unusual value of {0}: use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 314 | fixAdd: concat("min_height=", get(regexp_match("(-?[0-9.]+)( )*(.+)",tag("min_height")),1)," ft"); |
| | 315 | set min_height_foot_autofix; |
| | 316 | assertMatch: "node min_height=6.78 foot"; |
| | 317 | assertMatch: "node min_height=5 Feet"; |
| | 318 | assertMatch: "node min_height=2ft"; |
| | 319 | assertNoMatch: "node min_height=2 ft"; |
| | 320 | assertNoMatch: "node min_height=5"; |
| | 321 | } |
| | 322 | *[min_height][min_height =~ /^-?[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| | 323 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| | 324 | fixAdd: concat("min_height=", replace(tag("min_height"), ",", ".")); |
| | 325 | set min_height_separator_autofix; |
| | 326 | assertMatch: "node min_height=5,5"; |
| | 327 | assertMatch: "node min_height=12,00"; |
| | 328 | assertMatch: "node min_height=12,5 ft"; |
| | 329 | assertNoMatch: "node min_height=12,000"; |
| | 330 | assertNoMatch: "node min_height=3,50,5"; |
| | 331 | assertNoMatch: "node min_height=3.5"; |
| | 332 | assertNoMatch: "node min_height=4"; |
| | 333 | } |
| | 334 | *[min_height ][min_height !~ /^(-?([0-9]+(\.[0-9]+)?( (m|ft))?)|(-?[1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.min_height_separator_autofix!.min_height_meter_autofix!.min_height_foot_autofix { |
| | 335 | throwWarning: tr("unusual value of {0}: {1} is default; point is decimal separator; if units, put space then unit", "{0.key}", tr("meters")); |
| | 336 | assertMatch: "node min_height=\"12. m\""; |
| | 337 | assertNoMatch: "node min_height=-5"; |
| | 338 | } |
| | 339 | |