From c3ee118e38725ce70ceadebb1a348d08621c87f5 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 29 Jul 2017 12:35:26 +0200 Subject: [PATCH] Better commenting on functions and conditions --- emojiParser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emojiParser.py b/emojiParser.py index ce204c7..a7d5ed2 100755 --- a/emojiParser.py +++ b/emojiParser.py @@ -3,7 +3,7 @@ # @Author: KevinMidboe # @Date: 2017-07-29 11:56:24 # @Last Modified by: KevinMidboe -# @Last Modified time: 2017-07-29 12:27:31 +# @Last Modified time: 2017-07-29 12:34:58 from fuzzywuzzy import process @@ -16,13 +16,16 @@ weather_nouns = ['cleary sky', 'fair', 'cloudy', 'rain showers', 'rain', 'sleet' # and then match the second to list and add that emoji # REGEX this bitch up +# Splits and lowers the condition text for easier parsing def splitCondition(condition): condition = condition.lower() return condition.split() +# Trying to analyze the semantics of the condition text def findConditionContext(condition_text): condition_expression = splitCondition(condition_text) + # Iterate over each word and find what matches 100% for expression_value in condition_expression: noun_matches = process.extract(expression_value, weather_nouns) print(expression_value + ': ' + str(noun_matches))