WME Validator Localization for Michigan

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

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

  1. // ==UserScript==
  2. // @name WME Validator Localization for Michigan
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.17
  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-07-01",
  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. "136.enabled": true,
  112. "136.params": {
  113. "titleEN": "Name on Railroad",
  114. "problemEN": "Names on Railroads are not needed for routing and clutter the app UI",
  115. "solutionEN": "Remove the Names and Cities from Railroad segments",
  116. "template": "${type}:${street}",
  117. "regexp": "/^18:.+$/"
  118. },
  119. "136.solutionLink": "W:Road_types/USA#Railroad",
  120. //There already is a city on freeway check, enable it
  121. "59.enabled": true,
  122. "59.solutionLink": "W:Michigan#City_Names_on_Freeway_Segments",
  123. //Freeway lock
  124. "150.enabled": true,
  125. "150.params": {
  126. // {number} minimum lock level
  127. "n": 5,
  128. },
  129. //Major Highway lock
  130. "151.enabled": true,
  131. "151.params": {
  132. // {number} minimum lock level
  133. "n": 3,
  134. },
  135. //Minor Highway lock
  136. "152.enabled": true,
  137. "152.params": {
  138. // {number} minimum lock level
  139. "n": 3,
  140. },
  141. //Ramp lock
  142. "153.enabled": true,
  143. "153.params": {
  144. // {number} minimum lock level
  145. "n": 3,
  146. },
  147. //Primary Street lock
  148. "154.enabled": true,
  149. "154.params": {
  150. // {number} minimum lock level
  151. "n": 2,
  152. },
  153. //Default US checks
  154. "24.enabled": !0,
  155. "25.enabled": !0,
  156. "27.enabled": !0,
  157. "34.enabled": !0,
  158. "35.enabled": !0,
  159. "38.enabled": !0,
  160. "39.enabled": !0,
  161. "43.enabled": !0,
  162. "48.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.enabled": !0,
  181. "170.params": {
  182. regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  183. },
  184. "171.enabled": true,
  185. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  186. "171.params": {
  187. "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/",
  188. "problemEN": "The street name has incorrect abbreviation, or character",
  189. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  190. },
  191. };