WME Validator Localization for Ireland

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

当前为 2015-12-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name WME Validator Localization for Ireland
  3. // @version 1.1.14.25
  4. // @author lsin023
  5. // @description This script localizes WME Validator for Ireland. You also need main package (WME Validator) installed.
  6. // @match https://editor-beta.waze.com/*editor/*
  7. // @match https://www.waze.com/*editor/*
  8. // @grant none
  9. // @run-at document-start
  10. // @namespace https://greasyfork.org/users/15899
  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_Ireland = {
  38. ".country": "Ireland",
  39. ".codeISO": "IE",
  40. ".author": "lsin023",
  41. ".updated": "2015-12-03",
  42. ".link": "TODO: ",
  43. "27.enabled": true, // City name on Railroad
  44. "70.enabled": true,
  45. "70.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  46. "71.enabled": true,
  47. "71.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  48. "72.enabled": true,
  49. "72.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  50. "130.enabled": true,
  51. "130.params": {
  52. "titleEN": "Incorrectly named street",
  53. "problemEN": "The street name should be abbreviated.",
  54. "solutionEN": "Rename the street in accordance with the abbreviation table",
  55. "template": "${street}",
  56. "regexp": "/(?!The).{3}\\s(?:Avenue|Close|Court|Crescent|Drive|Lane|Park|Place|Road|Square|Street|Terrace)(?:\\s+(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension))?$/",
  57. },
  58. "130.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations",
  59. "131.enabled": true,
  60. "131.params": {
  61. "titleEN": "Incorrect abbreviation using . (dot)",
  62. "problemEN": "Abbreviations should not end in dot, except for St. (Saint)",
  63. "solutionEN": "Remove the dot from the end of the abbreviation",
  64. "template": "${street}",
  65. "regexp": "/(?:(?!St).{2})\\./",
  66. },
  67. "131.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations",
  68. "132.enabled": true,
  69. "132.params": {
  70. "titleEN": "Incorrectly named street (Cardinals)",
  71. "problemEN": "Cardinals North/East/South/West should be abbreviated in suffixes. Prefixes should not.",
  72. "solutionEN": "Rename the street in accordance with the guidelines",
  73. "template": "${street}",
  74. "regexp": "/^[NESW]\\s|\\s(?:North|East|South|West)$/",
  75. },
  76. "132.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations",
  77. "133.enabled": true,
  78. "133.params": {
  79. "titleEN": "Incorrectly abbreviated street name",
  80. "problemEN": "Abbreviations are not used as suffix.",
  81. "solutionEN": "Rename the street and abbreviate only suffixes",
  82. "template": "${street}",
  83. "regexp": "/(?:^|\\s)(?:Ave|Cl|Ct|Cres|Dr|Ln|Pk|Pl|Rd|Sq|St|Tce)(?!(?:$|\\S|\\s(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension)$))/",
  84. },
  85. "133.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations",
  86. "160.enabled": true,
  87. "160.params": {
  88. "solutionEN": "Rename the street to 'Mxx' or 'Mxx N/S/W/E' or change the road type",
  89. "regexp": "!/^M[0-9]+(?:\\s[NSWE](?:\\s.*Tunnel)?)?$/"
  90. },
  91. "160.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  92. "161.enabled": true,
  93. "161.params": {
  94. "solutionEN": "Rename the street to 'Nxx' or 'Nxx Local Name' or change the road type",
  95. "regexp": "!/^N[0-9]+( .*)?$/"
  96. },
  97. "161.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  98. "162.enabled": true,
  99. "162.params": {
  100. "solutionEN": "Rename the street to 'Rxxx' or 'Rxxx Local Name' or change the road type",
  101. "regexp": "!/^R[0-9]+( .*)?$/"
  102. },
  103. "162.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Road_Types",
  104. "169.enabled": true,
  105. "169.params": {
  106. "solutionEN": "Rename the segment in accordance with the guidelines",
  107. "regexp": "!/^[a-záéíóúA-ZÁÉÍÓÚ0-9\\. '(/)-]+$/"
  108. },
  109. "169.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations",
  110. "170.enabled": true,
  111. "170.params": {
  112. "regexp": "/(?:^|\\s)(?!(?:to|of|na|and?|(?:b[HP]|dT|gC|h[AÁEÉIÍOÓUÚ]|mB|t[AÁS])\\S*)\\s)(?:[a-záéíóú]\\S*)(?:$|\\s)/"
  113. },
  114. "171.enabled": true,
  115. "171.params": {
  116. "regexp": "/(?:^|\\s)(?:Aly|Arc|Bch|Bdwy|Bnd|Btm|Blvd|Brg?|Bdge?|Brks?|Bgs?|Byp|Cswy|Ctrs?|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|Local|Ldg|Lower|Lr|Lwn?|Mls?|Mnrs?|Mdws?|Msn|Mt|N\/A|Orch|Ps?ge|Pde|Pnes?|Plns?|Pl[sz]|Please|Prts?|Private|Qy|Rdge?s?|Rename|Spgs?|Saint|St(?!(?:\\.|$|\\s(?:Lwr|Upr|[NSWE]|Great|Little|Middle|Extension)$))|St[an]|Str|Stret|Ter|Terace|Trce|Tunl|Unknown|Uppe?r?|Ur|Val|Vlys?|Vdct|Vw|Vlgs?|Wl?k|Wls?|Works?|Xing|Xrd|Nth|Est|Sth|Wst)(?:$|\\s)/i"
  117. },
  118. "171.problemLink": "W:How_to_label_and_name_roads_(Ireland)#Abbreviations"
  119. };