Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing :alpha: and :alnum: to char properties #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_all_hashtags(self,
WHERE rc.rc_type = 0
AND rc.htrc_lang LIKE ?
AND ht.ht_text NOT IN(%s)
AND ht.ht_text REGEXP '[[:alpha:]]+'
AND ht.ht_text REGEXP '[\p{L}]+'
AND CHAR_LENGTH(ht.ht_text) > 1
AND rc.rc_timestamp BETWEEN ? AND ?
ORDER BY rc.rc_id DESC
Expand Down Expand Up @@ -142,7 +142,7 @@ def get_top_hashtags(self, limit=10, recent_count=100000, nobots=True):
FROM recentchanges) - ?
JOIN hashtags AS ht
ON ht.ht_id = htrc.ht_id
WHERE ht.ht_text REGEXP '[[:alpha:]]{1}[[:alnum:]]+'
WHERE ht.ht_text REGEXP '[\p{L}]+{1}[\p{L}\p{N}]+'
AND ht.ht_text NOT IN (%s)
%s
GROUP BY ht.ht_text
Expand Down Expand Up @@ -224,7 +224,7 @@ def get_all_hashtag_stats(self, lang=None, startdate=None, enddate=None):
AND rc.htrc_lang LIKE ?
AND rc.rc_timestamp BETWEEN ? AND ?
AND ht.ht_text NOT IN(%s)
AND ht.ht_text REGEXP '[[:alpha:]]+' ''' % ', '.join(['?' for i in range(len(EXCLUDED))])
AND ht.ht_text REGEXP '[\p{L}]+' ''' % ', '.join(['?' for i in range(len(EXCLUDED))])
with tlog.critical('get_all_hashtag_stats') as rec:
ret = self.execute(query, (lang, startdate, enddate,) + EXCLUDED)
rec.success('Fetched all hashtag stats')
Expand Down