mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-14 15:22:21 +00:00
docs(shipwrecks): say the personal-text filter is a keyword filter, not a guarantee that no name is shown
DATA_SOURCES and CURRENT-STATE said text naming people is dropped. The filter drops text with a title or role word (Mr, captain, owner, crew, reported by); a bare name with none of them still passes. The docs and the code comment now say so.
This commit is contained in:
1 parent
dd731a5da9
commit
6c4c5dd041
3 files changed
+10
-6
No files matched your search
@@ -45,7 +45,9 @@ const MAX_NOTE = 260;
|
||||
const SAME_WRECK_KM = 3;
|
||||
|
||||
// Free text sometimes names people (owners, masters, divers who reported a
|
||||
// wreck). The layer shows ships, never people, so such text is dropped whole.
|
||||
// wreck). The layer is about ships, so text that refers to a person by a title
|
||||
// or role is dropped whole. This is a keyword filter: a bare name with none of
|
||||
// these words still passes.
|
||||
const PERSON_TEXT =
|
||||
/\b(mr|mrs|ms|dr|capt|captain|master|skipper|owner|owned|crew|body|bodies|drowned|reported by|according to)\b/i;
|
||||
|
||||
@@ -60,7 +62,7 @@ function clean(value, max = MAX_TEXT) {
|
||||
return text.length > max ? `${text.slice(0, max - 1).trimEnd()}…` : text;
|
||||
}
|
||||
|
||||
/** Free text with no personal names in it, or null. */
|
||||
/** Free text with none of the person keywords in it, or null. */
|
||||
function impersonalText(value, max) {
|
||||
const text = clean(value, max);
|
||||
return text && !PERSON_TEXT.test(text) ? text : null;
|
||||
|
||||
Reference in new issue
Block a user