// ==UserScript==
// @name WME Validator Localization for New York
// @namespace https://greasyfork.org/en/users/15052
// @version 1.1.8
// @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
// ==/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][HhRrSs]|([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": "/(^| |\\b|\\d)([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[NnSsEeWw])['\":-])(\\b|\\d| |$)/"
},
"137.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
"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"
};