WME Validator Localization for New York

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

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

  1. // ==UserScript==
  2. // @name WME Validator Localization for New York
  3. // @namespace https://greasyfork.org/en/users/15052
  4. // @version 1.1.931
  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. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAB9VBMVEUAAAD/gAD/nwD/lQD/nwD/mQD/lQD/kgD/mwD/lwD/nAD/mQD/lwD/mgD/mAD/mwD/mQD/lwD/mAD/mgD/mQD/mAD/mgD/mAD/mgD/mQD/mAD/mQD/mQD/mgD/mQD/////mAD/////mQD/////mQD/////mgD/mQD/////mAD/////mQD/mQD/mQD/////mgD//////Pj/mQD/////mAD/////mQD/mQD/////mgD/////mQD/mAD/////mQD/////mQD/////mgD/////mQD/mAD/////mQD/////mQD/mQD/////mQD/////mQD/////mQD/////mQD/////mQD/mQD/////mQD/////mQD/tkf/ulT/mQD/////mQD/mgD/mQD/////mgD/0Yz/mQD/////mQD///8AAAABAQECAgIDAwMJCQkRERESEhIWFhYZGRkaGhocHBwvLy8xMTFERERISEhXV1doaGhqamqBgYGEhISioqKjo6Ourq64uLi+vr7g4ODn5+fr6+v19fX4+Pj5+fn8/Pz9/f3+/v7/mQD/mwT/ngz/piD/qSj/rjT/s0D/uVD/u1T/w2j/xGz/xnD/x3T/zID/z4j/0Yz/05D/1pj/2aD/26T/3qz/5b//7M//79f/8dv/8t///Pf//fv////VAUOcAAAAaHRSTlMABAgMEBQYHBwgJCgsMDQ4PEBDR0tPU1dbX2Nna29zc3d3e3t/f4OHh4uLj5GTk5eXmZubn5+jp6erq6+zs7e3u7u/v8PHx8vLz9PT19fb29/f4+Pl5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PSiRVNM873wsccx8EyyVOVF83NoHI5lgL2RGSVVefI6MtWPZxAePE2pPtD88gNvFnyWvNIyCsQRqpJy++mvL/xCNoogDsJQwP62/XNcg4ywFDAe26AgDCWBEczqS0BMuS+BQenq6QoxGgWQDImhNPIgKSKscA0WIqiEhlz2Qqat3gyChAqSR5m2UojNVmIqaFklRLjKEvo8kiIcZSmH/ha207G4CFPpNGi9hwDCUCJGNwhViRp0ZN4/McRoS9lTJOO5HBBFWI2RqTRyQBip+SdGQTzlVBaII5rYUntUIRl0BDagXSCOQjSCoh+OnijBlQNeT5p9hmfQn+9m+BzTPGXTGY4BYFXHVtSDhc4RIKrQDLBMbXMwxyoQVE7005a1Yab4qTG4nJoVU05Qd/5gydfxUwNxttc2naEb4NZwYRaLGZjKgICSYexgTtJeGTfeymAq88m2QIPdjNOMKpSCr/LW4pZukDy8DbFiKMhC23ByZCcsEHKe6GZpfe/WTLLSgmvCd1PqXuRd+WhtXC3KUn+iRKiDhkKb7xjGrK5Pa25UykGoilKSZQmpjn27g/Eyxd8FjBcNY17X91X1hRZjPSKIka62ydGXCFbHIU3eGKTC2ZGv3QBjgTtiSDsXujSWJKF/w1CrRnJjflC4xmeGSmWtNmfErQuny+kkrbhfkmRZHlHcuC1sJ7s0rarPGcuoUNveD3oTGWlIlouynM+Cm3Ez/rfxH6STRnmdq/GgAAAAAElFTkSuQmCC
  13. // ==/UserScript==
  14. //
  15. /*
  16. See Settings->About->Available checks for complete list of checks and their params.
  17. Examples:
  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. 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": "New York State, USA",
  38. ".codeISO": "US",
  39. ".author": "tythesly",
  40. ".updated": "2015-10-04",
  41. ".link": "https://greasyfork.org/en/scripts/12793-wme-validator-localization-for-new-york",
  42. //Default US checks
  43. "27.enabled": true,
  44. "90.enabled": true,
  45. "106.enabled": true,
  46. "112.enabled": false,
  47. "130.enabled": true,
  48. "130.params": {
  49. "titleEN": "Short Parking Lot",
  50. "problemEN": "Dead End Parking Lot is less that 30 meters",
  51. "solutionEN": "Does it really need to be there?",
  52. "template": "${deadEnd}:${typeRank}:${length}",
  53. "regexp": "/1:7:([0-2]?[0-9])$/"
  54. },
  55. "130.solutionLink": "W:Best_map_editing_practice#Parking_Lots",
  56. "131.enabled": true,
  57. "131.params": {
  58. "titleEN": "Not New York",
  59. "problem": "The segment is assigned to another state",
  60. "solutionEN": "Make sure you are editing in NY and change it. If you are editing outside NY you can disable this check by entering \"!131, *\" (without the quotes) in the Reported As: field of Validators search settings (magnifying glass)",
  61. "template": "${state}",
  62. "regexp": "!/^New York/"
  63. },
  64. "131.solutionLink": "W:Creating_and_editing_road_segments#Address_Properties",
  65. "132.enabled": true,
  66. "132.solutionLink": "W:Road_names/USA#Exit_ramps_and_entrance_ramps_.28on-ramps.29",
  67. "132.params": {
  68. "titleEN": "Improper Exit Naming",
  69. "problemEN": "This segment has an exit name which does not follow the USA standards for exit naming",
  70. "solutionEN": "For numbered exits use \"Exit(s) ##: Name / Other Name\". For unnumbered exits use \"to Name / Other Name\". Separate all shields and names with slashes (/) and spaces",
  71. "template": "${street}#${altStreet}",
  72. "regexp": "/( |\\b)(To|[Ee](?!xits? [\\dA-Z-]+:)[Xx][Ii][Tt][Ss]?( [Tt][Oo])?:?|to:|TO|Exits? \\d+[\\w\\-]*( \\\/ | \\- | |:[ \\w]*:))( |\\b|$|#)/"
  73. },
  74. "134.enabled": true,
  75. "134.params": {
  76. "titleEN": "Potential Incorrect BANNER Abbreviation",
  77. "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",
  78. "solutionEN": "Change abbreviation to ALT, BUS, BYP, CONN, LOOP, SCN, SPUR, or TRUCK in ALL CAPS",
  79. "template": "${street}#{altStreet[#]}",
  80. "regexp": "/!?[0-9].+(Alt|Bus(iness)?|Byp|Conn?|L(oo)?p|Scn|Spu?r|Truck)\\b/"
  81. },
  82. "136.enabled": true,
  83. "136.params": {
  84. "titleEN": "NYS Minimum Lock Levels",
  85. "problemEN": "NYC has higher locking levels than the rest of NYS. Ferries and RR should be locked as well",
  86. "solutionEN": "Lock the segment to at least; PS>=3, mH>=4, MH>=5, FW>=5, Ramp>=highest connection, Ferry>=5, RR>=2",
  87. "template": "${state}:${city}#${type}:${lock}",
  88. "regexp": "/^New York:((New York|Manhattan|Queens|Brooklyn|Bronx|Staten Island)#(6:[1-4]|7:[1-3]|2:[12])|.*#(15:[1-4]|18:1))/"
  89. },
  90. "136.solutionLink": "W:NY#Locking_standard",
  91. "137.enabled": true,
  92. "137.params": {
  93. "titleEN": "Improper Cardinal Usage",
  94. "problemEN": "This name contains a cardinal direction (NEWS) which does not match wiki guidelines",
  95. "solutionEN": "If this cardinal should be spoken as a direction by TTS, make sure it has space on either side of it. If this cardinal should be spoken by TTS as a letter, follow it with a period. All cardinals should be capitalized",
  96. "template": "${street} ${altStreet[#]}",
  97. "regexp": "/(^| )([NEWS]?[news][NEWS]?|[\"']?([NnSs][EeWw]?|[EeWw])['\":;-]|[\"']([NnSs][EeWw]?|[EeWw])['\":-]?)(\\b|\\d| |$)/"
  98. },
  99. "137.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  100. "138.enabled": true,
  101. "138.params": {
  102. "titleEN": "Incorrect Hwy Name Prefix",
  103. "problemEN": "NY follows national guidelines for hwy naming prefixes (I-##, US-##, CR-##, FS-##), and uses NY-## for state routes",
  104. "solutionEN": "Rename the Street or Alt Street",
  105. "template": "${state}:${street}#${altStreet[#]}",
  106. "regexp": "/^New York:.*\\b((([Uu]\\.? ?( S|S(?!-\\d)[- ]|S\\.|s\\.?)|[Nn](ew )?(y|Y- |[Yy]ork)? ?|[Ss]tate |[Ss] ?[RrHh]|[Cc]o(unty)? ?|[Rr]o?u?[Tt]e?|[Ff](s|S(?!-\\d)|[Rr]))([Ss][Pp][Uu][Rr]|[Rr]((ou)?(te)?|(oa)?d)|[Hh]((igh)?[Ww]a?[Yy])?)?|Ny|NY=|I- |[Cc]([HhrSs]|R(?!-\\d))|([Ii]|[NnCcUu][YyRrSs])[ =])[- ]{0,2}\\d+|([Uu] ?[Ss][- ]?)?([Hh](igh)?[Ww]a?[Yy] )?[Ff] ?([Ss] ?|[Ss]? ?[Rr])(oa)?d? )/"
  107. },
  108. "138.solutionLink": "W:NY#Major_roads",
  109. "139.enabled": true,
  110. "139.params": {
  111. "titleEN": "Bad TTS Street name",
  112. "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
  113. "solutionEN": "Add a period after St or Dr at the beginning of the street name",
  114. "template": "${street}#${altStreet[#]}",
  115. "regexp": "/((^|#|(\\/|[NEWS]|Rue|Place)\\s)(St|Dr)|(Jr|Rev)) /"
  116. },
  117. "139.solutionLink": "W:Abbreviations_and_acronyms/USA#Recommended_abbreviations",
  118. //There already is a city on freeway check, enable it
  119. // disabling for now, we allow city names on fwy in NY >> "59.enabled": true,
  120. //Freeway lock
  121. "150.enabled": true,
  122. "150.params": {
  123. // {number} minimum lock level
  124. "n": 5,
  125. },
  126. //Major Highway lock
  127. "151.enabled": true,
  128. "151.params": {
  129. // {number} minimum lock level
  130. "n": 4,
  131. },
  132. //Minor Highway lock
  133. "152.enabled": true,
  134. "152.params": {
  135. // {number} minimum lock level
  136. "n": 3,
  137. },
  138. //Ramp lock
  139. "153.enabled": true,
  140. "153.solutionLink": "W:Road_types/USA#Ramps",
  141. "153.params": {
  142. // {number} minimum lock level
  143. "n": 5,
  144. "problemEN": "Ramps generally connect to Freeways, so they should be locked to Lvl 5. If not connected to a freeway, verify that this meets the criteria to be a ramp",
  145. "solutionEN": "Lock the segment, change it to a non-ramp type, or just verify it should be a ramp",
  146. },
  147. //Primary Street lock
  148. "154.enabled": true,
  149. "154.params": {
  150. // {number} minimum lock level
  151. "n": 2,
  152. },
  153. "170.enabled": true,
  154. "170.params": {
  155. regexp: "/^(?!to [^a-z])((S|N|W|E)(E|W)? )?[a-z]/"
  156. },
  157. "171.enabled": true,
  158. "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
  159. "171.params": {
  160. "regexp": "/((?!(\\bPhila|\\bPenna|.(\\bWash|\\bCmdr|\\bProf|\\bPres)|..(Adm|\\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}\\.|(?!(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}\\.|(?!(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}\\.|(#|^)[^NEWSR]?\\.)|(\'(?![sl]\\b)|(?!\\bNat).{3}\'l|(#|^).{0,2}\'l)|(Dr|St)\\.(#|$)|,|;|\\\\|((?!\\.( |#|$|R))\\..|(?!\\.( .|#.|$|R\\.))\\..{2}|\\.R(#|$|\\.R))|[Ee]x(p|w)y|Tunl|Long Is\\b|Brg/",
  161. "problemEN": "The street name has incorrect abbreviation, or character",
  162. "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
  163. },
  164. };