-
Notifications
You must be signed in to change notification settings - Fork 1
/
Validator_SC_localization.user.js
188 lines (175 loc) · 9.02 KB
/
Validator_SC_localization.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// ==UserScript==
// @name WME Validator Localization for South Carolina
// @namespace https://greasyfork.org/users/6605
// @version 2018.07.19
// @author crazycaveman
// @description This script localizes WME Validator for South Carolina, USA. You also need main package (WME Validator) installed.
// @include https://www.waze.com/editor
// @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?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": "crazycaveman",
".updated": "2018-07-19",
".link": "https://greasyfork.org/en/scripts/6268-wme-validator-localization-for-south-carolina",
".lng": ["en","en-US","en-GB"],
//Default US checks
"27.enabled": true,
"90.enabled": true,
"106.enabled": true,
"112.enabled": false,
"170.enabled": true,
"170.params": {
"regexp": "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/",
},
// #171 ## Check for improper use of a period (.) that is not on the USA
// recommended abbreviations list (PesachZ)
"171.enabled": true,
"171.problem": "The street name has incorrect abbreviation, or character",
"171.solution": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)",
"171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
"171.params": {
"regexp": "/((?!(\\bPhila|\\bPenna|.(\\bWash|\\bCmdr|\\bProf|\\bPres)|..(\\bAdm|\\bSte|\\bCpl|\\bMaj|\\bSgt|\\bRe[vc]|\\bR\\.R|\\bGov|\\bGen|\\bHon|\\bCpl)|...(\\bSt|\\b[JSD]r|\\bLt|\\bFt)|...(#| )[NEWSR])).{5}\\.|((?!(hila|enna|(\\bWash|\\bCmdr|\\bProf|\\bPres)|.(\\bAdm|\\bSte|\\bCpl|\\bMaj|\\bSgt|\\bRe[vc]|\\bR\\.R|\\bGov|\\bGen|\\bHon|\\bCpl)|..(\\bSt|\\b[JSD]r|\\bLt|\\bFt)|..(#| )[NEWSR])).{4}|(\\bhila|\\benna))\\.|((?!(ila|nna|(ash|mdr|rof|res)|(\\bAdm|\\bSte|\\bCpl|\\bMaj|\\bSgt|\\bRe[vc]|\\bR\\.R|\\bGov|\\bGen|\\bHon|\\bCpl)|.(\\bSt|\\b[JSD]r|\\bLt|\\bFt)|.(#| )[NEWSR])).{3}|\\b(ila|nna|ash|mdr|rof|res))\\.|((?!(la|na|(sh|dr|of|es)|(dm|te|pl|aj|gt|e[vc]|\\.R|ov|en|on|pl)|(\\bSt|\\b[JSD]r|\\bLt|\\bFt)|(#| )[NEWSR])).{2}|\\b(la|na|sh|dr|of|es|dm|te|pl|aj|gt|e[vc]|\\.R|ov|en|on|pl))\\.|(#|^)[^NEWSR]?\\.)|(((?!\\b(D|O|L)).|#|^)\'(?![sl]\\b)|(#|^)\'s|(?!\\b(In|Na)t).{3}\'l|(#|^).{0,2}\'l)|(Dr|St)\\.(#|$)|,|;|\\\\|((?!\\.( |#|$|R))\\..|(?!\\.( .|#.|$|R\\.))\\..{2}|\\.R(#|$|\\.R))|[Ee]x(p|w)y\\b|\\b[Ee]x[dn]\\b|Tunl\\b|Long Is\\b|Brg\\b/",
"problemEN": "The street name has incorrect abbreviation, or character",
"solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
},
//Custom checks
"130.enabled": true,
"130.title": "Wrong name for state highway",
"130.problem": "All state highways should be named SC-### in South Carolina",
"130.solution": "Change name to SC-### (if it is truly a state highway)",
"130.solutionLink": "W:Highway_naming/USA",
"130.params": {
"titleEN": "Wrong name for state highway",
"problemEN": "All state highways should be named SC-### in South Carolina",
"solutionEN": "Change name to SC-### (if it is truly a state highway)",
"template": "${state}:#${street}#${altStreet[#]}",
"regexp": "/^South Carolina:.*\\b(State Hwy |S[cHhRr][- =])[0-9]{1,3}/"
},
"131.enabled": true,
"131.title": "Wrong road type (major)",
"131.problem": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
"131.solution": "Change the road type to Major Highway",
"131.solutionLink": "W:Road_types/USA#Major_Highway",
"131.params": {
"titleEN": "Wrong road type (major)",
"problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
"solutionEN": "Change the road type to Major Highway",
"template": "${typeRank}:#${street}@#${altStreet[@#]}@",
"regexp": "/^[1-9][^245]?:.*#(US Hwy |US-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*@/i"
},
"132.enabled": true,
"132.title": "Wrong road type (minor)",
"132.problem": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
"132.solution": "Change the road type to Minor Highway",
"132.solutionLink": "W:Road_types/USA#Minor_Highway",
"132.params": {
"titleEN": "Wrong road type (minor)",
"problemEN": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
"solutionEN": "Change the road type to Minor Highway",
"template": "${typeRank}:#${street}@#${altStreet[@#]}@",
"regexp": "/^[1-9][^2-5]:.*#((State Hwy |SR-|SH-|IL-|IN-|K-|LA-|M-|MA-|MO-|MS-|NC-|ND-|NJ-|NV-|NY-|SC-|SD-|TN-|VT-|WIS-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*|(US Hwy |US-)[0-9]+( BUS| LOOP| SPUR)+( [NSWE])?)@/i"
},
"133.enabled": true,
"133.title": "Wrong road type (primary)",
"133.problem": "All State BUS, SPUR, LOOP Highways should be at least Primary Street type",
"133.solution": "Change the road type to Primary Street",
"133.solutionLink": "W:Road_types/USA#Primary_Street",
"133.params": {
"titleEN": "Wrong road type (primary)",
"problemEN": "All State BUS, SPUR, LOOP Highways should be at least Primary Street type",
"solutionEN": "Change the road type to Primary Street",
"template": "${typeRank}:#${street}@#${altStreet[@#]}@",
"regexp": "/^[1-9][^1-5]:.*#(State Hwy |SR-|SH-|IL-|IN-|K-|LA-|M-|MA-|MO-|MS-|NC-|ND-|NJ-|NV-|NY-|SC-|SD-|TN-|VT-|WIS-)[0-9]+( BUS| LOOP| SPUR)+( [NSWE])?@/i"
},
"134.enabled": true,
"134.solutionLink": "W:Road_names/USA#United_States_Numbered_Highways",
"134.title": "Wrong banner abbreviation",
"134.problem": "Banner abbreviation may be incorrect. Abbreviations ALT, BUS, BYP, CONN, LOOP, and SPUR should be in ALL CAPS",
"134.solution": "Change banner abbreviation to ALT, BUS, BYP, CONN, LOOP, SPUR, or TRUCK",
"134.params": {
"titleEN": "Wrong banner abbreviation",
"problemEN": "Banner abbreviation may be incorrect. Abbreviations ALT, BUS, BYP, CONN, LOOP, and SPUR should be in ALL CAPS",
"solutionEN": "Change banner abbreviation to ALT, BUS, BYP, CONN, LOOP, SPUR, or TRUCK",
"template": "${street}#${altStreet[#]}",
"regexp": "/[0-9]+[A-Z]? ([Aa]lt(ernate)?|[Bb](us(iness)?|yp(ass)?)|[Cc]onn(ector)?|[Ll]oop|[Ss]pur|[Tt]ruck)/"
},
"135.enabled": true,
"135.title": "Wrong name on secondary road",
"135.problem": "Secondary state roads should follow the format S-##-XXX",
"135.solution": "Change road name to only be S-##-XXX, where ## is the county number (remember, it doesn't go as a primary name, only alt)",
"135.solutionLink": "W:South_Carolina#Naming",
"135.params": {
"titleEN": "Wrong name on secondary road",
"problemEN": "Secondary state roads should follow the format S-##-XXX",
"solutionEN": "Change road name to only be S-##-XXX, where ## is the county number (remember, it doesn't go as a primary name, only alt)",
"template": "${state}:#${street}#${altStreet[#]}#",
"regexp": "/^South Carolina:.*#((S[- ]|State (Rd|Road|Rte|Route) )|.* S-[0-9]{1,2}-)[0-9]+#/i"
},
"136.enabled": true,
"136.title": "Name on railroad",
"136.problem": "Railroads should not be named",
"136.solution": "Remove the name from the railroad",
"136.solutionLink": "W:Railroad",
"136.params": {
"titleEN": "Name on railroad",
"problemEN": "Railroads should not be named",
"solutionEN": "Remove the name from the railroad",
"template": "${typeRank}##${street}",
"regexp": "/^18:.+/"
},
//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,
}
};