WME Validator Localization for Michigan

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

目前为 2016-03-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for Michigan
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.15
  5. // @author xanderb
  6. // @description This script localizes WME Validator for Michigan, 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-03-20",
  39. ".link": "TODO: ",
  40. "128.enabled": true,
  41. "128.params": {
  42. "titleEN": "Bad TTS Street name",
  43. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  44. "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
  45. "template": "${street}#${altStreet[#]}",
  46. "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
  47. },
  48. "128.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  49. "129.enabled": true,
  50. "129.params": {
  51. "titleEN": "Incorrect State or US Highway",
  52. "problemEN": "Michigan uses M- for state and US- for national highway names",
  53. "solutionEN": "Rename the Street or Alt Street",
  54. "template": "${state}:${street}#${altStreet[#]}",
  55. "regexp": "/Michigan:.*(Michigan [Hh]wy |[Ss]tate [Hh]wy |M[Ii]-|SH-|[Ss]tate [Rr]d |SR-|State Rte |M=|U\.?[Ss]\.? [Hh](WY|wy|ighway))/"
  56. },
  57. "129.solutionLink": "W:Michigan",
  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": "Not Michigan",
  70. "problem": "The segment is assigned to another state",
  71. "solutionEN": "Make sure you are editing in MI and change it",
  72. "template": "${state}",
  73. "regexp": "!/Michigan/"
  74. },
  75. "131.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  76. "132.enabled": true,
  77. "132.params": {
  78. "titleEN": "Wrong name for City or County street",
  79. "problemEN": "CS and Cs are not read correctly by TTS or County Hwy Name is wrong",
  80. "solutionEN": "Check sources and change the street's name",
  81. "template": "${state}:${street}#${altStreet[#]}",
  82. "regexp": "/Michigan:.*(Cs-|CS-|County Hwy|County Rd|Cr-|Co Rd|Ch-|CH-)/"
  83. },
  84. "132.solutionLink": "W:Highway_naming/USA",
  85. "133.enabled": true,
  86. "133.params": {
  87. "titleEN": "City name included with MI Hwy alt name",
  88. "problemEN": "State Roads with M-xx in Altname should not have a city name",
  89. "solutionEN": "Reinput the M-xx alternate name without the city",
  90. "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]}",
  91. "regexp": "/@M-[0-9]{1,3}[A-Z]?#[^@]+/"
  92. },
  93. "133.solutionLink": "W:Michigan",
  94. "134.enabled": true,
  95. "134.params": {
  96. "titleEN": "Potential Incorrect Abbreviation",
  97. "problemEN": "Name abbreviation may be incorrect. Alternative routes should be labeled ALT and abbreviations ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK should be in ALL CAPS",
  98. "solutionEN": "Change abbreviation to ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK in ALL CAPS",
  99. "template": "${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
  100. "regexp": "/!?[0-9].+(Alt|Business|Bus|Byp|Conn|Loop|Scn|Spur|Truck)\\b/"
  101. },
  102. "135.enabled": true,
  103. "135.params": {
  104. "titleEN": "One Way Lock Standard",
  105. "problemEN": "One Way Street and Primary Street should be one lock higher",
  106. "solutionEN": "Set One Way Street to L2 and Primary Street to L3",
  107. "template": "${type}:${lock}:${direction}",
  108. "regexp": "/(2:(1|2):(1|2))|(1:1:(1|2))/"
  109. },
  110. "135.solutionLink": "W:Great_Lakes#Minimum_Road_Lock_Standard",
  111. //There already is a city on freeway check, enable it
  112. "59.enabled": true,
  113. "59.solutionLink": "W:Michigan#City_Names_on_Freeway_Segments",
  114. //Freeway lock
  115. "150.enabled": true,
  116. "150.params": {
  117. // {number} minimum lock level
  118. "n": 5,
  119. },
  120. //Major Highway lock
  121. "151.enabled": true,
  122. "151.params": {
  123. // {number} minimum lock level
  124. "n": 3,
  125. },
  126. //Minor Highway lock
  127. "152.enabled": true,
  128. "152.params": {
  129. // {number} minimum lock level
  130. "n": 3,
  131. },
  132. //Ramp lock
  133. "153.enabled": true,
  134. "153.params": {
  135. // {number} minimum lock level
  136. "n": 3,
  137. },
  138. //Primary Street lock
  139. "154.enabled": true,
  140. "154.params": {
  141. // {number} minimum lock level
  142. "n": 2,
  143. },
  144. //Default US checks
  145. "24.enabled": !0,
  146. "25.enabled": !0,
  147. "27.enabled": !0,
  148. "34.enabled": !0,
  149. "35.enabled": !0,
  150. "38.enabled": !0,
  151. "39.enabled": !0,
  152. "43.enabled": !0,
  153. "48.enabled": !0,
  154. "78.enabled": !0,
  155. "87.enabled": !0,
  156. "90.enabled": !0,
  157. "106.enabled": !0,
  158. "107.enabled": !0,
  159. "108.enabled": !0,
  160. "109.enabled": !0,
  161. "112.enabled": !1,
  162. "118.enabled": !0,
  163. "116.enabled": !0,
  164. "119.enabled": !0,
  165. "120.enabled": !0,
  166. "121.enabled": !0,
  167. "172.enabled": !0,
  168. "173.enabled": !0,
  169. "190.enabled": !0,
  170. "192.enabled": !0,
  171. "170.enabled": !0,
  172. "170.params": {
  173. regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  174. },
  175. "171.enabled": true,
  176. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  177. "171.params": {
  178. "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|Don)).|#|^)\'(?![stl]\\b)|(#|^)\'s|(?!\\b((In|Na)t|Don)).{3}\'[lt]|(#|^).{0,2}\'[lt])|(Dr|St)\\.(#|$)|,|;|\\\\|((?!\\.( |#|$|R))\\..|(?!\\.( .|#.|$|R\\.))\\..{2}|\\.R(#|$|\\.R))|[Ee]x(p|w)y\\b|Tunl\\b|Long Is\\b|Brg\\b/",
  179. "problemEN": "The street name has incorrect abbreviation, or character",
  180. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  181. },
  182. };