WME Validator Localization for Iowa

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

当前为 2016-05-20 提交的版本,查看 最新版本

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