Skip to content

Commit

Permalink
Support exchange bj for Stock and China time utils
Browse files Browse the repository at this point in the history
  • Loading branch information
foolcage committed Oct 27, 2023
1 parent 981ba2a commit 56b744c
Show file tree
Hide file tree
Showing 12 changed files with 779 additions and 14 deletions.
4 changes: 2 additions & 2 deletions examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def count_hot_words(text: str):
for topic in hot_words_config:
topic_count = 0
for word in hot_words_config[topic]:
word_stats[word] = text.count(word)
word_stats[word] = text.lower().count(word)
topic_count = topic_count + word_stats[word]
topic_stats[topic] = topic_count
return topic_stats, word_stats
Expand Down Expand Up @@ -104,7 +104,7 @@ def group_stocks_by_topic(
word_count.setdefault(words, 0)
count = 0
for word in words.split(","):
count = text.count(word) + count
count = text.lower().count(word) + count
if count >= threshold:
word_count[words] = word_count[words] + 1
topic_count[topic] = topic_count[topic] + 1
Expand Down
1 change: 1 addition & 0 deletions examples/zhdate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
Loading

0 comments on commit 56b744c

Please # to comment.