WME Validator Localization for West Virginia

This script localizes WME Validator for West Virginia, USA. You also need main package (WME Validator) installed.

当前为 2017-03-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for West Virginia
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.3.3
  5. // @author xanderb
  6. // @description This script localizes WME Validator for West Virginia, USA. You also need main package (WME Validator) installed.
  7. // @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/.*$/
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11. //
  12. /*
  13. See Settings->About->Available checks for complete list of checks and their params.
  14. Examples:
  15. Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
  16. "170.enabled": true,
  17. "170.params": {
  18. "regexp": "/^((exit|to) )?[a-z]/",
  19. "},
  20. Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
  21. "130.enabled": true,
  22. "130.params": {
  23. "titleEN": "Street name with a dot",
  24. "problemEN": "There is a dot in the street name (excluding Ramps)",
  25. "solutionEN": "Expand the abbreviation or remove the dot",
  26. "template": "${type}:${street}",
  27. "regexp": "D/^[^4][0-9]?:.*\\./",
  28. },
  29. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  30. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  31. */
  32.  
  33. window.WME_Validator_United_States = {
  34. ".country": "United States",
  35. ".codeISO": "US",
  36. ".author": "xanderb",
  37. ".updated": "2017-03-21",
  38. ".link": "TODO: ",
  39. "128.enabled": true,
  40. "128.params": {
  41. "titleEN": "Not West Virginia",
  42. "problem": "The segment is assigned to another state",
  43. "solutionEN": "Make sure you are editing in WV and change it",
  44. "template": "${state}",
  45. "regexp": "!/^West Virginia/"
  46. },
  47. "128.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  48. "129.enabled": true,
  49. "129.params": {
  50. "titleEN": "Testing Name Suffixes",
  51. "problemEN": "Street suffix does not follow abbreviation rules",
  52. "solutionEN": "Rename the suffix Such as Road to Rd Please let me know about false positives",
  53. "template": "${street}",
  54. "regexp": "!/(Unknown Name| A(cres?|ly|nnex|ve|r(cade|tery))| B(ay|ch|end|lvd|luf|roadway|ypass|YP|r(a(e|nch|ook))?|ottom|(ike|us)way|ayou)| C(enters|t|lb?|hase|ommons?|o(urse|rs|rner)|ONN|amp|r(es|est|k)?|ir|swy|tr|v|u(rve|toff)|yn)| D(am|ale|ell|onws|r)| E(ast|dgeway|n(d|t)|xit|states?|splanade|x(t|pwy))| F(airway|or(rges?|d|ks?)|wy|alls?|lats?)| G(ardens?|len|rv|r(ee)?n|a(p|te(way)?))| H(arborr|ills?|ollows?|ts|wy|ospital)| I(sle|nlt)| Junctions?| K(eys?|nolls?)| L(ocks?|dg|in[ke]|f|gts?|ndg|[np])|oop| M(all|dw|eadows|nr|anors|t|ns?|ile|o(hr|torway)|ews|sn)| N(eck|orth)| O(aks|ne|rchard|v(al|er(look|pass)))| P(a(ss|th|rade)|ike|romanade|o(intes?|rts?)|l(ns|z)?|k(e|s)?|kwys?|ts?)| R(d|e(ach|st)|ow|i(se|ver)|amp|ailroad|nch|\.R\.|ailway|pds|idge|u(n(way)?|e)|te)| S(ho(als?|res?)|kwy|outh|p(ur|ngs|ring)|u(permarket|bdivision)|t(a|rut)|[qt]s?)| T(er|hwy|lwy|race|pke?|un|urn|r(l|fy)|ra(ck|in))| U(nderpass|pr)| V(iews?|i(llages?|sta)|ly|alleys|iaduct)| W(alk|ays?|ls?|est|oods|ynde?)| X(-ing|rd)| Yard|^$)( [SNEW]{1,2})?$|^([SNEW]{1,2} )?(Old )?(\\d{1,4} [SNEW]|Broadway|MBTA|Railroad|Amtrak|I-|IN-|IA-|KY?-|US-|LA?-|M[DNSO]?-|N[VJYCD]?-|S[CDRH]?-|RI?-|TN-|V[AT]-|W(V|IS)-|C[RH]-|Runway|Place |Parkway|Route |Access |Avenue of |Circle of |Rue de |State |County |The |to |(Left )?E(xit( to:)?|ntry) )/",
  55. },
  56. "129.solutionLink": "W:User:Xanderb/Abbreviations",
  57. "130.enabled": true,
  58. "130.params": {
  59. "titleEN": "Check Alt City Names",
  60. "problemEN": "Alt City is Missing",
  61. "solutionEN": "If segment is out of city limits it should have USPS city in Alt",
  62. "template": "${altStreet[#]}:${altCity[#]}:${type}",
  63. "regexp": "/^.+:(.*#+)?:+[1267]$/"
  64. },
  65. "130.solutionLink": "W:West_Virginia/WV_MapRaid#City_Names",
  66. "131.enabled": true,
  67. "131.params": {
  68. "titleEN": "Bad TTS Street name",
  69. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  70. "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
  71. "template": "${street}#${altStreet[#]}",
  72. "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
  73. },
  74. "131.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  75. "132.enabled": true,
  76. "132.params": {
  77. "titleEN": "Wrong name for City or County street",
  78. "problemEN": "City or County Hwy Name is wrong",
  79. "solutionEN": "Check sources and change the street's name",
  80. "template": "${state}:${street}#${altStreet[#]}",
  81. "regexp": "/^West Virginia:.*(Cs-|CS-|Co Hwy |County Rd |Cr-|Co Rd |CH-|Ch-|Co Rte )/"
  82. },
  83. "132.solutionLink": "W:Highway_naming/USA",
  84. "133.enabled": true,
  85. "133.params": {
  86. "titleEN": "Wrong road type (minor)",
  87. "problemEN": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
  88. "solutionEN": "Change the road type to Minor Highway",
  89. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  90. "regexp": "/^[1-9][^2-5]:.*#((State Hwy |State Rte |SR-|SH-|IL-|IN-|K-|LA-|M-|MA-|MO-|MS-|NC-|ND-|NJ-|NV-|NY-|SC-|SD-|TN-|VT-|WV-|WIS-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*|(US Hwy |US-)[0-9]+( BUS| LOOP| SPUR)+( [NSWE])?)@/i"
  91. },
  92. "133.solutionLink": "W:Road_types/USA#Minor_Highway",
  93. "134.enabled": true,
  94. "134.severity": "warning",
  95. "134.params": {
  96. "titleEN": "Alley not PLR",
  97. "problemEN": "Alleys should be set to the PLR Road Type",
  98. "solutionEN": "Change Road Type",
  99. "template": "${street}:${typeRank}",
  100. "regexp": "/.*(Alley| Aly):[^7]/"
  101. },
  102. "134.solutionLink": "W:Road_types/USA#Parking_Lot_Road",
  103. "135.enabled": true,
  104. "135.params": {
  105. "titleEN": "Incorrect State or US Highway name",
  106. "problemEN": "West Virginia uses WV-xx for state and US-xx for national highway names",
  107. "solutionEN": "Rename the Street or Alt Street",
  108. "template": "${street}#${altStreet[#]}",
  109. "regexp": "/.*(Wv Hwy |State Hwy |State Rte |SR-|SH-|State Rd |WV=|^Rte |State Rte-|U\.?[Ss]\.? (Rte|[Hh](WY|wy|ighway)))/"
  110. },
  111. "135.solutionLink": "W:West_Virginia",
  112. "136.enabled": true,
  113. "136.params": {
  114. "titleEN": "Wrong road type",
  115. "problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
  116. "solutionEN": "Change the road type to Major Highway",
  117. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  118. "regexp": "/^[1-9][^245]?:.*#(US Hwy |US-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*@/i"
  119. },
  120. "136.solutionLink": "W:Road_types/USA#Major_Highway",
  121. "137.enabled": true,
  122. "137.params": {
  123. "titleEN": "Invalid Interstate Name",
  124. "problemEN": "There seems to be an extra space there",
  125. "SolutionEN": "Remove the extra space in the name",
  126. "template": "${street}#${altStreet[#]}",
  127. "regexp": "/I- /"
  128. },
  129. "137.solutionLink": "W:Road_names/USA#United_States_Interstate_Highway_System",
  130. "138.enabled": true,
  131. "138.params": {
  132. "titleEN": "Invalid city name",
  133. "problemEN": "The city name is not a valid city in West Virginia",
  134. "solutionEN": "Correct the city name or remove it",
  135. "template": "${city}",
  136. "regexp": "!/.*(^$|Accoville|Addison \\(Webster Springs\\)|Albright|Alderson|Alum Creek|Amherstdale|Anawalt|Anmoore|Ansted|Apple Grove|Athens|Auburn|Aurora|Bancroft|Barboursville|Barrackville|Bartley|Bartow|Berkeley Springs|Bayard|Beards Fork|Beaver|Beckley|Beech Bottom|Belington|Belle|Belmont|Belva|Benwood|Bergoo|Berwind|Bethany|Bethlehem|Beverly|Big Chimney|Big Creek|Big Sandy|Birch River|Blacksville|Blennerhassett|Bluefield|Bluewell|Boaz|Bolivar|Bolt|Boomer|Bowden|Bradley|Bradshaw|Bramwell|Brandonville|Brandywine|Brenton|Bridgeport|Brookhaven|Bruceton Mills|Bruno|Brush Fork|Buckhannon|Bud|Buffalo|Burlington|Burnsville|Cairo|Camden-on-Gauley|Cameron|Capon Bridge|Carolina|Carpendale|Cass|Cassville|Cedar Grove|Century|Ceredo|Chapmanville|Charleston|Charles Town|Charlton Heights|Chattaroy|Chauncey|Cheat Lake|Chelyan|Chesapeake|Chester|Clarksburg|Clay|Clearview|Clendenin|Coal City|Coal Fork|Comfort|Corinne|Covel|Cowen|Crab Orchard|Craigsville|Cross Lanes|Crum|Crumpler|Cucumber|Culloden|Dailey|Daniels|Danville|Davis|Davy|Deep Water|Delbarton|Despard|Dixie|Dunbar|Durbin|East Bank|East Dailey|Eccles|Eleanor|Elizabeth|Elk Garden|Elkins|Elkview|Ellenboro|Enterprise|Fairlea|Fairmont|Fairview|Falling Spring|Falling Waters|Falls View|Farmington|Fayetteville|Fenwick|Flatwoods|Flemington|Follansbee|Fort Ashby|Fort Gay|Frank|Franklin|Friendly|Gallipolis Ferry|Galloway|Gary|Gassaway|Gauley Bridge|Ghent|Gilbert|Gilbert Creek|Glasgow|Glen Dale|Glen Ferris|Glen Fork|Glen Jean|Glenville|Glen White|Grafton|Grantsville|Grant Town|Granville|Great Cacapon|Green Bank|Green Spring|Greenview|Gypsy|Hambleton|Hamlin|Handley|Harman|Harpers Ferry|Harrisville|Hartford City|Harts|Hedgesville|Helen|Helvetia|Henderson|Hendricks|Henlawson|Hepzibah|Hico|Hillsboro|Hilltop|Hinton|Holden|Hometown|Hooverson Heights|Hundred|Huntersville|Huntington|Hurricane|Huttonsville|Idamay|Iaeger|Inwood|Itmann|Jacksonburg|Jane Lew|Jefferson|Junior|Justice|Kenova|Kermit|Keyser|Keystone|Kimball|Kimberly|Kincaid|Kingwood|Kistler|Kopperston|Lashmeet|Lavalette|Leon|Lesage|Lester|Lewisburg|Littleton|Logan|Lost Creek|Lubeck|Lumberport|Mabscott|MacArthur|McConnell|McMechen|Madison|Mallory|Man|Mannington|Marlinton|Marmet|Martinsburg|Mason|Masontown|Matewan|Matheny|Matoaka|Maybeury|Meadow Bridge|Middlebourne|Middleway|Mill Creek|Milton|Minden|Mineral Wells|Mitchell Heights|Monaville|Monongah|Montcalm|Montgomery|Montrose|Moorefield|Morgantown|Moundsville|Mount Carbon|Mount Gay-Shamrock|Mount Hope|Mullens|Neibert|Nettie|Newburg|New Cumberland|Newell|New Haven|New Martinsville|New Richmond|Nitro|Northfork|North Hills|Nutter Fort|Oak Hill|Oakvale|Oceana|Omar|Paden City|Page|Pageton|Parkersburg|Parsons|Paw Paw|Pax|Pea Ridge|Pennsboro|Pentress|Petersburg|Peterstown|Philippi|Pickens|Piedmont|Pinch|Pine Grove|Pineville|Piney View|Pleasant Valley|Poca|Point Pleasant|Powellton|Pratt|Prichard|Prince|Princeton|Prosperity|Pullman|Quinwood|Rachel|Racine|Rainelle|Rand|Ranson|Ravenswood|Raysal|Reader|Red Jacket|Reedsville|Reedy|Rhodell|Richwood|Ridgeley|Ripley|Rivesville|Robinette|Roderfield|Romney|Ronceverte|Rossmore|Rowlesburg|Rupert|St. Albans|St. Marys|Salem|Salt Rock|Sand Fork|Sarah Ann|Scarbro|Shady Spring|Shannondale|Shenandoah Junction|Shepherdstown|Shinnston|Shrewsbury|Sissonville|Sistersville|Smithers|Smithfield|Sophia|South Charleston|Spelter|Spencer|Springfield|Stanaford|Star City|Stollings|Stonewood|Summersville|Sutton|Switzer|Sylvester|Teays Valley|Terra Alta|Thomas|Thurmond|Tioga|Tornado|Triadelphia|Tunnelton|Twilight|Union|Upper Falls|Valley Bend|Valley Grove|Valley Head|Van|Verdunville|Vienna|Vivian|War|Wardensville|Washington|Waverly|Wayne|Weirton|Welch|Wellsburg|West Hamlin|West Liberty|West Logan|West Milford|Weston|Westover|West Union|Wheeling|White Hall|White Sulphur Springs|Whitesville|Whitmer|Wiley Ford|Williamson|Williamstown|Windsor Heights|Winfield|Wolf Summit|Womelsdorf \\(Coalton\\)|Worthington)/"
  137. },
  138. "138.solutionLink": "http://factfinder.census.gov/bkmk/table/1.0/en/DEC/10_SF1/GCTPH1.ST10?slice=GEO~0400000US54",
  139. "139.enabled": true,
  140. "139.params": {
  141. "titleEN": "Name on Railroad",
  142. "problemEN": "Names on Railroads are not needed for routing and clutter the app UI",
  143. "solutionEN": "Remove the Names and Cities from Railroad segments",
  144. "template": "${type}:${street}",
  145. "regexp": "/^18:.+$/"
  146. },
  147. "139.solutionLink": "W:Road_types/USA#Railroad",
  148. //Freeway lock
  149. "150.enabled": true,
  150. "150.params": {
  151. // {number} minimum lock level
  152. "n": 5,
  153. },
  154. //Major Highway lock
  155. "151.enabled": true,
  156. "151.params": {
  157. // {number} minimum lock level
  158. "n": 4,
  159. },
  160. //Minor Highway lock
  161. "152.enabled": true,
  162. "152.params": {
  163. // {number} minimum lock level
  164. "n": 3,
  165. },
  166. //Primary Street lock
  167. "154.enabled": true,
  168. "154.params": {
  169. // {number} minimum lock level
  170. "n": 2,
  171. },
  172. //Ramp lock
  173. "153.enabled": true,
  174. "153.params": {
  175. // {number} minimum lock level
  176. "n": 4,
  177. },
  178. //Default US checks
  179. "24.enabled": !0,
  180. "25.enabled": !0,
  181. "27.enabled": !0,
  182. "34.enabled": !0,
  183. "35.enabled": !0,
  184. "38.enabled": !0,
  185. "39.enabled": !0,
  186. "43.enabled": !0,
  187. "48.enabled": !0,
  188. "78.enabled": !0,
  189. "87.enabled": !0,
  190. "90.enabled": !0,
  191. "106.enabled": !0,
  192. "107.enabled": !0,
  193. "108.enabled": !0,
  194. "109.enabled": !0,
  195. "112.enabled": !1,
  196. "118.enabled": !0,
  197. "116.enabled": !0,
  198. "119.enabled": !0,
  199. "120.enabled": !0,
  200. "121.enabled": !0,
  201. "172.enabled": !0,
  202. "173.enabled": !0,
  203. "190.enabled": !0,
  204. "192.enabled": !0,
  205. "170.enabled": !0,
  206. "170.params": {
  207. "regexp": "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  208. },
  209. "171.enabled": !0,
  210. };