Urgent.News

What's breaking now, across thousands of outlets.

Tech

Validate Title Query Terms With English Inflections

A literal query-token check in an automated title validator will often reject a grammatically correct title variant just because its ending differs from the target query. When engineering pipelines validate whether a title leads with a search topic, strict exact-match logic creates false rejections for normal morphological changes during content production. Quick solution: def validate_query_lead…

An automated title validator may reject grammatically correct title variations due to strict exact-match logic that objects to different ending inflections. To improve this, engineers can create a function that validates the first word of a title against a query term, allowing for direct matches or the gerund form by adjusting the query term.

Specifically, if the query ends in "e," the function removes that letter and adds "ing" to compare with the title's first token. If the title is empty, the validator returns false. Otherwise, it checks if the first token matches the query term directly or the adjusted gerund form. This function safeguards against low-quality titles slipping through by maintaining strict rules while permitting natural grammatical variations.

The issue stems from automated checks failing to recognize common morphological changes, like transforming "preserve" into "Preserving" during content creation. Even though search engines comprehend related terms, validation scripts often use rigid string comparisons that overlook these nuances. By implementing a narrow inflection rule—allowing the removal of an "e" followed by "ing" for query terms that end in "e"—developers can strike a balance between strict validation and flexible grammar.

This approach prevents false negatives when titles naturally use past tense or gerund forms. The validator must also reject inputs that share prefixes but have different meanings, like blocking "preservative" when checking for "preserve." Additionally, it must handle edge cases such as punctuation at the start of titles, ensuring that these do not trigger validation failures.

Implementing this function into an automated publishing pipeline requires attention to punctuation stripping and multi-word tokenization, as well as logging blocked inflection variants to monitor editorial patterns and adapt over time. The verification checklist ensures that the function operates correctly under various scenarios, including exact matches, gerund matches, and blocked cases, while also maintaining the pipeline's structural integrity and avoiding common pitfalls like keyword stuffing or excessive title length.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Checkout Error Tracking Evidence Across HTTP Exceptions Cron Jobs and Queue Workers

For customer support to explain a failed checkout, the least complex useful error tracking design combines a NestJS HTTP exception filter or interceptor with separate capture for cron jobs and queue…

  • Centralize exception capture for checkout, cron jobs, and queue workers
  • Retain explicit checkout identifier and evidence retention policy
  • Analyze event volume, size, retention period, and retrieval effort before backend selection

How to send an HTML form to Notion

A Notion database is a handy place for form submissions. Each one becomes a page you can open, add notes to, give a status and assign, and the whole team sees it in a board or table view.

  • Create Notion database with Name, Email, Message properties
  • Enable "Insert content" capability in Notion integration
  • Obtain database ID from Notion URL for integration

More from Saturday 21 November →