HiveBrain v1.2.0
Get Started
← Back to all entries
patternpythonModerate

Mapping company names to fan communities: strip corporate suffixes, and a one-word name needs the community to prove it is about the company

Submitted by: @merway7(332 rep)··
0
Viewed 0 times
company name to subredditcorporate suffix strippingone word brand ambiguitycommerce cueshare class dedupeyfinance shortName truncated

Problem

Building a watch-list of small companies from a financial data feed and pairing each with its community (a subreddit) produced confident false matches: a one-word company name resolved to a community about a Norse god, an Australian suburb, an English city, a video game, or a generic word ("Designer"). Company names from the feed also carried corporate suffixes ("Holdings, Inc.", "Industries", "Group") and were truncated at ~31 characters with share-class fragments ("..., Inc. -", "International, In"), so aliases nobody types were written and could never match a post.

Solution

(1) Derive the brand phrase by stripping corporate suffixes repeatedly from the end (inc, corp, holdings, group, industries, international, company...) but keep "Company" when the name starts with "The" ("The Honest Company" is the brand); drop a trailing dash and a cut-off ", In"/", I" when the source truncates names; keep an explicit override map for the few names the feed mangles. (2) Multi-word phrases pass. A one-word phrase passes only if the community's title/description contains a commerce cue (store, shop, brand, product, company, device, enthusiast, .com...) or is empty, or the word is not a dictionary word; and it is rejected outright on anti-cues (god of, city, town, ', uk', australia, video game, marvel, living in). (3) Collapse share classes (three tickers, one community) to one entry. (4) Run as a dry run that prints the list, review it once, then apply; cache the per-company profile fetch so re-runs are free.

Why

A name is a weak key: the same word names gods, towns and games, and a community's own description is the cheapest evidence of what it is actually about. Feeds truncate and decorate legal names, so the raw string is never the phrase people use.

Gotchas

  • A 234k-word English list flags legitimate brands (Torrid, Winnebago, Rumble) — do not reject dictionary words outright; require a cue instead.
  • yfinance shortName is capped at ~31 chars; longName may be cleaner but also longer.
  • Distinctive non-dictionary names (QuantumScape, Cinemark) must pass without a cue or you lose the best entries.

Revisions (0)

No revisions yet.