WME Validator Missouri Localization

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

目前為 2016-11-03 提交的版本,檢視 最新版本

// ==UserScript==
// @name         WME Validator Missouri Localization
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  This script localizes WME Validator for United States. You also need main package (WME Validator) installed.
// @match        https://editor-beta.waze.com/*editor/
// @author       FastestBeef
// @match        https://www.waze.com/*editor/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

/*
  See Settings->About->Available checks for complete list of checks and their params.

  Examples:

  Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
    "170.enabled": true,
    "170.params": {
        "regexp": "/^((exit|to) )?[a-z]/",
    "},

  Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
    "130.enabled": true,
    "130.params": {
        "titleEN": "Street name with a dot",
        "problemEN": "There is a dot in the street name (excluding Ramps)",
        "solutionEN": "Expand the abbreviation or remove the dot",
        "template": "${type}:${street}",
        "regexp": "D/^[^4][0-9]?:.*\\./",
    },
    *Note: use D at the beginning of RegExp to enable debugging on JS console.
    *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
*/

window.WME_Validator_United_States = {
    ".country": "United States",
    ".codeISO": "US",
    ".author": "FastestBeef",
    ".updated": "2016-11-02",
    //".link": "https://gf.qytechs.cn/en/scripts/5973-wme-validator-north-carolina-localization",

    "27.enabled": true, // no city name on railroad

    //Freeway min lock
    "150.enabled": true,
    "150.params": {
        // {number} minimum lock level
        "n": 4,
    },
    //MH min lock
    "151.enabled": true,
    "151.params": {
        // {number} minimum lock level
        "n": 3,
    },
    //mH min lock
    "152.enabled": true,
    "152.params": {
        // {number} minimum lock level
        "n": 3,
    },
    //Ramp min lock
    "153.enabled": false,
    "153.params": {
        // {number} minimum lock level
        "n": 3,
    },
    // Primary Street min lock
    "154.enabled": true,
    "154.params": {
        // {number} minimum lock level
        "n": 2,
    },
    "167.enabled": true,
    "167.solutionLink": "W:Railroad#Railroad",
    "167.params": {
        "solutionEN": "Railroad should have no name rather than 'Railroad'",
        "regexp": "/Railroad/",
    },
    // check TTS, shamlessly stolen from xanderb
    "128.enabled": true,
    "128.params": {
        "titleEN": "Bad TTS Street name",
        "problemEN": "Streets that start with St and Dr result in TTS reading Street or Drive",
        "solutionEN": "Add a period after Jr, St, Dr, or Rev where required",
        "template": "${street}#${altStreet[#]}",
        "regexp": "/((^| )(St|Dr)(?! ((Ext|[NEWS][EW]?)\\b|\/|\\())|(Jr|Rev)) /"
    },

    // custom check: State must be Missouri
    "130.enabled": true,
    "130.params": {
        // {string} expandable template
        "template": "${state}",
        // {string} regular expression to match the template
        "regexp": "!/^Missouri$/",
        // {string} check title in English
        "titleEN": "Wrong state selected",
        // {string} problem description in English
        "problemEN": "Selected state must be Missouri",
        // {string} solution instructions in English
        "solutionEN": "Set state to Missouri if within state limits",
    },
    "131.enabled": true,
    "131.solutionLink": "W:Missouri#Major_roads",
    "131.params": {
        "titleEN": "Bad Street Name",
        "problemEN": "Street Name or Alt Name has been identified as incorrect. (dfa, nul, null, no street, MO-XX, SH-###)",
        "solutionEN": "Correct the street name, MO State Highway (MO-###) (refer to MO wiki), remove names dfa, nul, null, no street.",
        "template": "${state}:${street}#${altStreet[#]}#`",
        "regexp": "/^Missouri:.*\\b(?:dfa|nul|null|no street|(SR |CR |SH-|State Hwy |Co Rd |County Rd |County Road )[0-9]+|(MO-|State Hwy )[A-Z]+)\\b/i"
    },
    /*
    //Default US checks
    "90.enabled": true,
    "104.enabled": true,
    "106.enabled": true,
    "112.enabled": false,
    "112.params": {
        "n": 55,
    },
    "163.enabled": true,
    "163.solutionLink": "W:Road_names/USA#Exit_ramps_and_entrance_ramps_.28on-ramps.29",
    "163.params": {
        "regexp": ".*\\b(Exit: |Exit to )\\b/i"
    },
    "167.enabled": true,
    "167.solutionLink": "W:Railroad#Railroad",
    "167.params": {
        "solutionEN": "Railroad should have no name rather than 'Railroad'",
        "regexp": "/Railroad/",
    },
    "170.enabled": true,
    "170.params": {
        "regexp": "/^(?!(to) [^a-z])((S|N|W|E) )?[a-z]/",
    },
    //  #171 ## Check for improper use of a period (.) that is not on the USA
    //          recommended abbreviations list (PesachZ)
    "171.enabled": true,
    "171.solutionLink": "W:Abbreviations_and_acronyms/USA#Standard_suffix_abbreviations",
    "171.params": {
        "regexp": "/((?!(\\bPhila|\\bPenna|.(\\bWash|\\bCmdr|\\bProf|\\bPres)|..(\\bAdm|\\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}|(\\bhila|\\benna))\\.|((?!(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}|\\b(ila|nna|ash|mdr|rof|res))\\.|((?!(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}|\\b(la|na|sh|dr|of|es|dm|te|pl|aj|gt|e[vc]|\\.R|ov|en|on|pl))\\.|(#|^)[^NEWSR]?\\.)|(((?!\\b(D|O|L)).|#|^)\'(?![sl]\\b)|(#|^)\'s|(?!\\b(In|Na)t).{3}\'l|(#|^).{0,2}\'l)|(Dr|St)\\.(#|$)|,|;|\\\\|((?!\\.( |#|$|R))\\..|(?!\\.( .|#.|$|R\\.))\\..{2}|\\.R(#|$|\\.R))|\\b[Ee]x[dn]\\b|Tunl\\b|Long Is\\b|Brg\\b/",
        "problemEN": "The street name has incorrect abbreviation, or character",
        "solutionEN": "Check upper/lower case, a space before/after the abbreviation and the accordance with the abbreviation table. Remove any comma (,), backslash (\\), or semicolon (;)"
    },

    //North Carolina checks
    "130.enabled": true,
    "130.solutionLink": "W:Missouri#Roads",
    "130.params": {
        "titleEN": "Bad Street Name",
        "problemEN": "Street Name or Alt Name has been identified as incorrect. (dfa, nul, null, no street, US-29 Alt, MO-####, SH-XX)",
        "solutionEN": "Correct the street name, MO State Highway (SH-XX) (refer to MO wiki), remove names dfa, nul, null, no street or US-29 ALT. US-29 ALT is not a valid highway in MO.",
        "template": "${state}:${street}#${altStreet[#]}#`",
        "regexp": "/^Missouri:.*\\b(?:dfa|nul|null|no street|US-29 Alt|(MO-|SR |CR |CR-|Co Rd |County Rd |County Road )[0-9]{4,})\\b/i"
    },
    "131.enabled": true,
    "131.params": {
        "titleEN": "Potential Incorrect Abbreviation",
        "problemEN": "Name abbreviation may be incorrect. Alternative routes should be labeled ALT and abbreviations ALT, BUS, BYP, CONN, LOOP, SCN, and SPUR should be in ALL CAPS",
        "solutionEN": "Change abbreviation to ALT, BUS, BYP, CONN, SCN, or SPUR in ALL CAPS",
        "template": "${street}#${altStreet[#]}#`",
        "regexp": "/!?[0-9].+(Alt|Business|Bus|Byp|Conn|Scn|Spur)\\b/"
    },
    "132.enabled": true,
    "132.solutionLink": "W:Missouri#Roads",
    "132.params": {
        "titleEN": "Wrong name on US Highway",
        "problemEN": "All US highways should be named US-XXX",
        "solutionEN": "Change name to US-XX and verify with GIS the highway name is correct.",
        "template": "${street}#${altStreet[#]}#`",
        "regexp": ".*\\b(?:US Highway |US Hwy Route |US Hwy Rte |US Hwy |US Rte |US- |US )[0-9]{1,3}\\b/i"
    },
    "133.enabled": true,
    "133.solutionLink": "W:Missouri#Roads",
    "133.params": {
        "titleEN": "Wrong name on state highway",
        "problemEN": "All state highways should be named MO-XXX in Missouri",
        "solutionEN": "Change name to MO-XXX and verify with GIS the highway name is correct.",
        "template": "${state}:#${street}#${altStreet[#]}",
        "regexp": "/^Missouri:.*\\b(?:State Highway |State Hwy |State Rd |State Rte |SR-|MO |MO- |MO Hwy |MO-Hwy |M O |M.O. |SH-)[0-9]{1,3}\\b/i"
    },
    "134.enabled": true,
    "134.solutionLink": "W:Road_types/USA#Major_Highway",
    "134.params": {
        "titleEN": "Wrong road type (Major)",
        "problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
        "solutionEN": "Change the road type to Major Highway",
        "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
        "regexp": "/^[1-9](?![245]).*#(?:US Hwy |US-)[0-9]+(?: ALT| BYP| CONN| TRUCK| SCN| Scenic| [NSWE])*@/i"
    },
    "135.enabled": true,
    "135.solutionLink": "W:Road_types/USA#Minor_Highway",
    "135.params": {
        "titleEN": "Wrong road type (Minor)",
        "problemEN": "All US BUS, SPUR, LOOP Highways and all State Highways (except BUS, SPUR, LOOP) should be at least Minor Highway type",
        "solutionEN": "Change the road type to Minor Highway",
        "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
        "regexp": "/^[1-9](?![2-5]).*#(?:((?:State Hwy |SH-|K-|LA-|M-|MA-|MS-|NC-|SC-)[0-9]{1,3})+(?:| ALT| BYP| CONN| TRUCK| SCN| Scenic| [NSWE])*|(?:US Hwy |US-)[0-9]+(?: BUS| LOOP| SPUR)+(?: [NSWE])?)@/i"
    },
    "136.enabled": true,
    "136.solutionLink": "W:Road_types/USA#Primary_Street",
    "136.params": {
        "titleEN": "Wrong road type (Primary)",
        "problemEN": "All State BUS, SPUR, LOOP Highways should be at least Primary Street type",
        "solutionEN": "Change the road type to Primary Street",
        "template": "${typeRank}:#${street}@#${altStreet[@#]}@",
        "regexp": "/^[1-9](?![1-5]).*#(?:State Hwy |SH-|K-|LA-|M-|MA-|MS-|NC-|SC-)[0-9]+(?: BUS| LOOP| SPUR)+(?: [NSWE])?@/i"
    },
    */
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址