Explorar o código

Add count_with_capital_letter in statistics()

Sergienko Anton %!s(int64=7) %!d(string=hai) anos
pai
achega
9ddd46985e
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      src/program_efremova.py

+ 5 - 0
src/program_efremova.py

@@ -124,6 +124,7 @@ def statistics():
     count_plural_need_check = 0
     count_plural_check_include = 0
     count_plural_check_exclude = 0
+    count_with_capital_letter = 0
 
     for word, entry in dictionary.items():
         count += 1
@@ -145,6 +146,8 @@ def statistics():
                 count_plural_check_include += 1
             if entry['answerNeedToIncludePlural'] == 'exclude':
                 count_plural_check_exclude += 1
+        if word != word.lower():
+            count_with_capital_letter += 1
 
     print('Всего существительных по Ефремовой: {}'.format(count))
     print('Подозрительные (возможно не сущ.):')
@@ -160,6 +163,8 @@ def statistics():
     print('\tпроверено: {}'.format(count_plural_check - count_plural_need_check))
     print('\tвключаем: {}'.format(count_plural_check_include))
     print('\tисключаем: {}'.format(count_plural_check_exclude))
+    print('Слова с большой буквы по Ефремовой:')
+    print('\tвсего: {}'.format(count_with_capital_letter))
 
 
 @function_execution_time