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

Update helpFuncs.py #21

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
4 changes: 3 additions & 1 deletion metaknowledge/WOS/tagProcessing/helpFuncs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2015
monthDict = {'SPR': 3, 'SUM': 6, 'FAL': 9, 'WIN': 12, 'JAN' : 1, 'FEB' : 2, 'MAR' : 3, 'APR' : 4, 'MAY' : 5, 'JUN' : 6 , 'JUL' : 7, 'AUG' : 8, 'SEP' : 9, 'OCT' : 10, 'NOV' : 11, 'DEC' : 12}

Expand All @@ -12,7 +14,7 @@ def getMonth(s):
Month Year ("%b %Y")
Year Month Day ("%Y %m %d")
"""
monthOrSeason = s.split('-')[0].upper()
monthOrSeason = [x for x in re.split(r'[ |.|-]',s)][1][:3].upper()
if monthOrSeason in monthDict:
return monthDict[monthOrSeason]
else:
Expand Down