From 85615cf0d934612ae9600177229263fa9b945222 Mon Sep 17 00:00:00 2001 From: mselaineleong <84435178+mselaineleong@users.noreply.github.com> Date: Wed, 8 Dec 2021 13:11:21 -0800 Subject: [PATCH] Orthograph Check - OSMOSE 5010 (#635) * Orthograph Check - OSMOSE 5010 * OSMOSE 5010 Orthograph Check Co-authored-by: Elaine Shum --- docs/checks/invalidTagsCheck.md | 2 + .../invalid-edge-tags-check-regex-filter.json | 30 ++++++++++ .../tag/invalid-tags-check-regex-filter.json | 56 ++++++++++++++++++- 3 files changed, 87 insertions(+), 1 deletion(-) diff --git a/docs/checks/invalidTagsCheck.md b/docs/checks/invalidTagsCheck.md index b3ba95dbe..6d014449b 100644 --- a/docs/checks/invalidTagsCheck.md +++ b/docs/checks/invalidTagsCheck.md @@ -74,6 +74,8 @@ This way [id:26830712] https://www.openstreetmap.org/way/26830712 contains ';' This way [id:919752321] https://www.openstreetmap.org/way/919752321 contains '+' This node [id:6357413076] https://www.openstreetmap.org/node/6357413076 contains invalid tag "neme" This way [id:264272613] https://www.openstreetmap.org/way/264272613 contains invalid tag "fixeme" +This way [id:160246542] https://www.openstreetmap.org/way/160246542 contains invalid word "Eglise" +This way [id:113778981] https://www.openstreetmap.org/way/113778981 contains all uppercase #### Code Review In [Atlas](https://github.com/osmlab/atlas), OSM elements are represented as Edges, Points, Lines, Nodes, Areas & Relations; in our case, we’re are looking at diff --git a/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-edge-tags-check-regex-filter.json b/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-edge-tags-check-regex-filter.json index 329b706e3..a10a56b81 100644 --- a/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-edge-tags-check-regex-filter.json +++ b/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-edge-tags-check-regex-filter.json @@ -24,6 +24,36 @@ "regex": ["\\+"], "tagNames": ["name"], "exceptions": [] + }, + { + "instruction": "The edge tag: {0} contains encoding problem `, please verify if single quote \u0027 should be used instead of `.", + "regex": ["`"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The edge tag: {0} contains 2 or more consecutive words with all caps.", + "regex": ["[A-Z]{3}\\s[A-Z]"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The edge tag: {0} contains all caps in one word.", + "regex": ["[A-Z]{6}"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The edge tag: {0} contains initials stuck to the name, consider adding space after the initial.", + "regex": ["[A-Z]{1}[.][A-Z]{2}"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The edge tag: {0} contains too many spaces.", + "regex": ["\\s{3}"], + "tagNames": ["name"], + "exceptions": [] } ] } diff --git a/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-tags-check-regex-filter.json b/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-tags-check-regex-filter.json index 2d61abde4..ef81927bd 100644 --- a/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-tags-check-regex-filter.json +++ b/src/main/resources/org/openstreetmap/atlas/checks/validation/tag/invalid-tags-check-regex-filter.json @@ -318,6 +318,60 @@ "with" ], "exceptions": [] - } + }, + { + "instruction": "The tag: {0} contains badly written word etang, please verify if accent and capital first letter \u00C9tang should be used instead.", + "regex": ["(?i)etang "], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains badly written word ecole, please verify if accent and capital first letter should be \u00C9cole used instead.", + "regex": ["(?i)ecole"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains badly written word eglise, please verify if accent and capital first letter \u00C9glise should be used instead.", + "regex": ["(?i)eglise"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains cimetiere word not found in dictionary, please verify if accent and capital first letter cimeti\\u00E8re should be used instead.", + "regex": ["(?i)cimetiere"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains encoding problem `, please verify if single quote \u0027 should be used instead of `.", + "regex": ["`"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains 2 or more consecutive words with all caps.", + "regex": ["[A-Z]{3}\\s[A-Z]"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains all caps in one word.", + "regex": ["[A-Z]{6}"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains initials stuck to the name, consider adding space after the initial.", + "regex": ["[A-Z]{1}[.][A-Z]{2}"], + "tagNames": ["name"], + "exceptions": [] + }, + { + "instruction": "The tag: {0} contains too many spaces.", + "regex": ["\\s{3}"], + "tagNames": ["name"], + "exceptions": [] + } ] }