def get_count(self, ngram, corpus=None):
if not corpus:<EOL><INDENT>corpus = self.ngcorpus<EOL><DEDENT>if not ngram:<EOL><INDENT>return corpus[None]<EOL><DEDENT>if isinstance(ngram, (text_type, str)):<EOL><INDENT>ngram = text_type(ngram).split()<EOL><DEDENT>if ngram[<NUM_LIT:0>] in corpus:<EOL><INDENT>return self.get_count(ngram[<NUM_LIT:1>:], corpus[ngram[<NUM_LIT:0>]])<EOL><DEDENT>return <NUM_LIT:0><EOL>
r"""Get the count of an n-gram in the corpus.

        Parameters
        ----------
        ngram : str
            The n-gram to retrieve the count of from the n-gram corpus
        corpus : Corpus
            The corpus

        Returns
        -------
        int
            The n-gram count

        Examples
        --------
        >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n'
        >>> tqbf += 'And then it slept.\n And the dog ran off.'
        >>> ngcorp = NGramCorpus(Corpus(tqbf))
        >>> NGramCorpus(Corpus(tqbf)).get_count('the')
        2
        >>> NGramCorpus(Corpus(tqbf)).get_count('fox')
        1