
class CountWords:
    # Python program to count the number of occurrence
    # of a word in the given string given string

    def countOccurences(str_, word):
        str_=str_.lower()
        word=word.lower()
        # split the string by spaces in a
        a = str_.split(" ")
        # search for pattern in a
        count = 0
        for i in range(0, len(a)):
            # if match found increase count
            if (word == a[i]):
                count = count + 1
        return count
"""
str = "A computer science     portaL portal geeks  "
word = "portal"
print(CountWords.countOccurences(str, word))
"""
d59abf6996dd4aba52b92bd4096a5f88ebfffcb2
<mask token>

class CountWords:
    <mask token>


<mask token>

class CountWords:

    def countOccurences(str_, word):
        str_ = str_.lower()
        word = word.lower()
        a = str_.split(' ')
        count = 0
        for i in range(0, len(a)):
            if word == a[i]:
                count = count + 1
        return count


<mask token>


class CountWords:
    # Python program to count the number of occurrence
    # of a word in the given string given string

    def countOccurences(str_, word):
        str_=str_.lower()
        word=word.lower()
        # split the string by spaces in a
        a = str_.split(" ")
        # search for pattern in a
        count = 0
        for i in range(0, len(a)):
            # if match found increase count
            if (word == a[i]):
                count = count + 1
        return count
"""
str = "A computer science     portaL portal geeks  "
word = "portal"
print(CountWords.countOccurences(str, word))
"""