WME Validator Localization for Iowa

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

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