WME Validator Localization for Minnesota

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

当前为 2016-06-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for Minnesota
  3. // @namespace https://greasyfork.org/en/users/9555
  4. // @version 1.1.1.13
  5. // @author gadgetmts, via xanderb
  6. // @description This script localizes WME Validator for Minnesota, 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. */
  35.  
  36. window.WME_Validator_United_States = {
  37. ".country": "United States",
  38. ".codeISO": "US",
  39. ".author": "xanderb, hacked by gadgetmts",
  40. ".updated": "2016-6-28",
  41. ".link": "TODO: ",
  42. "128.enabled": true,
  43. "128.params": {
  44. "titleEN": "Bad TTS Street name",
  45. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  46. "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
  47. "template": "${street}#${altStreet[#]}",
  48. "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
  49. },
  50. "128.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  51. "129.enabled": true,
  52. "129.params": {
  53. "titleEN": "Incorrect State or US Highway",
  54. "problemEN": "Minnesota uses MN and US for numbered highway names",
  55. "solutionEN": "Rename the Street or Alt Street",
  56. "template": "${state}:${street}#${altStreet[#]}",
  57. "regexp": "/Minnesota:.*(Mn Hwy |State Hwy |Mn-|SR-|SH-|State Rd |MN=|State Rte |U\.?[Ss]\.? [Hh](WY|wy|ighway)])/"
  58. },
  59. "129.solutionLink": "W:Minnesota",
  60. "130.enabled": true,
  61. "130.params": {
  62. "titleEN": "Short Parking Lot",
  63. "problemEN": "Dead End Parking Lot is less that 30 meters",
  64. "solutionEN": "Does it really need to be there?",
  65. "template": "${deadEnd}:${typeRank}:${length}",
  66. "regexp": "/1:7:([0-2]?[0-9])$/"
  67. },
  68. "130.solutionLink": "W:Best_map_editing_practice#Parking_Lots",
  69. "131.enabled": true,
  70. "131.params": {
  71. "titleEN": "Not Minnesota",
  72. "problem": "The segment is assigned to another state",
  73. "solutionEN": "Make sure you are editing in Minnesota and change it",
  74. "template": "${state}",
  75. "regexp": "!/Minnesota/"
  76. },
  77. "131.solutionLink":"W:Creating_and_editing_road_segments#Address_Properties",
  78. "132.enabled": true,
  79. "132.params": {
  80. "titleEN": "Wrong name for City or County street",
  81. "problemEN": "CS and Cs are not read correctly by TTS or County Hwy Name is wrong",
  82. "solutionEN": "Check sources and change the street's name",
  83. "template": "${state}:${street}#${altStreet[#]}",
  84. "regexp": "/Minnesota:.*(Cs-|CS-|County Hwy |County Rd |Cr-|Ch-|Co Rd )/"
  85. },
  86. "132.solutionLink": "W:Minnesota",
  87. "133.enabled": true,
  88. "133.params": {
  89. "titleEN": "City Name on Freeway",
  90. "problemEN": "City names on Freeway segments can cause detours",
  91. "solutionEN": "Remove the City Name",
  92. "template": "${typeRank}:${city}",
  93. "regexp": "/15:.+$/"
  94. },
  95. "134.enabled": true,
  96. "134.params": {
  97. "titleEN": "Name on Railroad",
  98. "problemEN": "Names on Railroads are not needed for routing and clutter the app UI",
  99. "solutionEN": "Remove the Names and Cities from Railroad segments",
  100. "template": "${type}:${street}",
  101. "regexp": "/18:.+$/"
  102. },
  103. "134.solutionLink": "W:Road_types/USA#Railroad",
  104. "135.enabled": true,
  105. "135.params": {
  106. "titleEN": "Wrong road type (major)",
  107. "problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
  108. "solutionEN": "Change the road type to Major Highway",
  109. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  110. "regexp": "/^[1-9][^245]?:.*#(US Hwy |US-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*@/i"
  111. },
  112. "135.solutionLink": "W:Road_types/USA#Major_Highway",
  113. "136.enabled": true,
  114. "136.params": {
  115. "titleEN": "Wrong road type (minor)",
  116. "problemEN": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
  117. "solutionEN": "Change the road type to Minor Highway",
  118. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  119. "regexp": "/^[1-9][^2-5]:.*#((State Hwy |SR-|SH-|IL-|IN-|K-|LA-|M-|MA-|MN-|MO-|MS-|NC-|ND-|NJ-|NV-|NY-|SC-|SD-|TN-|VT-|WIS-)[0-9]+( ALT| BYP| CONN| TRUCK| Scenic| [NSWE])*|(US Hwy |US-)[0-9]+( BUS| LOOP| SPUR)+( [NSWE])?)@/i"
  120. },
  121. "136.solutionLink": "W:Road_types/USA#Minor_Highway",
  122. "137.enabled": true,
  123. "137.params": {
  124. "titleEN": "Wrong road type (primary)",
  125. "problemEN": "All State BUS, SPUR, LOOP Highways should be at least Primary Street type",
  126. "solutionEN": "Change the road type to Primary Street",
  127. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  128. "regexp": "/^[1-9][^1-5]:.*#(State Hwy |SR-|SH-|IL-|IN-|K-|LA-|M-|MA-|MN-|MO-|MS-|NC-|ND-|NJ-|NV-|NY-|SC-|SD-|TN-|VT-|WIS-)[0-9]+( BUS| LOOP| SPUR)+( [NSWE])?@/i"
  129. },
  130. "137.solutionLink": "W:Road_types/USA#Primary_Street",
  131. "138.enabled": true,
  132. "138.params": {
  133. "titleEN": "Wrong banner abbreviation",
  134. "problemEN": "Banner abbreviation may be incorrect. Abbreviations ALT, BUS, BYP, CONN, LOOP, and SPUR should be in ALL CAPS",
  135. "solutionEN": "Change banner abbreviation to ALT, BUS, BYP, CONN, LOOP, SPUR, or TRUCK",
  136. "template": "${street}#${altStreet[#]}",
  137. "regexp": "/[0-9]+[A-Z]? ([Aa]lt(ernate)?|[Bb](us(iness)?|yp(ass)?)|[Cc]onn(ector)?|[Ll]oop|[Ss]pur|[Tt]ruck)/"
  138. },
  139. "138.solutionLink": "W:Road_names/USA#United_States_Numbered_Highways",
  140. "139.enabled": true,
  141. "139.params": {
  142. "titleEN": "Improper Cardinal Usage",
  143. "problemEN": "This name contains a cardinal direction (NEWS) which does not match wiki guidelines.",
  144. "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.",
  145. "template": "${street} ${altStreet[#]}",
  146. "regexp": "/(^| )([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[EeWw])['\":-]|[\"']([NnSs][EeWw]?|[EeWw])['\":-]?)(\\b|\\d| |$)/"
  147. },
  148. "139.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  149. "171.params": {
  150. // {string} regular expression to match incorrect abbreviations
  151. "regexp": "/\\.$/",
  152. },
  153. //Freeway lock
  154. "150.enabled": true,
  155. "150.params": {
  156. // {number} minimum lock level
  157. "n": 5,
  158. },
  159. //Major Highway lock
  160. "151.enabled": true,
  161. "151.params": {
  162. // {number} minimum lock level
  163. "n": 3,
  164. },
  165. //Minor Highway lock
  166. "152.enabled": true,
  167. "152.params": {
  168. // {number} minimum lock level
  169. "n": 3,
  170. },
  171. //Ramp lock
  172. "153.enabled": true,
  173. "153.params": {
  174. // {number} minimum lock level
  175. "n": 2,
  176. },
  177. //Primary Street lock
  178. "154.enabled": true,
  179. "154.params": {
  180. // {number} minimum lock level
  181. "n": 2,
  182. },
  183. //Default US checks
  184. "24.enabled": !0,
  185. "25.enabled": !0,
  186. "27.enabled": !0,
  187. "34.enabled": !0,
  188. "35.enabled": !0,
  189. "38.enabled": !0,
  190. "39.enabled": !0,
  191. "43.enabled": !0,
  192. "48.enabled": !0,
  193. "78.enabled": !0,
  194. "87.enabled": !0,
  195. "90.enabled": !0,
  196. "106.enabled": !0,
  197. "107.enabled": !0,
  198. "108.enabled": !0,
  199. "109.enabled": !0,
  200. "112.enabled": !1,
  201. "118.enabled": !0,
  202. "116.enabled": !0,
  203. "119.enabled": !0,
  204. "120.enabled": !0,
  205. "121.enabled": !0,
  206. "172.enabled": !0,
  207. "173.enabled": !0,
  208. "190.enabled": !0,
  209. "192.enabled": !0,
  210. "170.enabled": !0,
  211. "170.params": {
  212. regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  213. },
  214. "171.enabled": true,
  215. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  216. "171.params": {
  217. "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/",
  218. "problemEN": "The street name has incorrect abbreviation, or character",
  219. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  220. },
  221. };