WME Validator Localization for West Virginia

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

目前为 2015-12-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for West Virginia
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.1.25
  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": "2015-12-10",
  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 Highway",
  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]\.? [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": "!/.*(^$|\((Berkeley|Coalton\)|Webster)|A(ccoville|ddison|l(b(ans|right)|derson|ta|um)|mherstdale|n(awalt|moore|n|sted)|pple|shby|thens|u(burn|rora))|B(a(n(croft|k)|r(boursville|rackville|t(ley|ow))|th|yard)|e(a(rds|ver)|ckley|ech|l(ington|le|mont|va)|n(d|wood)|r(goo|wind)|th(any|lehem)|verly)|i(g|rch)|l(acksville|ennerhassett|ue(field|well))|o(az|l(ivar|t)|omer|ttom|wden)|r(a(d(ley|shaw)|mwell|nd(onville|ywine))|enton|idgeport|ookhaven|u(ceton|no|sh))|u(ckhannon|d|ffalo|r(lington|nsville)))|C(a(capon|iro|m(den\-on\-Gauley|eron)|pon|r(bon|olina|pendale)|ssville)|e(dar|ntury|redo)|h(a(pmanville|rl(eston|ton)|ttaroy|uncey)|e(at|lyan|s(apeake|ter))|imney)|ity|l(a(rksburg|y)|e(arview|ndenin))|o(al|mfort|rinne|vel|wen)|r(a(b|igsville)|eek|oss|umpler)|u(cumber|lloden|mberland))|D(a(iley|le|n(iels|ville)|v(is|y))|e(ep|lbarton|spard)|ixie|u(nbar|rbin))|E(ast|ccles|l(eanor|izabeth|k(ins|view)|lenboro)|nterprise)|F(a(ir(lea|mont|view)|ll(ing|s)|rmington|yetteville)|e(nwick|rr(is|y))|l(atwoods|emington)|o(llansbee|r(d|k|t))|r(anklin|iendly))|G(a(ll(ipolis|oway)|r(den|y)|ssaway|uley|y\-Shamrock)|hent|ilbert|l(asgow|enville)|r(a(fton|n(tsville|ville))|e(at|enview)|ove)|ypsy)|H(a(ll|m(bleton|lin)|ndley|r(man|pers|risville|t(ford|s))|ven)|e(ad|dgesville|ights|l(en|vetia)|n(d(erson|ricks)|lawson)|pzibah)|i(co|ll(sboro|top)|nton)|o(lden|metown|overson|pe)|u(n(dred|t(ersville|ington))|rricane|ttonsville))|I(damay|nwood|tmann)|J(a(ck(et|sonburg)|ne)|e(an|fferson)|u(n(ction|ior)|stice))|K(e(nova|rmit|ys(er|tone))|i(mb(all|erly)|n(caid|gwood)|stler)|opperston)|L(a(eger|ke|nes|shmeet|valette)|e(on|s(age|ter)|wisburg)|i(berty|ttleton)|o(gan|st)|u(beck|mberport))|M(a(bscott|cArthur|dison|llory|nnington|r(linton|met|tins(burg|ville)|ys)|sontown|t(ewan|heny|oaka)|ybeury)|c(Connell|Mechen)|eadow|i(ddle(bourne|way)|l(ford|ls|ton)|n(den|eralwells)|tchell)|o(n(aville|ongah|t(calm|gomery|rose))|orefield|rgantown|un(dsville|t))|ullens)|N(e(ibert|ttie|w(burg|ell))|itro|orthfork|utter)|O(akvale|ceana|mar|rchard)|P(a(den|geton|r(kersburg|sons)|w|x)|e(a|n(nsboro|tress)|ters(burg|town))|hilippi|i(ckens|edmont|n(ch|e(ville|y)))|leasant|o(ca|int|wellton)|r(att|i(chard|nceton)|osperity)|ullman)|Quinwood|R(a(c(hel|ine)|inelle|n(d|son)|venswood|ysal)|e(ader|d|ed(sville|y))|hodell|i(ch(mond|wood)|dgeley|pley|ve(r|sville))|o(binette|ck|derfield|mney|nceverte|ssmore|wlesburg)|upert)|S(a(l(em|t)|ndy|rah)|carbro|h(a(dy|nnondale)|e(nandoah|pherdstown)|innston|rewsbury)|is(sonville|tersville)|mith(ers|field)|o(phia|uth)|p(e(lter|ncer)|ring(field|s\)))|t(\.|a(naford|r)|o(llings|newood))|u(lphur|mm(ersville|it)|tton)|witzer|ylvester)|T(e(ays|rra)|h(omas|urmond)|ioga|own|riadelphia|unnelton|wilight)|U(nion|pper)|V(a(lley|n)|erdunville|i(e(nna|w)|vian))|W(a(rdensville|shington|ters|verly|yne)|e(irton|l(ch|lsburg)|sto(n|ver))|h(eeling|it(esville|mer))|i(l(ey|liams(on|town))|n(dsor|field))|o(lf|melsdorf|rthington))/"
  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": "Improper Cardinal Usage",
  142. "problemEN": "This name contains a cardinal direction (NEWS) which does not match wiki guidelines.",
  143. "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.",
  144. "template": "${street} ${altStreet[#]}",
  145. "regexp": "/(^| )([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[EeWw])['\":-]|[\"']([NnSs][EeWw]?|[EeWw])['\":-]?)(\\b|\\d| |$)/"
  146. },
  147. "139.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  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": true,
  204. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  205. "171.params": {
  206. "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|Tunl\\b|Long Is\\b|Brg\\b/",
  207. "problemEN": "The street name has incorrect abbreviation, or character",
  208. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  209. },
  210. };