WME Validator Missouri Localization

This script localizes WME Validator for United States. You also need main package (WME Validator) installed.

  1. // ==UserScript==
  2. // @name WME Validator Missouri Localization
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description This script localizes WME Validator for United States. You also need main package (WME Validator) installed.
  6. // @match https://beta.waze.com/*editor/
  7. // @author FastestBeef
  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.  
  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": "FastestBeef",
  41. ".updated": "2017-03-31",
  42. ".lng": "EN-US",
  43. ".link": "https://greasyfork.org/en/scripts/24545-wme-validator-missouri-localization",
  44.  
  45. "27.enabled": true, // no city name on railroad
  46.  
  47. //Freeway min lock
  48. "150.enabled": true,
  49. "150.params": {
  50. // {number} minimum lock level
  51. "n": 4,
  52. },
  53. //MH min lock
  54. "151.enabled": true,
  55. "151.params": {
  56. // {number} minimum lock level
  57. "n": 3,
  58. },
  59. //mH min lock
  60. "152.enabled": true,
  61. "152.params": {
  62. // {number} minimum lock level
  63. "n": 3,
  64. },
  65. //Ramp min lock
  66. "153.enabled": false,
  67. "153.params": {
  68. // {number} minimum lock level
  69. "n": 3,
  70. },
  71. // Primary Street min lock
  72. "154.enabled": true,
  73. "154.params": {
  74. // {number} minimum lock level
  75. "n": 2,
  76. },
  77. "167.enabled": true,
  78. "167.solutionLink": "W:Railroad#Railroad",
  79. "167.params": {
  80. "solutionEN": "Railroad should have no name rather than 'Railroad'",
  81. "regexp": "/^Railroad$/",
  82. },
  83. // check TTS, shamlessly stolen from xanderb
  84. "128.enabled": true,
  85. "128.params": {
  86. "titleEN": "Bad TTS Street name",
  87. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  88. "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
  89. "template": "${street}#${altStreet[#]}",
  90. "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
  91. },
  92.  
  93. // custom check: State must be Missouri
  94. "130.enabled": true,
  95. "130.params": {
  96. // {string} expandable template
  97. "template": "${state}",
  98. // {string} regular expression to match the template
  99. "regexp": "!/^Missouri$/",
  100. // {string} check title in English
  101. "titleEN": "Wrong state selected",
  102. // {string} problem description in English
  103. "problemEN": "Selected state must be Missouri",
  104. // {string} solution instructions in English
  105. "solutionEN": "Set state to Missouri if within state limits",
  106. },
  107. "131.enabled": true,
  108. "131.solutionLink": "W:Missouri#Major_roads",
  109. "131.params": {
  110. "titleEN": "Bad Street Name",
  111. "problemEN": "Street Name or Alt Name has been identified as incorrect. (dfa, nul, null, no street, MO-XX, SH-###)",
  112. "solutionEN": "Correct the street name, MO State Highway (MO-###) (refer to MO wiki), remove names dfa, nul, null, no street.",
  113. "template": "${state}:${street}#${altStreet[#]}#`",
  114. "regexp": "/^Missouri:.*\\b(?:dfa|nul|null|no street|(SR |CR |SH-|State Hwy |Co Rd |County Rd |County Road |Co Rte |Pvt Rd |SH )[0-9]+|(MO-|State Hwy |SH )[A-Z]+)\\b/i"
  115. },
  116. };