WME Validator Localization for Wyoming

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

当前为 2015-12-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for Wyoming
  3. // @version 0.1.1
  4. // @author herrchin
  5. // @description This script localizes WME Validator for Wyoming, USA. You also need main package (WME Validator) installed.
  6. // @match https://editor-beta.waze.com/*editor/*
  7. // @match https://www.waze.com/*editor/*
  8. // @grant none
  9. // @run-at document-start
  10. // @namespace https://greasyfork.org/users/23100
  11. // ==/UserScript==
  12. //
  13. /*
  14. See Settings->About->Available checks for complete list of checks and their params.
  15.  
  16. Examples:
  17.  
  18. Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
  19. "170.enabled": true,
  20. "170.params": {
  21. "regexp": "/^((exit|to) )?[a-z]/",
  22. "},
  23.  
  24. Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
  25. "130.enabled": true,
  26. "130.params": {
  27. "titleEN": "Street name with a dot",
  28. "problemEN": "There is a dot in the street name (excluding Ramps)",
  29. "solutionEN": "Expand the abbreviation or remove the dot",
  30. "template": "${type}:${street}",
  31. "regexp": "D/^[^4][0-9]?:.*\\./",
  32. },
  33. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  34. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  35. */
  36.  
  37. window.WME_Validator_United_States = {
  38. ".country": "United States",
  39. ".codeISO": "US",
  40. ".author": "herrchin",
  41. ".updated": "2015-12-13",
  42. ".link": "TODO: ",
  43. "27.enabled": true,
  44. "90.enabled": true,
  45. "106.enabled": true,
  46. "112.enabled": false,
  47. // Catch State Hwy, County Rd, Co Rd, etc.
  48. "130.enabled": true,
  49. "130.params": {
  50. "titleEN": "Incorrect State Highway, County Road, or US Highway name",
  51. "problemEN": "Wyoming uses State Hwy ###, County Hwy ###, CR-## for properly abbreviated road names, and US-#",
  52. "solutionEN": "Rename the Street or Alt Street per Wyoming Wiki Standards",
  53. "template": "${state}:${street}#${altStreet[#]}",
  54. "regexp": "/Wyoming:.*(WY-\\d{2,3}|Co(unty)? R(oa)?d|U\\.?[Ss]\\.? [Hh](WY|wy|ighway))/",
  55. },
  56. "130.solutionLink": "https://wiki.waze.com/wiki/Wyoming#State_highway_naming",
  57. // Roads that have State set to something other than Wyoming (basemap issue). This will be NOISY outside Wyoming, so be sure to disable this script when editing elsewhere
  58. "131.enabled": true,
  59. "131.params": {
  60. "titleEN": "State is not set to Wyoming",
  61. "problemEN": "Basemap roads may be incorrectly set as something other than Wyoming",
  62. "solutionEN": "Verify that you are editing in Wyoming, then update the State field",
  63. "template": "${state}",
  64. "regexp": "!/^Wyoming/",
  65. },
  66. // Missing elevations
  67. // "131.enabled": true,
  68. // Wyoming locking standards
  69. // freeway
  70. "150.enabled": true,
  71. "150.params": {
  72. "n": 4,
  73. },
  74. "150.solutionLink": "https://wiki.waze.com/wiki/Wyoming#Locking_standard",
  75. // MH
  76. "151.enabled": true,
  77. "151.params": {
  78. "n": 4,
  79. },
  80. "151.solutionLink": "https://wiki.waze.com/wiki/Wyoming#Locking_standard",
  81. // mH
  82. "152.enabled": true,
  83. "152.params": {
  84. "n": 3,
  85. },
  86. "152.solutionLink": "https://wiki.waze.com/wiki/Wyoming#Locking_standard",
  87. // PS
  88. "154.enabled": true,
  89. "154.params": {
  90. "n": 2,
  91. },
  92. "154.solutionLink": "https://wiki.waze.com/wiki/Wyoming#Locking_standard",
  93. // Ramp
  94. "153.enabled": true,
  95. "153.params": {
  96. "n": 4,
  97. },
  98. "153.solutionLink": "https://wiki.waze.com/wiki/Wyoming#Locking_standard",
  99.  
  100. "170.enabled": true,
  101. "170.params": {
  102. "regexp": "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  103. },
  104. "171.enabled": true,
  105. "171.params": {
  106. "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|\\b[Ee]x[dn]\\b|Tunl\\b|Long Is\\b|Brg\\b/",
  107. "problemEN": "The street name has incorrect abbreviation, or character",
  108. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  109. },
  110. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations"
  111. };