WME Validator Localization for Ireland

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

  1. // ==UserScript==
  2. // @name WME Validator Localization for Ireland
  3. // @version 2020.06.17.02
  4. // @author lsin023
  5. // @description This script localizes WME Validator for Ireland. 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/15899
  10. // ==/UserScript==
  11. //
  12. /*
  13. *Note: use D at the beginning of RegExp to enable debugging on JS console.
  14. *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
  15. */
  16.  
  17. window.WME_Validator_Ireland = {
  18. ".country": "Ireland",
  19. ".codeISO": "IE",
  20. ".author": "lsin023",
  21. ".updated": "2020-06-17",
  22. ".link": "TODO: ",
  23. "27.enabled": true, // City name on Railroad
  24. "70.enabled": true, // Must be a Freeway
  25. "70.problemLink": "W:Ireland/Roads#Road_Types",
  26. "71.enabled": true, // Must be a Major Highway
  27. "71.problemLink": "W:Ireland/Roads#Road_Types",
  28. "72.enabled": true, // Must be a Minor Highway
  29. "72.problemLink": "W:Ireland/Roads#Road_Types",
  30. "130.enabled": true,
  31. "130.params": {
  32. "titleEN": "Incorrectly named street",
  33. "problemEN": "The street name should be abbreviated.",
  34. "solutionEN": "Rename the street in accordance with the abbreviation table",
  35. "template": "${street}",
  36. "regexp": "/(?!The).{3}\\s(?:Avenue|Close|Court|Crescent|Drive|Lane|Place|Road|Square|Street|Terrace)(?:\\s+(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension))?$/"
  37. },
  38. "130.problemLink": "W:Ireland/Roads#Abbreviations",
  39. "131.enabled": true,
  40. "131.params": {
  41. "titleEN": "Incorrect abbreviation using . (dot)",
  42. "problemEN": "Abbreviations should not end in dot, except for St. (Saint)",
  43. "solutionEN": "Remove the dot from the end of the abbreviation",
  44. "template": "${street}",
  45. "regexp": "/(?:(?!St).{2})\\./"
  46. },
  47. "131.problemLink": "W:Ireland/Roads#Abbreviations",
  48. "132.enabled": true,
  49. "132.params": {
  50. "titleEN": "Incorrectly named street (Cardinals)",
  51. "problemEN": "Cardinals North/East/South/West should be abbreviated in suffixes. Prefixes should not.",
  52. "solutionEN": "Rename the street in accordance with the guidelines",
  53. "template": "${street}",
  54. "regexp": "/^[NESW]\\s|\\s(?:North|East|South|West)$/"
  55. },
  56. "132.problemLink": "W:Ireland/Roads#Motorways_and_Dual_Carriageways",
  57. "133.enabled": true,
  58. "133.params": {
  59. "titleEN": "Incorrectly abbreviated street name",
  60. "problemEN": "Abbreviations are not used as suffix.",
  61. "solutionEN": "Rename the street and abbreviate only suffixes",
  62. "template": "${street}",
  63. "regexp": "/(?:^|\\s)(?:Ave|Cl|Ct|Cres|Dr|Ln|Pk|Pl|Rd|Sq|St|Tce)(?!(?:$|\\S|\\s(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension)$))/"
  64. },
  65. "133.problemLink": "W:Ireland/Roads#Abbreviations",
  66. "134.enabled": true, // ES2018: Chrome 62+ / Firefox 78+ / Edge 79+ / Opera 49+ required
  67. "134.params": {
  68. "titleEN": "Incorrectly named street",
  69. "problemEN": "Park should be abbreviated.",
  70. "solutionEN": "Rename the street in accordance with the abbreviation table",
  71. "template": "${typeRank}:${street}",
  72. "regexp": "/^(?:[689]|1[0134]):.*(?<!The|Car|Bus|Business|Retail|Industrial|Logistics|Technology|Enterprise|Office|Commercial|National|Forest)\\sPark(?:\\s+(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension))?$/"
  73. },
  74. "134.problemLink": "W:Ireland/Roads#Abbreviations",
  75. "135.enabled": true,
  76. "135.params": {
  77. "titleEN": "Incorrectly named street",
  78. "problemEN": "The street name should not contain invalid words.",
  79. "solutionEN": "Rename the street in accordance with the guidelines",
  80. "template": "${street}",
  81. "regexp": "/(?:^|\\s)(?:Local|Parking|Please|Private|Rename|Unknown|Closed)(?:$|\\s)/i"
  82. },
  83. "135.problemLink": "W:Ireland/Roads#Abbreviations",
  84. "136.enabled": true,
  85. "136.params": {
  86. "titleEN": "Named Parking Lot Road",
  87. "problemEN": "Parking lot roads should not be named.",
  88. "solutionEN": "Unname and/or convert into Parking lot place in accordance with the guidelines",
  89. "template": "${typeRank}:${street}",
  90. "regexp": "/^7:(?:.+)/"
  91. },
  92. "136.problemLink": "W:Ireland/Roads#Road_Types",
  93. "160.enabled": true,
  94. "160.params": {
  95. "solutionEN": "Rename the street to 'Mxx' or 'Mxx N/S/W/E' or change the road type",
  96. "regexp": "!/^M[0-9]+(?:\\s[NSWE](?:\\s.*Tunnel)?)?$/"
  97. },
  98. "160.problemLink": "W:Ireland/Roads#Road_Types",
  99. "161.enabled": true,
  100. "161.params": {
  101. "solutionEN": "Rename the street to 'Nxx' or 'Nxx Local Name' or change the road type",
  102. "regexp": "!/^N[0-9]+( .*)?$/"
  103. },
  104. "161.problemLink": "W:Ireland/Roads#Road_Types",
  105. "162.enabled": true,
  106. "162.params": {
  107. "solutionEN": "Rename the street to 'Rxxx' or 'Rxxx Local Name' or change the road type",
  108. "regexp": "!/^R[0-9]+( .*)?$/"
  109. },
  110. "162.problemLink": "W:Ireland/Roads#Road_Types",
  111. "169.enabled": true,
  112. "169.params": {
  113. "solutionEN": "Rename the segment in accordance with the guidelines",
  114. "regexp": "!/^[a-záéíóúA-ZÁÉÍÓÚ0-9\\., &'>(/)-]+$/"
  115. },
  116. "169.problemLink": "W:Ireland/Roads#Abbreviations",
  117. "170.enabled": true, // Irish eclipses
  118. "170.params": {
  119. "regexp": "/(?:^|\\s)(?!(?:to|of|na|and?|(?:bP|dT|gC|h[AÁEÉIÍOÓUÚ]|mB|t[AÁS])\\S*)(?:$|\\s))(?:[a-záéíóú].*)(?:$|\\s)/"
  120. },
  121. "171.enabled": true,
  122. "171.params": {
  123. "regexp": "/(?:^|\\s)(?:Aly|Arc|Bch|Bdwy|Bnd|Btm|Blvd|Brg?|Bdge?|Brks?|Bgs?|Byp|Cswy|Ct[gr]s?|Cirs?|Clfs?|Cors?|Cr[kt]?|Cvs?|Crs[et]|Dl|Ests?|Ext|Flds?|Gdns?|Gtwy|Gl?ns?|Gt|Gr[nv]?s?|Hvn|Hbrs?|Hls?|Hts|Hghts|Hse|Ind|Jctn|Lc?ks?|Lil|Ldg|Lower(?!\\s(?:Rd|St))|Lr|Lwn?|Mls?|Mnrs?|Mdws?|Msn|Mt|N\/A|Orch|Ps?ge|Pde|Pnes?|Plns?|Pl[sz]|Prts?|Private|Qy|Rdge?s?|Rs|Spgs?|Saint|St(?!(?:\\.|$|\\s(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension)$))|St[an]|Str|Stret|Ter|Terace|Trce|Tunl|Upper(?!\\s(?:Rd|St))|Ur|Val|Vlys?|Vdct|Vw|Vlgs?|Wl?k|Wls?|Works?|Xing|Xrd|Nth|Est|Sth|Wst)(?:$|\\s)/i"
  124. },
  125. "171.problemLink": "W:Ireland/Roads#Abbreviations",
  126. "258.enabled": false, // Place: Is it a Point?
  127. "271.enabled": false // Place: Parking Cost Type?
  128. };