Changeset 14490 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/validator/words.cfg
r6760 r14490 3 3 # special symbols, must be first character: 4 4 # # Comment 5 # + correctly spelled word6 # - incorrectly spelled word. Must follow correctly spelled word before next correctly spelled word.5 # + correctly spelled key 6 # - incorrectly spelled key. Must follow correctly spelled key before next correctly spelled key. 7 7 # 8 8 # There must not be any white space before or after words, unless they are to be included in 9 9 # the bad spelling. 10 # There is no need to add bad spelling with different upper/lower case. 11 # There is no need to add bad spelling with leading or trailing blanks. 12 10 13 +abutters 11 14 -abuters … … 15 18 -abuutters 16 19 -ubutters 17 +abutter18 +address19 +aka20 +ambulance21 20 +amenity 22 21 -ameninty … … 27 26 -amenitry 28 27 -amnity 29 -amenity30 28 -amentiy 31 29 -aminity … … 37 35 -ameinty 38 36 -anemity 39 -amneity40 37 -amemity 41 38 -ameity 42 -amenity:43 39 -amenty 44 -Amenity45 40 -maenity 46 41 -emenity 47 +amenitylanduse48 +atm49 +Atta Oehlaweg50 42 +bicycle 51 43 -bycycle … … 53 45 -bycicle 54 46 -bicyle 55 +bike 56 - bike 57 +biological 58 +by 59 +City 60 +class 61 -Class 62 +classification 63 +ele 64 +emity 65 +email 66 +code_departement 67 +code_INSEE 47 -cycle 48 -bike 49 -bikes 68 50 +commercial 69 51 -comercial 70 +comment71 +COMMENTLINE72 +confirmed73 52 +created_by 74 -created by75 53 -cretaed_by 76 54 -crated_by … … 78 56 -creayed_by 79 57 -{created_by 80 - created_by81 58 -creeated_by 82 59 -created_bu 83 +crossing84 60 +denomination 85 61 -denonimation … … 92 68 -denominatation 93 69 -denoination 94 +domination95 +faith96 +footway97 70 +foot 98 - foot99 71 -foor 100 72 +height … … 102 74 +highway 103 75 -higwhay 76 -highways 104 77 -highwaay 105 -HighWay106 78 -huighway 107 79 -highwayt … … 115 87 -hihjway 116 88 -higheway 117 -highwaY118 89 -hughway 119 90 -hihgway … … 124 95 -higyway 125 96 -hichway 126 -HIGHWAY127 97 -hingway 128 98 -hhighway … … 134 104 -hihway 135 105 -hifgway 136 -highway:137 106 -highjway 138 -highway139 107 -highwy 140 108 -hgihway … … 146 114 -higway 147 115 -highwayx 148 - highway149 116 -hoghway 150 117 -highwa 151 -Highway152 118 -hghway 153 +highways154 +highspeed155 +highwaytype156 +highway_type157 +highwayunclassified158 +horse159 +hvg160 +iata_ref161 +icao_ref162 +IM2163 119 +image 164 120 -imaqge 165 +island166 121 +layer 167 -layer168 122 -leyer 169 123 -lyaer 170 - layer171 +layer2172 +layers173 +layout174 124 +leisure 175 125 -leissure 176 126 -leiruse 177 127 -lesure 178 -leisure179 -Leisure180 128 -liesure 181 129 -lieusure 182 130 -lesiure 183 131 -leasure 184 +naam185 132 +name 186 133 -nane … … 196 143 -bame 197 144 -nam 198 - name199 145 -namr 200 -name201 146 -anme 202 -Name203 -name:204 -NAME205 -name;206 +name_1207 +name_4208 +named_by209 +names210 +name_right211 +name_left212 +note213 -Note214 147 +note:fa 215 148 -note:fa 216 149 -notes:fa 217 +Number218 150 +oneway 219 151 -aneway … … 227 159 -one_way 228 160 -onway 229 - oneway230 161 -oeway 231 162 -eway 232 +onte233 163 +osmarender:nameDirection 234 164 -name_direction 235 -name-direction236 165 -osmarender:name_direction 237 +place238 -place239 -Place240 +passing241 +passing_places242 166 +railway 243 - railway244 -Railway245 167 -raillway 246 +re247 +regional_name248 +ref249 -ref250 -ref:251 -Ref252 +ref:fa253 +ref:source254 +ref_nat255 +ref_int256 +retail257 +time258 +seats259 +seventh_wonder_of_world260 +square261 +soccer262 168 +source 263 169 -sorce … … 268 174 -aource 269 175 -sourse 270 +source2271 +source:ncn_ref272 +source:highway273 +SSSI274 +status275 +way276 176 +waterway 277 - waterway278 177 -waterwa 279 -Waterway280 178 -waterwy 281 179 -wateway 282 +wood283 180 +unknown 284 181 -unknwon … … 286 183 # Not sorted. 287 184 # 288 +289 +1290 +4wd291 + car292 + class293 + horse294 + sport295 + open 09:00 - 16:00 daily296 + General McArthur lived here297 + Also coaches298 +80n:ibm299 +amenities300 +bar301 +batteries302 +Bezeichnung303 +boder304 +Brand305 +Food306 +Fussweg307 +Hauptstrasse308 +POI309 +Park310 +Strasse311 +abutment312 +abutts313 +access314 +accident_and_emergency315 +active_volcano316 185 +aerialway 317 186 -areilway … … 322 191 -areoway 323 192 -airoway 324 +ageofdgpsdata325 193 +airport 326 194 -aeroport 327 +airport_ident328 +airport_ref329 +airway330 +alias331 +alt332 +altname333 +alt_name334 +alt_name_2335 +alternative_name336 +altitude337 +alt_ref338 +ame339 +annotation340 +annotate341 +angle342 +angle_to_last343 +appearance344 +approximate345 +area346 +art347 +ascii_name348 +asphalt349 +author350 +autocar351 +b test tag352 +badminton353 +barnvagn354 +barrier355 +bb:name356 +beach357 +bicycleRoute358 +bicycle_Route359 +blackadder:name360 +blackadder:commerce361 +blackadder:cuisine362 +blackadder:service363 +blackadder:civic364 +bicycles365 +boat366 +bogus_footpath_going_nowhere367 +border368 +borded369 +border_edit370 +border_type371 +bottles372 +boundary373 +boundary_name374 +boundary_type375 +branch376 +branch_code:fa377 +branch_name:fa378 +brand379 +brewery380 195 +bridge 381 196 -brideg 382 - bridge383 197 -brdige 384 198 -bridgde 385 199 -birdge 386 - bridge387 200 -bidge 388 201 -brige 389 202 -brigde 390 203 -bridgw 391 +bridge_ref392 +bridge_name393 +bridleway394 204 +building 395 205 -buidling … … 397 207 -buiding 398 208 -bulding 399 +building_name 400 +build_date 401 +bus 402 +buss 403 +busway 404 +bus_routes 405 +building_type 406 +cafe 407 +capacity 408 +Car 409 +car 410 +carriage 411 +cars 412 +car park at rear 413 - car park at rear 414 +car_repair 415 +carsharing 416 +category 417 +caution 418 +charge 419 +chemin 420 +checked_by 421 +cheshire_cycleway_ref 422 +christian_denomination 423 +cladding 209 -buildinq 424 210 +city 425 211 -citya 426 +city_id427 +clinic428 +clothes429 +cmt430 212 +complete 431 - complete432 213 -complite 433 +condition434 214 +construction 435 +controlled 436 +converted_by 437 +core 438 +cost 439 +country 440 +course 441 +cover 442 +covered 443 +creator 444 +cycle 445 -cyle 446 +cycleRoute 447 +cycle_route 215 -constrution 216 -contruction 448 217 +cycleway 449 218 -cylceway 450 -cycleway:451 +cykel452 +cuisine453 +cusine454 +cutting455 +d_lat456 +d_lon457 +danger458 +date459 +date_off460 +day_off461 +day_on462 +dead-end463 +deadend464 +depth465 +desc466 219 +description 467 220 -descripion 468 221 -desription 469 222 -decription 470 +descriptions471 + details:naco472 +destination473 +difficulty474 +direction475 +direction_to476 +dispensing477 +distance478 +distance_meter479 +disused480 +ECautomaton481 +edited_some_more_by482 +editor483 +editor note484 +ef485 +elevated486 +embankment487 +emergency488 +emergency_ward489 +error490 +exit491 +exit_nr492 +exit_name493 +external_description494 +external_link495 +ev_charge496 +facility497 +farezone498 +farm_vehicles499 +fastfood500 +FACC_CODE501 223 +feature 502 224 -featuer 503 +feature: NGIA map504 - feature: NGIA map505 +features506 +feet507 +ferry508 +fenced509 +fire510 +first_number511 +fix512 +fixme513 +FIXME514 +foobar515 +food516 +footpath517 -fottpath518 +forrest519 +foto520 +free521 225 +freight 522 226 -frieght 523 +from_to524 +from_zip525 +fuel_diesel526 +fuel_lpg527 +fuel_octane_91528 +fuel_octane_95529 +fuel_octane_98530 227 +full_name:fa 531 228 -full_name:Fa 532 +full_name533 +gate534 +geoname_id535 +glass536 +glass_bottles537 +glutenfree538 +gluten_free539 +goods540 +gps_network541 +grade542 +grind543 +gym544 +halt545 +hazard546 +hame547 +has_postalcode548 +hdop549 +helped_by550 +heritage551 +hgv552 +highway E-number553 229 +highway_border 554 230 -highway_boarder 555 231 -highway_boreder 556 +hill557 +historic558 +historic name559 +historical560 +history561 +Higgy:ref562 +hotelclass563 +hospital:operator564 +hour_off565 +hour_on566 +hours567 +house_numbers568 +iata569 +icao570 +id571 -ID572 +import_ref573 +incomplete574 +incline_steep575 +incline576 +industrial577 +info578 + info :naco579 +infopoint580 +informal_name581 232 +int_name 582 -int name583 233 -iint_name 584 +int_ref585 +interpolation586 +intersection587 +is588 +is_in589 -is in590 - is_in591 +in_in592 +is_in:de593 +is_in:es594 234 +junction 595 235 -junktion … … 600 240 -jounction 601 241 -jumction 602 - junction603 242 -juction 604 -Junction605 -junction606 +junction_ref607 +junction:ref608 +junction:name609 +key610 +Kingsmede611 +label612 243 +landuse 613 244 -land_use … … 615 246 -lanudse 616 247 -lanuse 617 +lane618 +lanes619 -Lanes620 +last_number621 + Last Edit: Batchoy 2006-12-14622 +learning623 +length624 +level625 +level crossing626 +license627 +liftStation628 +liftType629 +lighthouse630 +line631 +lines632 +link:naming633 +linje634 +lit635 +loc_ref636 +loc_ref:fa637 +loc_name638 -loc_name639 +loc_name:fa640 248 +local_name 641 249 -local_nama 642 +local_ref643 +locality644 +lock645 +lock_gate646 +long_name647 +lorries648 +Loyola Heights649 +ma,e650 +main651 +major652 250 +man_made 653 -man-made654 -man_made655 251 -mand_made 656 252 -nan_made 657 253 -madmade 658 254 -manmade 659 +mapkey660 +maplint:error661 +maplint:notice662 +maplint:warning663 255 +mapping_status 664 -mapping status665 256 -mappingstatus 666 +markedtrail667 +marker668 +marching_step669 257 +minspeed 670 258 -min_speed … … 672 260 -maspeed 673 261 -max_speed 674 -max speed675 262 -maxsepeed 676 263 -maxseep 677 264 -mayspeed 678 -maxspeed679 265 -maxpeed 680 266 +maxheight … … 686 272 -max_wieght 687 273 -maxweihgt 688 +maxwidth689 +membership690 +memorial691 +menu692 +military693 +missing_street694 +mixed695 +monument696 +more_data697 +motor698 +motorbike699 274 +motorcar 700 275 -otorcar 701 - motorcar702 276 -motocar 703 +motor_car 704 +motorcars 277 -motorcars 705 278 -motocars 706 279 +motorcycle 707 280 -motorcylce 708 281 -motocycle 709 -motorcycle710 +motorway711 +motorway station712 +motorway_junction713 +munro714 +museum715 +nad_ref716 +name.2717 +name.alt718 +name.en719 +name:ar720 +name:af721 +name:cy722 +name:de723 +name:en724 +name:en-cy725 +name:es726 +name:eu727 +name:fa728 +name:fi729 +name:fr730 +name:gd731 +name:la732 +name:my733 +name:nl734 +name:non735 +name:ru736 +name:sv737 +name.se738 +name.short739 +name:zh-Latn740 +name1741 +name2742 +name_alt743 +name int744 +name_int745 +name:source746 +name_source747 +name:cym748 +name_ie749 +name_loc750 +name_segment751 +namelayer752 +name:ref753 +name_ref754 +nat_name755 +nat_ref756 +nat_pref757 +nat_reg758 282 +natural 759 283 -nataural 760 - natural761 284 -natrual 762 285 -nautral 763 -natural764 +natural2765 +nature766 +navigable767 +ncn_name768 +ncn_ref769 +ncn:ref770 +ncn_route771 +needs_to_be772 +network773 +net_ref774 +newforest:pathtype775 +newsagent_code776 +nickb_marker777 +nickname778 +nlanes779 +noat780 +node781 +noentry782 +noexit783 - noexit784 +notes785 286 +note_1 786 287 -note_! 787 288 +note_2 788 289 -note2 789 +note_3790 +note_4791 +note_792 +noturn793 +number794 +numbers795 +obstacles796 +obstruction797 +official798 +ojw2799 +ojw_test800 290 +old_name 801 291 -oldname 802 +old_name:fa803 +old_full_name:fa804 +old_ref805 +opened806 +open_in807 +operator808 +opm:capacity809 +opm:difficulty810 +opm:liftStation811 +opm:liftType812 -opm:lifttype813 292 +osmarender:renderName 814 293 -osmarender:rendername … … 816 295 +osmarender:renderRef 817 296 -osmrender:renderRef 818 +owner819 +owners820 +park_and_ride821 +parking822 +parking:cost823 +parking:spaces824 +passenger825 +path826 +paved827 +pcv_only828 +pdop829 +pedestrian830 +pedestrians831 +permissive832 +petrol lhs833 +petrol petron834 +petrol835 +phone836 +phone_number837 +physical838 +place_postal839 +place numbers840 +place_code841 +place_name842 - place_name843 +place_numbers844 +place_of_worship845 +plave846 +playe847 +plant848 +poi849 +point_of_interest850 +population851 +popul852 +port853 +position_accuracy854 +possible_name855 +post_code856 297 +postal_code 857 - postal_code858 298 -posatl_code 859 +postcode860 +post_office861 +power862 +primary863 299 +private 864 300 -privat 865 +provided866 +Properties867 +problem868 +psv869 +public870 +public_transportation871 +punting872 +quality873 +rail874 +railroad875 +railway_tracks876 +ramp877 +recreation878 +recycling879 +recycling:batteries880 +recycling:bicycles881 +recycling:books882 +recycling:clothing883 +recycling:clothes884 301 +recycling:glas 885 302 -recyling:glas 886 +recycling:shoes887 +recycling:engine_oil888 +recycling:glass_bottles889 +recycling:green_waste890 +recycling:magazines891 +recycling:mobile_phones892 +recycling:newspaper893 +recycling:newspapers894 +recycling:printer_cartridges895 +recycling:cardboard896 +recycling:music897 303 +recycling:paper 898 304 -reycling:paper 899 +recycle:plastic_bottles900 +recycle:paper901 +recycle:magazines902 +recycle:cardboard903 +recycle:cans904 +recycling:cans905 +recycling:plastic_bottles906 +recycline:cardboard907 +recycle:glass_bottles908 +recycling:cork909 +recycling:glass910 +recycling:plastic911 +recycling:plastic_bags912 +recycling:plasic_bottles913 +recycling:scrap_metal914 +recycling:white_goods915 +recycling:wood916 +recycling:tyres917 +red918 +reference919 +ref_direction920 +reg921 +reg_name922 +reg_ref923 +reg_reg924 +region_id925 305 +religion 926 306 -relgion 927 +residence928 307 +residential 929 308 -residentail 930 309 +restriction 931 310 -restrction 932 -Restriction933 +restricted934 +restrictions935 -Restrictions936 -Restrictions937 +riverwidth938 +river_width939 +road940 +rollerblade941 +roundabout942 +route943 +routing944 +rue945 +runway946 +sat947 +sculpture948 +service949 +shape950 +sheltered951 +shortcut952 +sidewalk953 +sign954 +single_track955 +singletrack956 +shop957 +shopping958 +size959 +ski960 +slope961 +snowboarding962 +some_data963 +source:loc_name964 +source:old_name965 +source:old_ref966 311 +source:name 967 312 -source:Name 968 +source:ref969 +source_ref970 +source_ref:ref971 +source_ref:name972 +source:uri973 +source_uri974 313 +source:url 975 314 -source_url 976 +source:oneway977 +southglos:heritagetrail978 +species979 +speed980 +speed_limit981 +speed limit982 +speedlimit983 +speedevil984 +sport985 +sport_2986 +sports987 +stairs988 +start_date989 +state990 +station991 +stream992 +street993 +street_name994 +steps995 +structure996 +subtype997 +suburb998 +suggested999 315 +surface 1000 316 -sruface 1001 +surfaced1002 +survey_ref1003 +survey1004 - survey1005 +svg:font-size1006 +svg:stroke-width1007 +svg_font-size1008 +svg:stroke-dasharray1009 +swimming1010 +sym1011 +symbol1012 +symbolic1013 +tag1014 +taxi1015 +telephone1016 +telephone:operator1017 +telephone_number1018 +telephonenumber1019 +telephone_type1020 +test1021 +testing1022 +testnode1023 + this was a children's playarea with a path leading through it. Didn't want to look too dodgy :)1024 +the Netherlands1025 +NL1026 +thoroughfare1027 +time_diff1028 +times1029 +tractor1030 +track1031 +tracktype_11032 +to_zip1033 +todo1034 +TODO1035 +toll1036 +tollway1037 +topspeed1038 317 +tourism 1039 318 -tourismn 1040 319 -tourim 1041 -tourism1042 320 -toursim 1043 321 -touristm 1044 +tourist1045 +tourist_attraction1046 +towards1047 +town1048 +towpath1049 +tracks1050 +traffic1051 +traffic_signals1052 +train1053 322 +tracktype 1054 323 -tractype 1055 324 -tracltype 1056 325 -trackype 1057 +tram1058 326 +tramline 1059 327 -tram_line 1060 +true1061 +truck1062 +tube1063 +tune1064 328 +tunnel 1065 329 -tunne 1066 -tunnel1067 -Tunnel1068 330 -tunel 1069 331 -tunnely 1070 +turn_right1071 +typ1072 332 +type 1073 333 -tyoe 1074 +type.en1075 +uk:row1076 +unclassified1077 +upload_tag1078 +uploader1079 +uploaded_by1080 +uri1081 +url1082 +use1083 +use_status1084 +usage1085 +utility1086 +vdop1087 +vehicle1088 +viaduct1089 +vicar1090 +view1091 +village1092 +visited_by1093 +volcano1094 +voltage1095 +warning1096 +water1097 +waterfall1098 +wayclass1099 +waypoint1100 +web1101 +website1102 +website:official1103 +weight_limit1104 +wide1105 +width1106 +width_restriction1107 +wiki1108 +wikipedia1109 +wikipedia:es1110 +wiki:nl1111 +wrong1112 +www1113 +zip1114 +zip_code1115 +{} -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r13923 r14490 12 12 import java.util.Arrays; 13 13 import java.util.Collection; 14 import java.util.Collections; 14 15 import java.util.HashMap; 15 16 import java.util.List; … … 257 258 okValue = line.substring(1); 258 259 } else if (line.charAt(0) == '-' && okValue != null) { 259 harmonizedKeys.put(harmonizeKey(line.substring(1)), okValue); 260 String hk = harmonizeKey(line.substring(1)); 261 if (!okValue.equals(hk)) { 262 if (harmonizedKeys.put(hk, okValue) != null) { 263 Logging.debug(tr("Line was ignored: {0}", line)); 264 } 265 } 260 266 } else { 261 267 Logging.error(tr("Invalid spellcheck line: {0}", line)); … … 313 319 314 320 private static void addPresetValue(KeyedItem ky) { 315 Collection<String> values = ky.getValues(); 316 if (ky.key != null && values != null) { 317 harmonizedKeys.put(harmonizeKey(ky.key), ky.key); 321 if (ky.key != null && ky.getValues() != null) { 322 String hk = harmonizeKey(ky.key); 323 if (!ky.key.equals(hk)) { 324 harmonizedKeys.put(hk, ky.key); 325 } 318 326 } 319 327 } … … 415 423 @Override 416 424 public void check(OsmPrimitive p) { 425 if (!p.isTagged()) 426 return; 427 417 428 // Just a collection to know if a primitive has been already marked with error 418 429 MultiMap<OsmPrimitive, String> withErrors = new MultiMap<>(); … … 502 513 if (!isKeyInPresets(key)) { 503 514 String prettifiedKey = harmonizeKey(key); 504 String fixedKey = harmonizedKeys.get(prettifiedKey);515 String fixedKey = isKeyInPresets(prettifiedKey) ? prettifiedKey : harmonizedKeys.get(prettifiedKey); 505 516 if (fixedKey != null && !"".equals(fixedKey) && !fixedKey.equals(key)) { 506 517 // misspelled preset key … … 525 536 String fixedValue = harmonizeValue(prop.getValue()); 526 537 Map<String, String> possibleValues = getPossibleValues(getPresetValues(key)); 538 List<String> fixVals = new ArrayList<>(); 539 if (!possibleValues.containsKey(fixedValue)) { 540 int minDist = 2; 541 String closest = null; 542 for (String possibleVal : possibleValues.keySet()) { 543 int dist = Utils.getLevenshteinDistance(possibleVal, fixedValue); 544 if (dist < minDist) { 545 closest = possibleVal; 546 minDist = dist; 547 fixVals.clear(); 548 fixVals.add(possibleVal); 549 } else if (dist == minDist) { 550 fixVals.add(possibleVal); 551 } 552 } 553 if (minDist <= 1) { 554 if (fixVals.size() < 2) { 555 fixedValue = closest; 556 } else { 557 Collections.sort(fixVals); 558 // misspelled preset value with multiple good alternatives 559 errors.add(TestError.builder(this, Severity.WARNING, MISSPELLED_VALUE) 560 .message(tr("Misspelled property value"), 561 marktr("Value ''{0}'' for key ''{1}'' looks like one of {2}."), prop.getValue(), key, fixVals) 562 .primitives(p) 563 .build()); 564 withErrors.put(p, "WPV"); 565 continue; 566 } 567 } 568 } 527 569 if (possibleValues.containsKey(fixedValue)) { 528 570 final String newValue = possibleValues.get(fixedValue); … … 596 638 } 597 639 598 checkComplex = Config.getPref().getBoolean(PREF_CHECK_COMPLEX, true) ;640 checkComplex = Config.getPref().getBoolean(PREF_CHECK_COMPLEX, true) && !checkerData.isEmpty(); 599 641 if (isBeforeUpload) { 600 642 checkComplex = checkComplex && Config.getPref().getBoolean(PREF_CHECK_COMPLEX_BEFORE_UPLOAD, true); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/TagCheckerTest.java
r14273 r14490 101 101 final List<TestError> errors = test(OsmUtils.createPrimitive("node landuse=forrest")); 102 102 assertEquals(1, errors.size()); 103 assertEquals("Presets do not contain property value", errors.get(0).getMessage()); 104 assertEquals("Value 'forrest' for key 'landuse' not in presets.", errors.get(0).getDescription()); 103 assertEquals("Misspelled property value", errors.get(0).getMessage()); 104 assertEquals("Value 'forrest' for key 'landuse' looks like 'forest'.", errors.get(0).getDescription()); 105 } 106 107 /** 108 * Check for misspelled value with multiple alternatives in presets. 109 * @throws IOException if any I/O error occurs 110 */ 111 @Test 112 public void testMisspelledTag2() throws IOException { 113 final List<TestError> errors = test(OsmUtils.createPrimitive("node highway=servics")); 114 assertEquals(1, errors.size()); 115 assertEquals("Misspelled property value", errors.get(0).getMessage()); 116 assertEquals("Value 'servics' for key 'highway' looks like one of [service, services].", errors.get(0).getDescription()); 105 117 } 106 118
Note:
See TracChangeset
for help on using the changeset viewer.