// ==UserScript==
// @name WME Validator Localization for New York
// @namespace https://gf.qytechs.cn/en/users/15052
// @version 1.1.903
// @author New York Editors
// @credit Credit to xanderb for the base template.
// @description This script localizes WME Validator for New York. You also need main package (WME Validator) installed.
// @match https://editor-beta.waze.com/*editor/*
// @match https://www.waze.com/*editor/*
// @grant none
// @run-at document-start
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAB9VBMVEUAAAD/gAD/nwD/lQD/nwD/mQD/lQD/kgD/mwD/lwD/nAD/mQD/lwD/mgD/mAD/mwD/mQD/lwD/mAD/mgD/mQD/mAD/mgD/mAD/mgD/mQD/mAD/mQD/mQD/mgD/mQD/////mAD/////mQD/////mQD/////mgD/mQD/////mAD/////mQD/mQD/mQD/////mgD//////Pj/mQD/////mAD/////mQD/mQD/////mgD/////mQD/mAD/////mQD/////mQD/////mgD/////mQD/mAD/////mQD/////mQD/mQD/////mQD/////mQD/////mQD/////mQD/////mQD/mQD/////mQD/////mQD/tkf/ulT/mQD/////mQD/mgD/mQD/////mgD/0Yz/mQD/////mQD///8AAAABAQECAgIDAwMJCQkRERESEhIWFhYZGRkaGhocHBwvLy8xMTFERERISEhXV1doaGhqamqBgYGEhISioqKjo6Ourq64uLi+vr7g4ODn5+fr6+v19fX4+Pj5+fn8/Pz9/f3+/v7/mQD/mwT/ngz/piD/qSj/rjT/s0D/uVD/u1T/w2j/xGz/xnD/x3T/zID/z4j/0Yz/05D/1pj/2aD/26T/3qz/5b//7M//79f/8dv/8t///Pf//fv////VAUOcAAAAaHRSTlMABAgMEBQYHBwgJCgsMDQ4PEBDR0tPU1dbX2Nna29zc3d3e3t/f4OHh4uLj5GTk5eXmZubn5+jp6erq6+zs7e3u7u/v8PHx8vLz9PT19fb29/f4+Pl5+fr6+3t7e/v8PLz8/T29/f7+1UbC/wAAAU+SURBVGje7drtf9NEHADwa7eWZRXWrKxrwAwfKlonghiRbt2YcQM2B4bCHChKFdpmPj/hs+KzL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e26AgDCWBEczqS0BMuS+BQenq6QoxGgWQDImhNPIgKSKscA0WIqiEhlz2Qqat3gyChAqSR5m2UojNVmIqaFklRLjKEvo8kiIcZSmH/ha207G4CFPpNGi9hwDCUCJGNwhViRp0ZN4/McRoS9lTJOO5HBBFWI2RqTRyQBip+SdGQTzlVBaII5rYUntUIRl0BDagXSCOQjSCoh+OnijBlQNeT5p9hmfQn+9m+BzTPGXTGY4BYFXHVtSDhc4RIKrQDLBMbXMwxyoQVE7005a1Yab4qTG4nJoVU05Qd/5gydfxUwNxttc2naEb4NZwYRaLGZjKgICSYexgTtJeGTfeymAq88m2QIPdjNOMKpSCr/LW4pZukDy8DbFiKMhC23ByZCcsEHKe6GZpfe/WTLLSgmvCd1PqXuRd+WhtXC3KUn+iRKiDhkKb7xjGrK5Pa25UykGoilKSZQmpjn27g/Eyxd8FjBcNY17X91X1hRZjPSKIka62ydGXCFbHIU3eGKTC2ZGv3QBjgTtiSDsXujSWJKF/w1CrRnJjflC4xmeGSmWtNmfErQuny+kkrbhfkmRZHlHcuC1sJ7s0rarPGcuoUNveD3oTGWlIlouynM+Cm3Ez/rfxH6STRnmdq/GgAAAAAElFTkSuQmCC
// ==/UserScript==
//
/*
See Settings->About->Available checks for complete list of checks and their params.
Examples:
Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
"170.enabled": true,
"170.params": {
"regexp": "/^((exit|to) )?[a-z]/",
"},
Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
"130.enabled": true,
"130.params": {
"titleEN": "Street name with a dot",
"problemEN": "There is a dot in the street name (excluding Ramps)",
"solutionEN": "Expand the abbreviation or remove the dot",
"template": "${type}:${street}",
"regexp": "D/^[^4][0-9]?:.*\\./",
},
*Note: use D at the beginning of RegExp to enable debugging on JS console.
*Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
*/
window.WME_Validator_United_States = {
".country": "United States",
".codeISO": "US",
".author": "tythesly",
".updated": "2015-10-01",
".link": "TODO: ",
//Default US checks
"27.enabled": true,
"90.enabled": true,
"106.enabled": true,
"112.enabled": false,
"139.enabled": true,
"139.params": {
"titleEN": "Bad TTS Street name",
"problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
"solutionEN": "Add a period after St or Dr at the beginning of the street name",
"template": "${street}#${altStreet[#]}",
"regexp": "/^([SNEW] )+(St |Dr )|^St |^Dr |Jr |Rev /"
},
"139.solutionLink": "W:Abbreviations_and_acronyms/USA#Recommended_abbreviations",
"138.enabled": true,
"138.params": {
"titleEN": "Incorrect Hwy Name Prefix",
"problemEN": "NY follows national guidelines for hwy naming prefixes, and uses NY-## for state routes.",
"solutionEN": "Rename the Street or Alt Street",
"template": "${state}:${street}#${altStreet[#]}",
"regexp": "/^New York:.*\\b(([Uu]\\.? ?( S|S\\.|s\\.?)|[Nn](ew )?(y|[Yy]ork)? ?|[Ss]tate |[Ss] ?[RrHh]|[Cc]o(unty)? ?)([Rr]((ou)?(te)?|(oa)?d)|[Hh]((igh)?[Ww]a?[Yy])?)?|Ny|NY=|I- |[Cc][HhrSs]|([Ii]|[NnCcUu][YyRrSs])[ =])[- ]?\\d+/"
},
"138.solutionLink": "W:NY#Major_roads",
"137.enabled": true,
"137.params": {
"titleEN": "Improper Cardinal Usage",
"problemEN": "This name contains a cardinal direction (NEWS) which does not match wiki guidelines.",
"solutionEN": "If this cardinal should be spoken as a direction by TTS, make sure it has space on either side of it. \n\ If this cardinal should be spoken by TTS as a letter, follow it with a period. \n\ All cardinals should be capitalized.",
"template": "${street} ${altStreet[#]}",
"regexp": "/(^| )([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[EeWw])['\":-]|[\"']([NnSs][EeWw]?|[EeWw])['\":-]?)(\\b|\\d| |$)/"
},
"137.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
"136.enabled": true,
"136.params": {
"titleEN": "NYC Minimum Lock Levels",
"problemEN": "NYC has higher locking levels than the rest of NY",
"solutionEN": "Lock the segment. PS>=3, mH>=4, MH>=5, FW>=5, Ramp>=highest connection",
"template": "${state}_${city}:_${type}_:${lock}",
"regexp": "/^New York_(New York|Manhattan|Queens|Brooklyn|Bronx|Staten Island):(_3_:[1-4]|_4_:[1-4]|_6_:[1-4]|_7_:[1-3]|_2_:[12])/"
},
"136.solutionLink": "W:NY#Locking_standard",
"130.enabled": true,
"130.params": {
"titleEN": "Short Parking Lot",
"problemEN": "Dead End Parking Lot is less that 30 meters",
"solutionEN": "Does it really need to be there?",
"template": "${deadEnd}:${typeRank}:${length}",
"regexp": "/1:7:([0-2]?[0-9])$/"
},
"130.solutionLink": "W:Best_map_editing_practice#Parking_Lots",
"131.enabled": true,
"131.params": {
"titleEN": "Not New York",
"problem": "The segment is assigned to another state",
"solutionEN": "Make sure you are editing in NY and change it",
"template": "${state}",
"regexp": "!/^New York/"
},
"131.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
"134.enabled": true,
"134.params": {
"titleEN": "Potential Incorrect Abbreviation",
"problemEN": "Name abbreviation may be incorrect. Alternative routes should be labeled ALT and abbreviations ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK should be in ALL CAPS",
"solutionEN": "Change abbreviation to ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK in ALL CAPS",
"template": "${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
"regexp": "/!?[0-9].+(Alt|Business|Bus|Byp|Conn|Loop|Scn|Spur|Truck)\\b/"
},
//There already is a city on freeway check, enable it
"59.enabled": true,
//Freeway lock
"150.enabled": true,
"150.params": {
// {number} minimum lock level
"n": 5,
},
//Major Highway lock
"151.enabled": true,
"151.params": {
// {number} minimum lock level
"n": 4,
},
//Minor Highway lock
"152.enabled": true,
"152.params": {
// {number} minimum lock level
"n": 3,
},
//Ramp lock
"153.enabled": true,
"153.params": {
// {number} minimum lock level
"n": 2,
},
//Primary Street lock
"154.enabled": true,
"154.params": {
// {number} minimum lock level
"n": 2,
},
"170.enabled": !0,
"170.params": {
regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
},
"171.enabled": true,
"171.solutionLink": "W:Abbreviations_&_Acronyms#Standard_Suffix_Abbreviations"
};