def get(self, term):
        # type: (Any) -> Type[ChomskyTermNonterminal]
        """
        Get nonterminal rewritable to term.
        If the rules is not in the grammar, nonterminal and rule rewritable to terminal are add into grammar.
        :param term: Term for which get the nonterminal.
        :return: ChomskyTermNonterminal class for terminal.
        """
        if self._items[term].used is False:
            cont = self._items[term]
            self._grammar.nonterminals.add(cont.nonterminal)
            self._grammar.rules.add(cont.rule)
            cont.used = True
        return self._items[term].nonterminal