Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:12:36+00:00 2026-05-28T01:12:36+00:00

I’m writing a script that takes a news article as input and returns a

  • 0

I’m writing a script that takes a news article as input and returns a list of all publicly traded companies mentioned in the article and their corresponding symbols. There are ~6,500 unique company names that could possible be mentioned.

My first thought was using a regular expression to pull out of the article all names that could possibly be company names. Company names can be pretty different, but almost always every word in the name starts with a capital letter, so I think this could work with only a few false positives (situations where an individual shares a name with a company, probably).

The next problem is comparing possible company names to the list of all companies and symbols. How should I store the list? As a table with each entry having a company and symbol field? It seems like this is the ideal place to use a hashmap of company mapping to symbol. Would it be faster than the mysql solution to serialize an array with the aforementioned mapping and just unserialize it at the beginning of my script that finds names in articles?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:12:36+00:00Added an answer on May 28, 2026 at 1:12 am

    My first thought was using a regular expression to pull out of the article all names that could possibly be company names. Company names can be pretty different, but almost always every word in the name starts with a capital letter, so I think this could work with only a few false positives (situations where an individual shares a name with a company, probably).

    There is a reason why we use prefixing like # or @ for tags or name referral, it helps create a pattern match. I think you will be shooting yourself in the foot if you allow for “false positives” on this scale.

    I would follow suit to standard ‘stock ticker’ article formats, include a company name or stock ticket format reference like American Company Co. (ACCO), this would allow you to simply look for (*) references.

    Other than sticking to a format, you will have a hard time getting quick, relevant and accurate results.

    The complex solution would be server side processing for false positives, loading the full list of names and crunching away for matches, with some alert system with review alerts, but that is just so much overhead, when a simple format adjustment can go a long way)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a small JavaScript validation script that validates inputs based on Regex. I
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have an autohotkey script which looks up a word in a bilingual dictionary
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.