WME Validator Localization for California

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

目前為 2015-10-31 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for California
  3. // @namespace https://gf.qytechs.cn/en/users/9555
  4. // @version 1.1.3
  5. // @author xanderb
  6. // @description This script localizes WME Validator for California, 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-10-31",
  39. ".link": "TODO: ",
  40. "130.enabled": true,
  41. "130.params": {
  42. "titleEN": "Incorrect State Highway",
  43. "problemEN": "California uses SR-xx or CA-xx for state and US-xx for national highway names",
  44. "solutionEN": "Rename the Street or Alt Street",
  45. "template": "${street}#${altStreet[#]}",
  46. "regexp": "/.*(Ca (Hwy|Rte) |St(ate)? ([Hh](WY|wy|ighway)|R(ou)?te|R(oa)?d) |SH-|(SR|CA)=|^R(ou)?te |St(ate)? R(ou)?te-|U\.?[Ss]\.? [Hh](WY|wy|ighway))/"
  47. },
  48. "130.solutionLink": "W:Highway_naming/USA",
  49. "131.enabled": true,
  50. "131.params": {
  51. "titleEN": "Bad TTS Street name",
  52. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  53. "solutionEN": "Add a period after Jr or St or Dr where required",
  54. "template": "${street}#${altStreet[#]}",
  55. "regexp": "/((^|#|(\\/|[NEWS]|Rue|Place)\\s)(St|Dr)|(Jr|Rev)) /"
  56. },
  57. "131.solutionLink": "W:Abbreviations_and_acronyms#Standard_suffix_abbreviations/USA",
  58. "132.enabled": true,
  59. "132.params": {
  60. "titleEN": "Wrong name for City or County street",
  61. "problemEN": "City or County Hwy Name is wrong",
  62. "solutionEN": "Check sources and change the street's name",
  63. "template": "${state}:${street}#${altStreet[#]}",
  64. "regexp": "/^California:.*(Cs-|CS-|Co(unty)? ([Hh](WY|wy|ighway)|R(ou)?te|R(oa)?d)( |-) |Cr-|C[Hh]-)/"
  65. },
  66. "132.solutionLink": "W:Highway_naming/USA",
  67. "133.enabled": true,
  68. "133.params": {
  69. "titleEN": "Wrong road type (minor)",
  70. "problemEN": "All US BUS, SPUR, LOOP highways and State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
  71. "solutionEN": "Change the road type to Minor Highway",
  72. "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
  73. "regexp": "/^[1-9][^2-5]:.*#((State Hwy |State Rte |SR-|SH-|CA-|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"
  74. },
  75. "133.solutionLink": "W:Road_types/USA#Minor_Highway",
  76. "134.enabled": true,
  77. "134.severity": "warning",
  78. "134.params": {
  79. "titleEN": "Alley not PLR",
  80. "problemEN": "Alleys should be set to the PLR Road Type",
  81. "solutionEN": "Change Road Type",
  82. "template": "${street}:${typeRank}",
  83. "regexp": "/.*(Alley| Aly):[^7]/"
  84. },
  85. "134.solutionLink": "W:Road_types/USA#Parking_Lot_Road",
  86. "135.enabled": true,
  87. "135.params": {
  88. "titleEN": "Not California",
  89. "problem": "The segment is assigned to another state",
  90. "solutionEN": "Make sure you are editing in WV and change it",
  91. "template": "${state}",
  92. "regexp": "!/California/"
  93. },
  94. "135.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  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. "137.enabled": true,
  105. "137.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": "/I- /"
  111. },
  112. "137.solutionLink": "W:Road_names/USA#United_States_Interstate_Highway_System",
  113. "138.enabled": true,
  114. "138.params": {
  115. "titleEN": "The legendary Portola Valley smudge",
  116. "problemEN": "Portola Valley is on segments that it should not be",
  117. "solutionEN": "Check to make sure you are not actually in Portola Valley and remove the incorrect City Name",
  118. "template": "$city#$altCity[#]",
  119. "regexp": "/^Portola Valley$/"
  120. }
  121. "139.enabled": true,
  122. "139.params": {
  123. "titleEN": "Improper Cardinal Usage",
  124. "problemEN": "This name contains a cardinal direction (NEWS) which does not match wiki guidelines.",
  125. "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.",
  126. "template": "${street} ${altStreet[#]}",
  127. "regexp": "/(^| )([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[EeWw])['\":-]|[\"']([NnSs][EeWw]?|[EeWw])['\":-]?)(\\b|\\d| |$)/"
  128. },
  129. "139.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  130. //Freeway lock
  131. "150.enabled": true,
  132. "150.params": {
  133. // {number} minimum lock level
  134. "n": 5,
  135. },
  136. //Major Highway lock
  137. "151.enabled": true,
  138. "151.params": {
  139. // {number} minimum lock level
  140. "n": 3,
  141. },
  142. //Minor Highway lock
  143. "152.enabled": true,
  144. "152.params": {
  145. // {number} minimum lock level
  146. "n": 2,
  147. },
  148. //Primary Street lock
  149. "154.enabled": true,
  150. "154.params": {
  151. // {number} minimum lock level
  152. "n": 2,
  153. },
  154. //Ramp lock
  155. "153.enabled": true,
  156. "153.params": {
  157. // {number} minimum lock level
  158. "n": 5,
  159. },
  160. //Default US checks
  161. "24.enabled": !0,
  162. "25.enabled": !0,
  163. "27.enabled": !0,
  164. "34.enabled": !0,
  165. "35.enabled": !0,
  166. "38.enabled": !0,
  167. "39.enabled": !0,
  168. "43.enabled": !0,
  169. "48.enabled": !0,
  170. "78.enabled": !0,
  171. "87.enabled": !0,
  172. "90.enabled": !0,
  173. "106.enabled": !0,
  174. "107.enabled": !0,
  175. "108.enabled": !0,
  176. "109.enabled": !0,
  177. "112.enabled": !1,
  178. "118.enabled": !0,
  179. "116.enabled": !0,
  180. "119.enabled": !0,
  181. "120.enabled": !0,
  182. "121.enabled": !0,
  183. "172.enabled": !0,
  184. "173.enabled": !0,
  185. "190.enabled": !0,
  186. "192.enabled": !0,
  187. "170.enabled": !0,
  188. "170.params": {
  189. regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  190. },
  191. "171.enabled": true,
  192. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  193. "171.params": {
  194. "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/",
  195. "problemEN": "The street name has incorrect abbreviation, or character",
  196. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  197. },
  198. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址