Changeset 5475 in josm


Ignore:
Timestamp:
2012-08-24T13:24:55+02:00 (7 years ago)
Author:
bastiK
Message:

applied #7811 - Vague "Suspicious tag/value combinations" message for absent denomination tag (patch by mrwojo, slightly modified)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/ignoretags.cfg

    r5379 r5475  
    220220K:relation=from
    221221;
    222 ; Religious Key/Value Pairs
    223 ;
    224 T:religion=christian|denomination=anglican
    225 T:religion=muslim|denomination=alaouite
    226 T:religion=jewish|denomination=alternative
    227 T:religion=christian|denomination=apostolic
    228 T:religion=jewish|denomination=ashkenazi
    229 T:religion=christian|denomination=baptist
    230 T:religion=christian|denomination=catholic
    231 T:religion=christian|denomination=christian_community
    232 T:religion=christian|denomination=christian_scientist
    233 T:religion=jewish|denomination=conservative
    234 T:religion=christian|denomination=coptic_orthodox
    235 T:religion=christian|denomination=czechoslovak_hussite
    236 T:religion=muslim|denomination=druze
    237 T:religion=christian|denomination=dutch_reformed
    238 T:religion=christian|denomination=evangelical
    239 T:religion=pastafarian|denomination=EVKdFSMiD
    240 T:religion=christian|denomination=foursquare
    241 T:religion=christian|denomination=greek_orthodox
    242 T:religion=jewish|denomination=hasidic
    243 T:religion=jewish|denomination=humanistic
    244 T:religion=muslim|denomination=ibadi
    245 T:religion=muslim|denomination=ismaili
    246 T:religion=christian|denomination=jehovahs_witness
    247 T:religion=christian|denomination=kabbalah
    248 T:religion=christian|denomination=karaite
    249 T:religion=jewish|denomination=liberal
    250 T:religion=christian|denomination=living_waters_church
    251 T:religion=christian|denomination=lutheran
    252 T:religion=christian|denomination=maronite
    253 T:religion=other|denomination=masonic
    254 T:religion=christian|denomination=mennonite
    255 T:religion=christian|denomination=methodist
    256 T:religion=jewish|denomination=modern_orthodox
    257 T:religion=christian|denomination=mormon
    258 T:religion=jewish|denomination=neo_orthodox
    259 T:religion=christian|denomination=new_apostolic
    260 T:religion=christian|denomination=nondenominational
    261 T:religion=jewish|denomination=nondenominational
    262 T:religion=muslim|denomination=nondenominational
    263 T:religion=christian|denomination=old_catholic
    264 T:religion=christian|denomination=orthodox
    265 T:religion=jewish|denomination=orthodox
    266 T:religion=christian|denomination=pentecostal
    267 T:religion=christian|denomination=presbyterian
    268 T:religion=jewish|denomination=progressive
    269 T:religion=christian|denomination=protestant
    270 T:religion=christian|denomination=quaker
    271 T:religion=jewish|denomination=reconstructionist
    272 T:religion=jewish|denomination=reform
    273 T:religion=jewish|denomination=renewal
    274 T:religion=christian|denomination=roman_catholic
    275 T:religion=christian|denomination=russian_orthodox
    276 T:religion=christian|denomination=salvation_army
    277 T:religion=jewish|denomination=samaritan
    278 T:religion=christian|denomination=seventh_day_adventist
    279 T:religion=muslim|denomination=shia
    280 T:religion=muslim|denomination=sunni
    281 T:religion=jewish|denomination=ultra_orthodox
    282 T:religion=christian|denomination=united
    283 T:religion=christian|denomination=united_reformed
    284 T:religion=christian|denomination=uniting
     222; Christian Denominations
     223;
     224K:denomination=anglican
     225K:denomination=apostolic
     226K:denomination=baptist
     227K:denomination=catholic
     228K:denomination=christian_community
     229K:denomination=christian_scientist
     230K:denomination=coptic_orthodox
     231K:denomination=czechoslovak_hussite
     232K:denomination=dutch_reformed
     233K:denomination=evangelical
     234K:denomination=foursquare
     235K:denomination=greek_orthodox
     236K:denomination=jehovahs_witness
     237K:denomination=kabbalah
     238K:denomination=karaite
     239K:denomination=living_waters_church
     240K:denomination=lutheran
     241K:denomination=maronite
     242K:denomination=mennonite
     243K:denomination=methodist
     244K:denomination=mormon
     245K:denomination=new_apostolic
     246K:denomination=nondenominational
     247K:denomination=old_catholic
     248K:denomination=orthodox
     249K:denomination=pentecostal
     250K:denomination=presbyterian
     251K:denomination=protestant
     252K:denomination=quaker
     253K:denomination=roman_catholic
     254K:denomination=russian_orthodox
     255K:denomination=salvation_army
     256K:denomination=seventh_day_adventist
     257K:denomination=united
     258K:denomination=united_reformed
     259K:denomination=uniting
     260;
     261; Jewish Denominations
     262;
     263K:denomination=alternative
     264K:denomination=ashkenazi
     265K:denomination=conservative
     266K:denomination=hasidic
     267K:denomination=humanistic
     268K:denomination=liberal
     269K:denomination=modern_orthodox
     270K:denomination=neo_orthodox
     271K:denomination=nondenominational
     272K:denomination=orthodox
     273K:denomination=progressive
     274K:denomination=reconstructionist
     275K:denomination=reform
     276K:denomination=renewal
     277K:denomination=samaritan
     278K:denomination=ultra_orthodox
     279;
     280; Muslim Denominations
     281;
     282K:denomination=alaouite
     283K:denomination=druze
     284K:denomination=ibadi
     285K:denomination=ismaili
     286K:denomination=nondenominational
     287K:denomination=shia
     288K:denomination=sunni
     289;
     290; Pastafarian Denominations
     291;
     292K:denomination=EVKdFSMiD
     293;
     294; Other Denominations
     295;
     296K:denomination=masonic
    285297;
    286298; Shop Key/Value Pairs
  • trunk/data/tagchecker.cfg

    r5336 r5475  
    142142*    : W : width                == * && highway != * && railway != * && waterway != * && aeroway != *  # width without highway/railway/waterway/aeroway
    143143*    : W : maxspeed             == * && highway != * && railway != * && traffic_sign != maxspeed # maxspeed without highway/railway/traffic_sign
     144
     145* : I : religion == /christian|jewish|muslim/ && denomination != * # religion without denomination
     146* : I : religion == christian && denomination == * && denomination != /anglican|apostolic|baptist|catholic|christian_community|christian_scientist|coptic_orthodox|czechoslovak_hussite|dutch_reformed|evangelical|foursquare|greek_orthodox|jehovahs_witness|kabbalah|karaite|living_waters_church|lutheran|maronite|mennonite|methodist|mormon|new_apostolic|nondenominational|old_catholic|orthodox|pentecostal|presbyterian|protestant|quaker|roman_catholic|russian_orthodox|salvation_army|seventh_day_adventist|united|united_reformed|uniting/  # unkown christian denomination
     147* : I : religion == muslim && denomination == * && denomination != /alaouite|druze|ibadi|ismaili|nondenominational|shia|sunni/ # unkown muslim denomination
     148* : I : religion == jewish && denomination == * && denomination != /alternative|ashkenazi|conservative|hasidic|humanistic|liberal|modern_orthodox|neo_orthodox|nondenominational|orthodox|progressive|reconstructionist|reform|renewal|samaritan|ultra_orthodox/ # unkown jewish denomination
     149
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r5380 r5475  
    8383    protected static final List<String> ignoreDataEndsWith = new ArrayList<String>();
    8484    protected static final List<IgnoreKeyPair> ignoreDataKeyPair = new ArrayList<IgnoreKeyPair>();
    85     protected static final List<IgnoreTwoKeyPair> ignoreDataTwoKeyPair = new ArrayList<IgnoreTwoKeyPair>();
    8685
    8786    /** The preferences prefix */
     
    175174        ignoreDataEndsWith.clear();
    176175        ignoreDataKeyPair.clear();
    177         ignoreDataTwoKeyPair.clear();
    178176
    179177        spellCheckKeyData = new HashMap<String, String>();
     
    249247                            tmp.value = line.substring(mid+1);
    250248                            ignoreDataKeyPair.add(tmp);
    251                         } else if (key.equals("T:")) {
    252                             IgnoreTwoKeyPair tmp = new IgnoreTwoKeyPair();
    253                             int mid = line.indexOf("=");
    254                             int split = line.indexOf("|");
    255                             tmp.key1 = line.substring(0, mid);
    256                             tmp.value1 = line.substring(mid+1, split);
    257                             line = line.substring(split+1);
    258                             mid = line.indexOf("=");
    259                             tmp.key2 = line.substring(0, mid);
    260                             tmp.value2 = line.substring(mid+1);
    261                             ignoreDataTwoKeyPair.add(tmp);
    262249                        }
    263250                        continue;
     
    362349
    363350        if (checkComplex) {
    364             Map<String, String> props = (p.getKeys() == null) ? Collections.<String, String>emptyMap() : p.getKeys();
    365             for (Entry<String, String> prop : props.entrySet()) {
    366                 boolean ignore = true;
    367                 String key1 = prop.getKey();
    368                 String value1 = prop.getValue();
    369 
    370                 for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {
    371                     if (key1.equals(a.key1) && value1.equals(a.value1)) {
    372                         ignore = false;
    373                         for (Entry<String, String> prop2 : props.entrySet()) {
    374                             String key2 = prop2.getKey();
    375                             String value2 = prop2.getValue();
    376                             for (IgnoreTwoKeyPair b : ignoreDataTwoKeyPair) {
    377                                 if (key2.equals(b.key2) && value2.equals(b.value2)) {
    378                                     ignore = true;
    379                                     break;
    380                                 }
    381                             }
    382                             if (ignore) {
    383                                 break;
    384                             }
    385                         }
    386                     }
    387                     if (ignore) {
    388                         break;
    389                     }
    390                 }
    391 
    392                 if (!ignore) {
    393                     errors.add( new TestError(this, Severity.OTHER, tr("Suspicious tag/value combinations"),
    394                             tr("Suspicious tag/value combinations"), tr("Suspicious tag/value combinations"), 1272, p) );
    395                     withErrors.put(p, "TC");
    396                 }
    397             }
    398 
    399351            Map<String, String> keys = p.getKeys();
    400352            for (CheckerData d : checkerData) {
     
    482434                    for (IgnoreKeyPair a : ignoreDataKeyPair) {
    483435                        if (key.equals(a.key) && value.equals(a.value)) {
    484                             ignore = true;
    485                         }
    486                     }
    487 
    488                     for (IgnoreTwoKeyPair a : ignoreDataTwoKeyPair) {
    489                         if (key.equals(a.key2) && value.equals(a.value2)) {
    490436                            ignore = true;
    491437                        }
     
    801747    }
    802748
    803     protected static class IgnoreTwoKeyPair {
    804         public String key1;
    805         public String value1;
    806         public String key2;
    807         public String value2;
    808     }
    809 
    810749    protected static class IgnoreKeyPair {
    811750        public String key;
Note: See TracChangeset for help on using the changeset viewer.