| 57 | | *[height][height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| | 57 | *[height][height =~ /^[0-9]+\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/], |
| | 58 | *[maxheight][maxheight =~ /^[1-9][0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/], |
| | 59 | *[maxlength][maxlength =~ /^[1-9][0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/], |
| | 60 | *[width][width=~ /^[0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/], |
| | 61 | *[maxwidth][maxwidth=~ /^[0-9]*\.?[0-9]*(( )*(metre|metres|meter|meters|Metre|Metres|Meter|Meters)|m)$/] { |
| | 62 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 63 | set meter_abb_autofix; |
| | 64 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," m"); |
| | 65 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," m"); |
| | 66 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," m"); |
| | 67 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," m"); |
| | 68 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," m"); |
| | 69 | assertMatch: "node maxlength=6.78 meters"; |
| | 70 | assertMatch: "way maxheight=5 metre"; |
| | 71 | assertMatch: "node width=2m"; |
| | 72 | assertNoMatch: "node maxwidth=2 m"; |
| | 73 | assertNoMatch: "relation height=5"; |
| | 74 | } |
| | 75 | *[height][height =~ /^[0-9]+\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/], |
| | 76 | *[maxheight][maxheight =~ /^[1-9][0-9]*\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/], |
| | 77 | *[maxlength][maxlength =~ /^[1-9][0-9]*\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/], |
| | 78 | *[width][width =~ /^[0-9]*\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/], |
| | 79 | *[maxwidth][maxwidth =~ /^[0-9]*\.?[0-9]*(( )*(foot|Foot|feet|Feet)|ft)$/] { |
| | 80 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 81 | set foot_abb_autofix; |
| | 82 | fixAdd: concat("height=", get(regexp_match("([0-9.]+)( )*(.+)",tag("height")),1)," ft"); |
| | 83 | fixAdd: concat("maxheight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxheight")),1)," ft"); |
| | 84 | fixAdd: concat("maxlength=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxlength")),1)," ft"); |
| | 85 | fixAdd: concat("width=", get(regexp_match("([0-9.]+)( )*(.+)",tag("width")),1)," ft"); |
| | 86 | fixAdd: concat("maxwidth=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxwidth")),1)," ft"); |
| | 87 | assertMatch: "node maxlength=6.78 foot"; |
| | 88 | assertMatch: "way maxheight=5 Feet"; |
| | 89 | assertMatch: "node width=2ft"; |
| | 90 | assertNoMatch: "node maxwidth=2 ft"; |
| | 91 | assertNoMatch: "relation height=5"; |
| | 92 | } |
| | 93 | *[height][height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/], |
| | 94 | *[maxheight][maxheight =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/], |
| | 95 | *[maxlength][maxlength =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/], |
| | 96 | *[width][width =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/], |
| | 97 | *[maxwidth][maxwidth =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| 64 | | assertNoMatch: "node height=12,000"; |
| 65 | | assertNoMatch: "node height=3,50,5"; |
| 66 | | assertNoMatch: "node height=3.5"; |
| 67 | | assertNoMatch: "node height=4"; |
| 68 | | } |
| 69 | | *[height][height !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.height_separator_autofix { |
| 70 | | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}"); |
| 71 | | assertMatch: "node height=medium"; |
| 72 | | assertMatch: "node height=-5"; |
| 73 | | assertNoMatch: "node height=2 m"; |
| 74 | | assertNoMatch: "node height=5"; |
| 75 | | assertNoMatch: "node height=7.8"; |
| 76 | | assertNoMatch: "node height=20 ft"; |
| 77 | | assertNoMatch: "node height=22'"; |
| 78 | | } |
| 79 | | |
| 80 | | *[maxheight][maxheight =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| 81 | | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| 82 | | fixAdd: concat("maxheight=", replace(tag("maxheight"), ",", ".")); |
| 83 | | set maxheight_separator_autofix; |
| 84 | | assertMatch: "node maxheight=5,5"; |
| 85 | | assertMatch: "node maxheight=12,00"; |
| 86 | | assertMatch: "node maxheight=12,5 ft"; |
| 87 | | assertNoMatch: "node maxheight=12,000"; |
| 88 | | assertNoMatch: "node maxheight=3,50,5"; |
| | 108 | assertNoMatch: "way height=12,000"; |
| | 109 | assertNoMatch: "node width=3,50,5"; |
| 102 | | assertNoMatch: "node maxheight=16'3\""; |
| 103 | | } |
| 104 | | |
| 105 | | *[width][width =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| 106 | | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| 107 | | fixAdd: concat("width=", replace(tag("width"), ",", ".")); |
| 108 | | set width_separator_autofix; |
| 109 | | assertMatch: "node width=5,5"; |
| 110 | | assertMatch: "node width=12,00"; |
| 111 | | assertNoMatch: "node width=12,000"; |
| 112 | | assertNoMatch: "node width=3,50,5"; |
| 113 | | assertNoMatch: "node width=3.5"; |
| 114 | | assertNoMatch: "node width=4"; |
| 115 | | } |
| 116 | | *[width][width !~ /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/]!.width_separator_autofix { |
| 117 | | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}"); |
| 118 | | assertMatch: "way width=something"; |
| 119 | | assertMatch: "way width=-5"; |
| 120 | | assertNoMatch: "way width=3"; |
| 121 | | assertNoMatch: "way width=0.5"; |
| 122 | | assertNoMatch: "way width=1 m"; |
| 123 | | assertNoMatch: "way width=10 ft"; |
| 124 | | assertNoMatch: "way width=1'"; |
| 128 | | *[maxwidth][maxwidth =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] { |
| 129 | | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}"); |
| 130 | | fixAdd: concat("maxwidth=", replace(tag("maxwidth"), ",", ".")); |
| 131 | | set maxwidth_separator_autofix; |
| 132 | | assertMatch: "node maxwidth=5,5"; |
| 133 | | assertMatch: "node maxwidth=12,00"; |
| 134 | | assertNoMatch: "node maxwidth=12,000"; |
| 135 | | assertNoMatch: "node maxwidth=3,50,5"; |
| 136 | | assertNoMatch: "node maxwidth=3.5"; |
| 137 | | assertNoMatch: "node maxwidth=4"; |
| | 130 | *[maxweight][maxweight =~ /^[0-9]*\.?[0-9]*(( )*(T|ton|tons|Ton|Tons)|t)$/], |
| | 131 | *[maxaxleload][maxaxleload =~ /^[0-9]*\.?[0-9]*(( )*(T|ton|tons|Ton|Tons)|t)$/] { |
| | 132 | throwWarning: tr("Unit of {0} in long form: Use abbreviation for unit and space between value and unit", "{0.key}"); |
| | 133 | set ton_abb_autofix; |
| | 134 | fixAdd: concat("maxweight=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxweight")),1)," t"); |
| | 135 | fixAdd: concat("maxaxleload=", get(regexp_match("([0-9.]+)( )*(.+)",tag("maxaxleload")),1)," t"); |
| | 136 | assertMatch: "node maxaxleload=6.78 Tons"; |
| | 137 | assertMatch: "way maxweight=5ton"; |
| | 138 | assertMatch: "node maxweight=2 T"; |
| | 139 | assertMatch: "node maxweight=2t"; |
| | 140 | assertNoMatch: "node maxaxleload=2 t"; |
| | 141 | assertNoMatch: "relation maxweight=5"; |
| | 142 | assertNoMatch: "way maxweight=5,7"; |
| 139 | | *[maxwidth][maxwidth !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxwidth_separator_autofix { |
| 140 | | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}"); |
| 141 | | assertMatch: "way maxwidth=something"; |
| 142 | | assertMatch: "way maxwidth=-5"; |
| 143 | | assertNoMatch: "way maxwidth=2"; |
| 144 | | assertNoMatch: "way maxwidth=6'6\""; |
| 145 | | assertNoMatch: "way maxwidth=2.5"; |
| 146 | | assertNoMatch: "way maxwidth=7 ft"; |
| 147 | | } |
| 148 | | |
| 149 | | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|lbs))?$/] { |
| | 144 | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/], |
| | 145 | *[maxaxleload][maxaxleload =~ /^[0-9]+,[0-9][0-9]?( (t|kg|st|lbs))?$/] { |