`L i dZddlmZmZddlZGddeZGddeZGd d ejjjeZ d Z d Z Gd deZ GddeZy)zAbstract base classes for models (taggers, noun phrase extractors, etc.) which define the interface for descendant classes. .. versionchanged:: 0.7.0 All base classes are defined in the same module, ``textblob.base``. )ABCMetaabstractmethodNc"eZdZdZeddZy) BaseTaggerzzAbstract tagger class from which all taggers inherit from. All descendants must implement a ``tag()`` method. cy)znReturn a list of tuples of the form (word, tag) for a given set of text or BaseBlob instance. N)selftexttokenizes S/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/textblob/base.pytagzBaseTagger.tags N)T)__name__ __module__ __qualname____doc__rr rrr rrs rr) metaclassc eZdZdZedZy)BaseNPExtractorzAbstract base class from which all NPExtractor classes inherit. Descendant classes must implement an ``extract(text)`` method that returns a list of noun phrases as strings. cy)z;Return a list of noun phrases (strings) for a body of text.Nrr r s r extractzBaseNPExtractor.extract& rN)rrrrrrrrr rr s rrc&eZdZdZedZdZy) BaseTokenizerzAbstract base class from which all Tokenizer classes inherit. Descendant classes must implement a ``tokenize(text)`` method that returns a list of noun phrases as strings. cy)zTReturn a list of tokens (strings) for a body of text. :rtype: list Nrrs r r zBaseTokenizer.tokenize5s rc<d|j|g|i|DS)zzReturn a generator that generates tokens "on-demand". .. versionadded:: 0.6.0 :rtype: generator c3 K|]}|yw)Nr).0ts r z*BaseTokenizer.itokenize..Ds@a@s )r )r r argskwargss r itokenizezBaseTokenizer.itokenize=s%A=4==???@@rN)rrrrrr r$rrr rr/s! Arrdscoc0eZdZdZeZdZdZedZ y)BaseSentimentAnalyzerzAbstract base class from which all sentiment analyzers inherit. Should implement an ``analyze(text)`` method which returns either the results of analysis. cd|_y)NF_trainedr s r __init__zBaseSentimentAnalyzer.__init__Vs  rcd|_y)NTr*r,s r trainzBaseSentimentAnalyzer.trainYs  rc<|js|jy)zjReturn the result of of analysis. Typically returns either a tuple, float, or dictionary. N)r+r/rs r analyzezBaseSentimentAnalyzer.analyze]s }} JJLrN) rrrrDISCRETEkindr-r/rr1rrr r(r(Ns, Drr(c eZdZdZedZy) BaseParserzxAbstract parser class from which all parsers inherit from. All descendants must implement a ``parse()`` method. cy)zParses the text.Nrrs r parsezBaseParser.parseqrrN)rrrrrr7rrr r5r5lsrr5)rabcrrnltkrrr api TokenizerIrr2 CONTINUOUSr(r5rrr r=sn( 7 "  ADMM%%00GA6   g<7r