WME Validator Localization for West Virginia

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

当前为 2016-07-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for West Virginia
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.1.35
  5. // @author xanderb
  6. // @description This script localizes WME Validator for West Virginia, USA. You also need main package (WME Validator) installed.
  7. // @match https://editor-beta.waze.com/*editor/*
  8. // @match https://www.waze.com/*editor/*
  9. // @grant none
  10. // @run-at document-start
  11. // ==/UserScript==
  12. //
  13. /*
  14. See Settings->About->Available checks for complete list of checks and their params.
  15. Examples:
  16. Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
  17. "170.enabled": true,
  18. "170.params": {
  19. "regexp": "/^((exit|to) )?[a-z]/",
  20. "},
  21. Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
  22. "130.enabled": true,
  23. "130.params": {
  24. "titleEN": "Street name with a dot",
  25. "problemEN": "There is a dot in the street name (excluding Ramps)",
  26. "solutionEN": "Expand the abbreviation or remove the dot",
  27. "template": "${type}:${street}",
  28. "regexp": "D/^[^4][0-9]?:.*\\./",
  29. },
  30. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  31. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  32. */
  33.  
  34. window.WME_Validator_United_States = {
  35. ".country": "United States",
  36. ".codeISO": "US",
  37. ".author": "xanderb",
  38. ".updated": "2016-07-01",
  39. ".link": "TODO: ",
  40. "128.enabled": true,
  41. "128.params": {
  42. "titleEN": "Not West Virginia",
  43. "problem": "The segment is assigned to another state",
  44. "solutionEN": "Make sure you are editing in WV and change it",
  45. "template": "${state}",
  46. "regexp": "!/^West Virginia/"
  47. },
  48. "128.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  49. "129.enabled": true,
  50. "129.params": {
  51. "titleEN": "Incorrect State or US Highway name",
  52. "problemEN": "West Virginia uses WV-xx for state and US-xx for national highway names",
  53. "solutionEN": "Rename the Street or Alt Street",
  54. "template": "${street}#${altStreet[#]}",
  55. "regexp": "/.*(Wv Hwy |State Hwy |State Rte |SR-|SH-|State Rd |WV=|^Rte |State Rte-|U\.?[Ss]\.? (Rte|[Hh](WY|wy|ighway)))/"
  56. },
  57. "129.solutionLink": "W:West_Virginia",
  58. "130.enabled": true,
  59. "130.params": {
  60. "titleEN": "Short Parking Lot",
  61. "problemEN": "Dead End Parking Lot is less that 30 meters",
  62. "solutionEN": "Does it really need to be there?",
  63. "template": "${deadEnd}:${typeRank}:${length}",
  64. "regexp": "/1:7:([0-2]?[0-9])$/"
  65. },
  66. "130.solutionLink": "W:Best_map_editing_practice#Parking_Lots",
  67. "131.enabled": true,
  68. "131.params": {
  69. "titleEN": "Bad TTS Street name",
  70. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  71. "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
  72. "template": "${street}#${altStreet[#]}",
  73. "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
  74. },
  75. "131.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  76. "132.enabled": true,
  77. "132.params": {
  78. "titleEN": "Wrong name for City or County street",
  79. "problemEN": "City or County Hwy Name is wrong",
  80. "solutionEN": "Check sources and change the street's name",
  81. "template": "${state}:${street}#${altStreet[#]}",
  82. "regexp": "/^West Virginia:.*(Cs-|CS-|Co Hwy |County Rd |Cr-|Co Rd |CH-|Ch-|Co Rte )/"
  83. },
  84. "132.solutionLink": "W:Highway_naming/USA",
  85. "133.enabled": true,
  86. "133.params": {
  87. "titleEN": "Wrong road type (minor)",
  88. "problemEN": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
  89. "solutionEN": "Change the road type to Minor Highway",
  90. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  91. "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"
  92. },
  93. "133.solutionLink": "W:Road_types/USA#Minor_Highway",
  94. "134.enabled": true,
  95. "134.severity": "warning",
  96. "134.params": {
  97. "titleEN": "Alley not PLR",
  98. "problemEN": "Alleys should be set to the PLR Road Type",
  99. "solutionEN": "Change Road Type",
  100. "template": "${street}:${typeRank}",
  101. "regexp": "/.*(Alley| Aly):[^7]/"
  102. },
  103. "134.solutionLink": "W:Road_types/USA#Parking_Lot_Road",
  104. "135.enabled": true,
  105. "135.params": {
  106. "titleEN": "Unapproved Non-drivable type",
  107. "problemEN": "Not all road types should be mapped",
  108. "solutionEN": "Have a Rank 5+ editor approve and lock it",
  109. "template": "${type}:${lock}",
  110. "regexp": "/(5|1[0569]):[1-4]/"
  111. },
  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|Laeger|Idamay|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": 3,
  159. },
  160. //Minor Highway lock
  161. "152.enabled": true,
  162. "152.params": {
  163. // {number} minimum lock level
  164. "n": 2,
  165. },
  166. //Ramp lock
  167. "153.enabled": true,
  168. "153.params": {
  169. // {number} minimum lock level
  170. "n": 4,
  171. },
  172. //Default US checks
  173. "24.enabled": !0,
  174. "25.enabled": !0,
  175. "27.enabled": !0,
  176. "34.enabled": !0,
  177. "35.enabled": !0,
  178. "38.enabled": !0,
  179. "39.enabled": !0,
  180. "43.enabled": !0,
  181. "48.enabled": !0,
  182. "78.enabled": !0,
  183. "87.enabled": !0,
  184. "90.enabled": !0,
  185. "106.enabled": !0,
  186. "107.enabled": !0,
  187. "108.enabled": !0,
  188. "109.enabled": !0,
  189. "112.enabled": !1,
  190. "118.enabled": !0,
  191. "116.enabled": !0,
  192. "119.enabled": !0,
  193. "120.enabled": !0,
  194. "121.enabled": !0,
  195. "172.enabled": !0,
  196. "173.enabled": !0,
  197. "190.enabled": !0,
  198. "192.enabled": !0,
  199. "170.enabled": !0,
  200. "170.params": {
  201. "regexp": "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  202. },
  203. "171.enabled": !0,
  204. };