Данаил обнови решението на 07.03.2015 21:50 (преди над 9 години)
+SIGNS = (
+ 'aries',
+ 'taurus',
+ 'gemini',
+ 'cancer',
+ 'leo',
+ 'virgo',
+ 'libra',
+ 'scorpio',
+ 'sagittarius1',
+ 'capricorn',
+ 'aquarius',
+ 'pisces'
+)
+
+SIGNS_FOR_MONTS = dict([(1, [21, [SIGNS[9], SIGNS[10]]]),
+ (2, [19, [SIGNS[10], SIGNS[11]]]),
+ (3, [21, [SIGNS[11], SIGNS[0]]]),
+ (4, [21, [SIGNS[0], SIGNS[1]]]),
+ (5, [21, [SIGNS[1], SIGNS[2]]]),
+ (6, [21, [SIGNS[2], SIGNS[3]]]),
+ (7, [23, [SIGNS[3], SIGNS[4]]]),
+ (8, [23, [SIGNS[4], SIGNS[5]]]),
+ (9, [23, [SIGNS[5], SIGNS[6]]]),
+ (10, [23, [SIGNS[6], SIGNS[7]]]),
+ (11, [22, [SIGNS[7], SIGNS[8]]]),
+ (12, [22, [SIGNS[8], SIGNS[9]]])])
+
+
+def interpret_western_sign(day, month):
+ possibleSigns = SIGNS_FOR_MONTS[month][1]
+ singLastDay = SIGNS_FOR_MONTS[month][0]
+
+ if day > singLastDay:
+ res = possibleSigns[1]
+ else:
+ res = possibleSigns[0]
+ return res
+
+
+START_YEAR = 1900
+CH_SIGNS = ('rat', 'ox', 'tiger', 'rabbit',
+ 'dragon', 'snake', 'horse', 'sheep',
+ 'monkey', 'rooster', 'dog', 'pig')
+
+
+def interpret_chinese_sign(year):
+ return CH_SIGNS[(year - START_YEAR) % 12]