MCPcopy Create free account
hub / github.com/GonVas/tickerrain / process_tickers

Function process_tickers

process.py:154–165  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

152
153
154def process_tickers(text):
155 tickers_ment = set([word.split("$")[-1] for word in text.split() if word.startswith('$')])
156
157 text = re.sub('[^a-zA-Z0-9 \n\.]', ' ', text)
158 text = [' '.join(filter(str.isupper, word.split())) for word in text.split()]
159 tickers_ment = tickers_ment.union(set([word for word in text]))
160
161 tickers_ment = tickers_ment.intersection(set(get_ticker_list()))
162
163 list_tickers = [ticker.upper() for ticker in tickers_ment]
164
165 return list_tickers
166
167def p_tickers(row):
168 return process_tickers(row.body)

Callers 1

p_tickersFunction · 0.70

Calls 1

get_ticker_listFunction · 0.70

Tested by

no test coverage detected