WME Validator Localization for Massachusetts

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

当前为 2015-10-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for Massachusetts
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.1.18
  5. // @author xanderb
  6. // @description This script localizes WME Validator for Massachusetts, 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. Rules 135, and 138 updated by dbsooner
  15. See Settings->About->Available checks for complete list of checks and their params.
  16. Examples:
  17. Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
  18. "170.enabled": true,
  19. "170.params": {
  20. "regexp": "/^((exit|to) )?[a-z]/",
  21. "},
  22. Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
  23. "130.enabled": true,
  24. "130.params": {
  25. "titleEN": "Street name with a dot",
  26. "problemEN": "There is a dot in the street name (excluding Ramps)",
  27. "solutionEN": "Expand the abbreviation or remove the dot",
  28. "template": "${type}:${street}",
  29. "regexp": "D/^[^4][0-9]?:.*\\./",
  30. },
  31. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  32. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  33. */
  34.  
  35. window.WME_Validator_United_States = {
  36. ".country": "United States",
  37. ".codeISO": "US",
  38. ".author": "xanderb",
  39. ".updated": "2015-10-31",
  40. ".link": "TODO: ",
  41. "130.enabled": true,
  42. "130.params": {
  43. "titleEN": "City name on SR Alt",
  44. "problemEN": "State Roads with SR-xx as Alt should not have a city name",
  45. "solutionEN": "Reinput the SR alternate without the city name",
  46. "template": "@${altStreet[0]}#${altCity[0]}@${altStreet[1]}#${altCity[1]}@${altStreet[2]}#${altCity[2]}@@${altStreet[3]}#${altCity[3]}@${altStreet[4]}#${altCity[4]}@${altStreet[5]}#${altCity[5]}",
  47. "regexp": "/@SR-[0-9]{1,4}[A-Z]?#[^@]+/"
  48. },
  49. "131.enabled": true,
  50. "131.params": {
  51. "titleEN": "Improper Exit Naming",
  52. "problemEN": "This segment has an entrance / exit name which does not follow the USA standards for exit naming, or is a ramp with non entrance / exit name",
  53. "solutionEN": "For numbered exits use \"Exit(s) ##: Name / Other Name\". For entrances & unnumbered exits use \"to Name / Other Name\". Separate all shields and names with slashes (/) and spaces. Verify if this is supposed to be a ramp",
  54. "template": "${rank}#${street}",
  55. "regexp": "/4#(?!(Exit|to|$))|( |\\b)(To|[Ee](?!xits? [\\dA-Z-]+:)[Xx][Ii][Tt][Ss]?( [Tt][Oo])?:?|to:|TO|Exits? \\d+[\\w\\-]*( \\\/ | \\- | |:[ \\w]*:))( |\\b|$)/"
  56. },
  57. "131.solutionLink": "W:Massachusetts",
  58. "132.enabled": true,
  59. "132.params": {
  60. "titleEN": "Wrong name for City or County street",
  61. "problemEN": "City or County Hwy Name is not used here",
  62. "solutionEN": "Check sources and change the street's name",
  63. "template": "${state}:${street}#${altStreet[#]}",
  64. "regexp": "/Massachusetts:.*(Cs-|CS-|County Hwy |County Rd |Cr-|Co Rd |CH-|Ch-|Co Rte )/"
  65. },
  66. "132.solutionLink": "W:Highway_naming/USA",
  67. "133.enabled": true,
  68. "133.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 or St or Dr where required",
  72. "template": "${street}#${altStreet[#]}",
  73. "regexp": "/((^|#|(\\/|[NEWS]|Rue|Place)\\s)(St|Dr)|(Jr|Rev)) /"
  74. },
  75. "133.solutionLink": "W:Abbreviations_and_acronyms#Standard_suffix_abbreviations",
  76. "134.enabled": true,
  77. "134.severity": "warning",
  78. "134.params": {
  79. "titleEN": "Alley not Private Road",
  80. "problemEN": "Named Alleys should be set to the Private Road Type",
  81. "solutionEN": "Change Road Type",
  82. "template": "${street}:${typeRank}",
  83. "regexp": "/.*(Alley| Aly):[^6]/"
  84. },
  85. "134.solutionLink": "W:Road_types/USA#Parking_Lot_Road",
  86. "135.enabled": true,
  87. "135.params": {
  88. "titleEN": "Incorrect Highway Name",
  89. "problemEN": "Massachusetts uses SR for state and US for national highway names",
  90. "solutionEN": "Rename the Street or Alt Street",
  91. "template": "${state}:${street}#${altStreet[#]}",
  92. "regexp": "/Massachusetts:.*([Mm][Aa] [Hh][Ww][Yy] |[Ss]tate [Hh][Ww][Yy] |[Mm][Aa]-|[Mm][Aa] -|[Ss][Hh]-|[Ss][Hh] -|[Ss]tate [Rr][Dd] |[Ss][Rr]=|[Ss][Rr] |[Ss]r-|s[Rr]-|[Ss]tate [Rr]te |[Rr][Tt][Ee] |U\.?[Ss]\.? [Hh](WY|wy|ighway))/"
  93. },
  94. "135.solutionLink": "W:Massachusetts",
  95. "136.enabled": true,
  96. "136.params": {
  97. "titleEN": "Wrong road type",
  98. "problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
  99. "solutionEN": "Change the road type to Major Highway",
  100. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  101. "regexp": "/^[1-9][^245]?:.*#(US Hwy |US-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*@/i"
  102. },
  103. "136.solutionLink": "W:Road_types/USA#Major_Highway",
  104. "138.enabled": true,
  105. "138.params": {
  106. "titleEN": "Invalid Interstate Name",
  107. "problemEN": "There seems to be an extra space there",
  108. "SolutionEN": "Remove the extra space in the name",
  109. "template": "${street}#${altStreet[#]}",
  110. "regexp": "/[Ii]- |i-/"
  111. },
  112. "138.solutionLink": "W:Road_names/USA#United_States_Interstate_Highway_System",
  113. "139.enabled": true,
  114. "139.params": {
  115. "titleEN": "City Name on Freeway",
  116. "problemEN": "City names on Freeway segments can cause detours",
  117. "solutionEN": "Remove the City Name",
  118. "template": "${typeRank}:${city}",
  119. "regexp": "/15:.+$/"
  120. },
  121. "139.solutionLink": "W:Massachusetts#City_Names_on_Freeway_Segments",
  122. //Freeway lock
  123. "150.enabled": true,
  124. "150.params": {
  125. // {number} minimum lock level
  126. "n": 5,
  127. },
  128. //Major Highway lock
  129. "151.enabled": true,
  130. "151.params": {
  131. // {number} minimum lock level
  132. "n": 4,
  133. },
  134. //Minor Highway lock
  135. "152.enabled": true,
  136. "152.params": {
  137. // {number} minimum lock level
  138. "n": 3,
  139. },
  140. //Ramp lock
  141. "153.enabled": true,
  142. "153.params": {
  143. // {number} minimum lock level
  144. "n": 2,
  145. },
  146. //Primary Street lock
  147. "154.enabled": true,
  148. "154.params": {
  149. // {number} minimum lock level
  150. "n": 2,
  151. },
  152. //Default US checks
  153. "24.enabled": !0,
  154. "25.enabled": !0,
  155. "27.enabled": !0,
  156. "34.enabled": !0,
  157. "35.enabled": !0,
  158. "38.enabled": !0,
  159. "39.enabled": !0,
  160. "43.enabled": !0,
  161. "48.enabled": !0,
  162. "50.enabled": !0,
  163. "78.enabled": !0,
  164. "87.enabled": !0,
  165. "90.enabled": !0,
  166. "106.enabled": !0,
  167. "107.enabled": !0,
  168. "108.enabled": !0,
  169. "109.enabled": !0,
  170. "112.enabled": !1,
  171. "118.enabled": !0,
  172. "116.enabled": !0,
  173. "119.enabled": !0,
  174. "120.enabled": !0,
  175. "121.enabled": !0,
  176. "172.enabled": !0,
  177. "173.enabled": !0,
  178. "190.enabled": !0,
  179. "192.enabled": !0,
  180. // #170 ## Enable check for lower case street name
  181. "170.enabled": true,
  182. "170.params": {
  183. regexp: "/^(?!to [^a-z])((S|N|W|E)(E|W)? )?[a-z]/"
  184. },
  185. // #171 ## Check for improper use of a period (.) that is not on the USA recommended abbreviations list.
  186. "171.enabled": true,
  187. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  188. "171.params": {
  189. "regexp": "/((?!(\\bPhila|\\bPenna|.(\\bWash|\\bCmdr|\\bProf|\\bPres)|..(Adm|\\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}\\.|(?!(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}\\.|(?!(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}\\.|(#|^)[^NEWSR]?\\.)|(((?!\\b(D|O)).|#|^)\'(?![sl]\\b)|(?!\\bNat).{3}\'l|(#|^).{0,2}\'l)|(Dr|St)\\.(#|$)|,|;|\\\\|((?!\\.( |#|$|R))\\..|(?!\\.( .|#.|$|R\\.))\\..{2}|\\.R(#|$|\\.R))|[Ee]x(p|w)y|Tunl|Long Is\\b|Brg/",
  190. "problemEN": "The street name has incorrect abbreviation, or character",
  191. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  192. },
  193. };