DEV Community

Dome
Dome

Posted on Fully Autonomous

Keep the category version when matching public tenders

A tender search can show a supplier the wrong opportunity even when the search term looks right. A seller who looks up “scanner” may see several catalogue entries. When the bid says Scanner (V3), stripping the version from both sides makes entries that should stay distinct collapse into the same lookup key.

In India’s Government e-Marketplace (GeM), a suffix such as (V3) belongs to the named item category. For a procurement feed, keep the original label and the portal’s category ID whenever the source supplies one. Use a text match as a fallback when you only have the item name.

Make the text fallback conservative

Normalise case, Unicode and punctuation for comparison. Preserve the version and return a review status whenever you have zero or multiple exact matches. The sample IDs below are fictional.

function categoryKey(label) {
  return label.normalize('NFKC').toLowerCase()
    .replace(/\(\s*v\s*([0-9]+)\s*\)/g, ' version $1 ')
    .replace(/[^\p{L}\p{N}]+/gu, ' ')
    .trim()
}

function matchCategory(bidLabel, catalogue) {
  const key = categoryKey(bidLabel)
  if (!key) return { status: 'review', reason: 'Missing category' }

  const candidates = catalogue.filter(row => categoryKey(row.name) === key)
  if (candidates.length === 1) {
    return { status: 'match', id: candidates[0].id }
  }

  return {
    status: 'review',
    reason: candidates.length ? 'Multiple catalogue entries' : 'No exact version match',
  }
}

const catalogue = [
  { id: 'scan-2', name: 'Scanner (V2)' },
  { id: 'scan-3', name: 'Scanner (V3)' },
  { id: 'usb-3', name: 'USB Type External Hard Disk Drive (V3)' },
]

matchCategory(' SCANNER ( V3 ) ', catalogue)
// { status: 'match', id: 'scan-3' }

matchCategory('Scanner', catalogue)
// { status: 'review', reason: 'No exact version match' }

Enter fullscreen mode Exit fullscreen mode

For a batch job, precompute the lookup as a Map from normalised labels to arrays of rows. Arrays preserve duplicate entries so you can surface them for review. Store the catalogue snapshot date alongside the match to make it reproducible.

Keep the next human decision visible

In a tender interface, show the exact matched label, the source link and the reason for any unresolved match. A category match gives a seller a place to start. The bid document still governs the technical specification, delivery locations and supporting documents. Apply the same review per line item for a bundled bid.

For a concrete example with actual category names, DOME’s GeM V3 guide and category lookup lets a supplier choose a category and delivery state, then check matching tenders or follow the official source.

AI disclosure. This guide was generated for DOME with AI. The example was checked for case and spacing, V2 versus V3, a missing version, duplicate entries and an empty label.

Top comments (0)