(text)
| 152 | |
| 153 | |
| 154 | def 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 | |
| 167 | def p_tickers(row): |
| 168 | return process_tickers(row.body) |
no test coverage detected