From 80bc4a141e1e4cf48ba623938ff55b8f910d4337 Mon Sep 17 00:00:00 2001 From: dualfroz Date: Fri, 2 Oct 2026 16:57:19 +0200 Subject: [PATCH] Tag beneath, underneath and aboard as prepositions before an object --- src/2-two/postTagger/model/connectors.js | 2 +- tests/two/tagger/grammar/connectors.test.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/2-two/postTagger/model/connectors.js b/src/2-two/postTagger/model/connectors.js index 63b1572..3decb28 100644 --- a/src/2-two/postTagger/model/connectors.js +++ b/src/2-two/postTagger/model/connectors.js @@ -38,7 +38,7 @@ export default [ // The cat slept [under] the table. He sat [beside] me. // the plane flew well [above] the clouds // she stood directly [below] the window... - ...['above', 'below', 'under', 'over', 'beside', 'behind', 'against', 'outside', 'inside', 'near'].map(word => ({ + ...['above', 'below', 'under', 'over', 'beside', 'behind', 'against', 'outside', 'inside', 'near', 'beneath', 'underneath', 'aboard'].map(word => ({ match: `[(${word} && !#Verb)] (#Determiner|#Possessive|#Pronoun|#ProperNoun)`, group: 0, tag: 'Preposition', reason: `${word}-space-obj`, })), diff --git a/tests/two/tagger/grammar/connectors.test.js b/tests/two/tagger/grammar/connectors.test.js index 479c7df..129821c 100644 --- a/tests/two/tagger/grammar/connectors.test.js +++ b/tests/two/tagger/grammar/connectors.test.js @@ -31,6 +31,9 @@ test('connectors distinguish nominal objects from finite clauses', t => { ['They stood behind us.', 'behind', 'Preposition'], ['He leaned against the wall.', 'against', 'Preposition'], ['He sat near the door.', 'near', 'Preposition'], + ['The dog slept beneath the bench.', 'beneath', 'Preposition'], + ['The keys were underneath the mat.', 'underneath', 'Preposition'], + ['We went aboard the ship.', 'aboard', 'Preposition'], ] for (const [str, word, tag] of cases) { const term = nlp(str).match(word)