Skip to content

Instantly share code, notes, and snippets.

@AlexDel
Last active May 7, 2018 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDel/058965ecb31972acb60714c4aa960d6f to your computer and use it in GitHub Desktop.
Save AlexDel/058965ecb31972acb60714c4aa960d6f to your computer and use it in GitHub Desktop.
file_emotion = open('excitement.txt', 'r', encoding='utf-8')
text_emotion = file_emotion.read()
words = text_emotion.split()
def CountSuperlativeAdj(text):
superlativeAdj = []
for word in text:
if word[-5:] == 'ейший' or word[-5:] == 'ейшая' or word[-5:] == 'ейшее':
superlativeAdj.append(word)
elif word[-5:] == 'айший' or word[-5:] == 'айшая' or word[-5:] == 'айшее':
superlativeAdj.append(word)
elif word == 'самый' or word == 'наиболее' or word == 'наименее':
superlativeAdj.append(word)
return 'Прилагательных в превосходной степени: {0}'.format(len(superlativeAdj))
print(CountSuperlativeAdj(words))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment