WME Validator Localization for New York

This script localizes WME Validator for New York. You also need main package (WME Validator) installed.

当前为 2015-10-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for New York
  3. // @namespace https://greasyfork.org/en/users/15052
  4. // @version 1.0.53
  5. // @author New York Editors
  6. // @credit Credit to xanderb for the base template.
  7. // @description This script localizes WME Validator for New York. You also need main package (WME Validator) installed.
  8. // @match https://editor-beta.waze.com/*editor/*
  9. // @match https://www.waze.com/*editor/*
  10. // @grant none
  11. // @run-at document-start
  12. // ==/UserScript==
  13. //
  14. /*
  15. See Settings->About->Available checks for complete list of checks and their params.
  16. Examples:
  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. Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
  23. "130.enabled": true,
  24. "130.params": {
  25. "titleEN": "Street name with a dot",
  26. "problemEN": "There is a dot in the street name (excluding Ramps)",
  27. "solutionEN": "Expand the abbreviation or remove the dot",
  28. "template": "${type}:${street}",
  29. "regexp": "D/^[^4][0-9]?:.*\\./",
  30. },
  31. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  32. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  33. */
  34.  
  35. window.WME_Validator_United_States = {
  36. ".country": "United States",
  37. ".codeISO": "US",
  38. ".author": "tythesly",
  39. ".updated": "2015-10-01",
  40. ".link": "TODO: ",
  41. //Default US checks
  42. "27.enabled": true,
  43. "90.enabled": true,
  44. "106.enabled": true,
  45. "112.enabled": false,
  46. "128.enabled": true,
  47. "128.params": {
  48. "titleEN": "Bad TTS Street name",
  49. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  50. "solutionEN": "Add a period after St or Dr at the beginning of the street name",
  51. "template": "${street}#${altStreet[#]}",
  52. "regexp": "/^([SNEW] )+(St |Dr )|^St |^Dr |Jr |Rev /"
  53. },
  54. "128.solutionLink": "W:Abbreviations_and_acronyms#Standard_suffix_abbreviations",
  55. "129.enabled": true,
  56. "129.params": {
  57. "titleEN": "Incorrect County, State or US Highway",
  58. "problemEN": "New York uses NY- for state and US- for national highway names",
  59. "solutionEN": "Rename the Street or Alt Street",
  60. "template": "${state}:${street}#${altStreet[#]}",
  61. "regexp": /^New York:.*(([Uu]\.? ?( S|S\.|s\.?)|[Nn](ew )?(y|[Yy]ork)? ?|[Ss](tate )?|[Cc](o(unty)? )?)((R|r)((ou)?(te)?|(oa)?d)|[Hh]((igh)?[Ww]a?[Yy])?)?|Ny|NY=|I- |(NY|I|CR|US) )(-| ?)\d+/
  62. },
  63. "129.solutionLink": "W:New_York#Local_naming_variations",
  64. "130.enabled": true,
  65. "130.params": {
  66. "titleEN": "Short Parking Lot",
  67. "problemEN": "Dead End Parking Lot is less that 30 meters",
  68. "solutionEN": "Does it really need to be there?",
  69. "template": "${deadEnd}:${typeRank}:${length}",
  70. "regexp": "/1:7:([0-2]?[0-9])$/"
  71. },
  72. "130.solutionLink": "W:Best_map_editing_practice#Parking_Lots",
  73. "131.enabled": true,
  74. "131.params": {
  75. "titleEN": "Not New York",
  76. "problem": "The segment is assigned to another state",
  77. "solutionEN": "Make sure you are editing in NY and change it",
  78. "template": "${state}",
  79. "regexp": "!/^New York/"
  80. },
  81. "131.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  82. "132.enabled": false,
  83. "132.params": {
  84. "titleEN": "Wrong name for City or County street",
  85. "problemEN": "CS and Cs are not read correctly by TTS or County Hwy Name is wrong",
  86. "solutionEN": "Check sources and change the street's name",
  87. "template": "${state}:${street}#${altStreet[#]}",
  88. "regexp": "/^New York:.*(Cs-|CS-|County Hwy|County Rd|Cr-|Co Rd|Ch-|CH-)/"
  89. },
  90. "132.solutionLink": "W:Highway_naming/USA",
  91. "134.enabled": true,
  92. "134.params": {
  93. "titleEN": "Potential Incorrect Abbreviation",
  94. "problemEN": "Name abbreviation may be incorrect. Alternative routes should be labeled ALT and abbreviations ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK should be in ALL CAPS",
  95. "solutionEN": "Change abbreviation to ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK in ALL CAPS",
  96. "template": "${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
  97. "regexp": "/!?[0-9].+(Alt|Business|Bus|Byp|Conn|Loop|Scn|Spur|Truck)\\b/"
  98. },
  99. //There already is a city on freeway check, enable it
  100. "59.enabled": true,
  101. //Freeway lock
  102. "150.enabled": true,
  103. "150.params": {
  104. // {number} minimum lock level
  105. "n": 5,
  106. },
  107. //Major Highway lock
  108. "151.enabled": true,
  109. "151.params": {
  110. // {number} minimum lock level
  111. "n": 4,
  112. },
  113. //Minor Highway lock
  114. "152.enabled": true,
  115. "152.params": {
  116. // {number} minimum lock level
  117. "n": 3,
  118. },
  119. //Ramp lock
  120. "153.enabled": true,
  121. "153.params": {
  122. // {number} minimum lock level
  123. "n": 2,
  124. },
  125. //Primary Street lock
  126. "154.enabled": true,
  127. "154.params": {
  128. // {number} minimum lock level
  129. "n": 2,
  130. },
  131. "170.enabled": !0,
  132. "170.params": {
  133. regexp: "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/"
  134. },
  135. "171.enabled": true,
  136. "171.solutionLink": "W:Abbreviations_&_Acronyms#Standard_Suffix_Abbreviations"
  137. };