




import string
from math import logaa

def  UpperCAmelCase_							(				__UpperCAmelCase						:     str      ,      __UpperCAmelCase						:     str							) ->			int:
      SCREAMING_SNAKE_CASE_     						=      document.translate(
          str.maketrans(''      ,      ''      ,      string.punctuation							)							).replace('\n'      ,      ''							)
      SCREAMING_SNAKE_CASE_     						=      document_without_punctuation.split(' '							)  # word tokenization
      return len([word for word in tokenize_document if word.lower() == term.lower()]							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     str      ,      __UpperCAmelCase						:     str							) ->			tuple[int, int]:
      SCREAMING_SNAKE_CASE_     						=      corpus.lower().translate(
          str.maketrans(''      ,      ''      ,      string.punctuation							)							)  # strip all punctuation and replace it with ''
      SCREAMING_SNAKE_CASE_     						=      corpus_without_punctuation.split('\n'							)
      SCREAMING_SNAKE_CASE_     						=      term.lower()
      return (len([doc for doc in docs if term in doc]							), len(__UpperCAmelCase							))

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     Optional[Any]=False							) ->			float:
      if smoothing:
            if n == 0:
                  raise ValueError('log10(0) is undefined.'							)
            return round(1 + logaa(n / (1 + df)							)      ,      3							)

      if df == 0:
            raise ZeroDivisionError('df must be > 0'							)
      elif n == 0:
            raise ValueError('log10(0) is undefined.'							)
      return round(logaa(n / df							)      ,      3							)





def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     int							) ->			float:
      return round(tf * idf      ,      3							)





def  UpperCAmelCase_							(				__UpperCAmelCase						:     str							) ->			list:
      return [
          txt[:a] + txt[a].upper() + txt[a + 1 :]
          for a in range(len(__UpperCAmelCase							)							)
          if txt[a].isalpha()
      ]


if __name__ == "__main__":
   __import__('doctest').testmod()