dS(!uWrappers for various units of text, including the main :class:`TextBlob `, :class:`Word `, and :class:`WordList ` classes. Example usage: :: >>> from textblob import TextBlob >>> b = TextBlob("Simple is better than complex.") >>> b.tags [(u'Simple', u'NN'), (u'is', u'VBZ'), (u'better', u'JJR'), (u'than', u'IN'), (u'complex', u'NN')] >>> b.noun_phrases WordList([u'simple']) >>> b.words WordList([u'Simple', u'is', u'better', u'than', u'complex']) >>> b.sentiment (0.06666666666666667, 0.41904761904761906) >>> b.words[0].synsets()[0] Synset('simple.n.01') .. versionchanged:: 0.8.0 These classes are now imported from ``textblob`` rather than ``text.blob``. i(tunicode_literalstabsolute_importN(t defaultdict(tcached_propertytrequires_nltk_corpus(t lowerstriptPUNCTUATION_REGEX(t singularizet pluralize(tBlobComparableMixintStringlikeMixin(tunicodet basestring(tBaseNPExtractort BaseTaggert BaseTokenizertBaseSentimentAnalyzert BaseParser(tFastNPExtractor(t NLTKTagger(t WordTokenizert sent_tokenizet word_tokenize(tPatternAnalyzer(t PatternParser(t Translator(tsuggestcC@sP|dkrtjS|dkr&tjS|dkr9tjS|dkrLtjSdS(u.Converts a Penn corpus tag into a Wordnet tag.uNNuNNSuNNPuNNPSuJJuJJRuJJSuVBuVBDuVBGuVBNuVBPuVBZuRBuRBRuRBS(uNNuNNSuNNPuNNPS(uJJuJJRuJJS(uVBuVBDuVBGuVBNuVBPuVBZ(uRBuRBRuRBSN(t_wordnettNOUNtADJtVERBtADVtNone(ttag((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt_penn_to_wordnet1s    tWordcB@seZdZeZddZddZdZdZ dZ dZ dddZ d Z d Zd Zeed Zedd ZedZedZddZddZRS(umA simple word representation. Includes methods for inflection, translation, and WordNet integration. cC@stt|j||S(uReturn a new instance of the class. It is necessary to override this method in order to handle the extra pos_tag argument in the constructor. (tsuperR#t__new__(tclststringtpos_tag((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR%EscC@s||_||_dS(N(R'R((tselfR'R(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__init__Ls cC@s t|jS(N(treprR'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__repr__PscC@s|jS(N(R'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__str__SscC@stt|jS(u4Return the singular version of the word as a string.(R#t _singularizeR'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRVscC@stt|jS(u2Return the plural version of the word as a string.(R#t _pluralizeR'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRZsuencC@sC|dkr$|jj|j}n|jj|jd|d|S(uvTranslate the word to another language using Google's Translate API. .. versionadded:: 0.5.0 t from_langtto_langN(R t translatortdetectR't translate(R)R0tto((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR4^s cC@s|jj|jS(ubDetect the word's language using Google's Translate API. .. versionadded:: 0.5.0 (R2R3R'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytdetect_languageiscC@s t|jS(uReturn a list of (word, confidence) tuples of spelling corrections. Based on: Peter Norvig, "How to Write a Spelling Corrector" (http://norvig.com/spell-correct.html) as implemented in the pattern library. .. versionadded:: 0.6.0 (RR'(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt spellcheckps cC@st|jddS(uCorrect the spelling of the word. Returns the word with the highest confidence using the spelling corrector. .. versionadded:: 0.6.0 i(R#R7(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytcorrect{scC@s4|jdk rt|jnd}|jd|S(uGReturn the lemma of this word using Wordnet's morphy function. tposN(R(R R"t lemmatize(R)R!((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytlemmas$cC@s:|dkrtj}ntjj}|j|j|S(uReturn the lemma for a word using WordNet's morphy function. :param pos: Part of speech to filter upon. If `None`, defaults to ``_wordnet.NOUN``. .. versionadded:: 0.8.1 N(R RRtnltktstemtWordNetLemmatizerR:R'(R)R9t lemmatizer((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR:s  cC@s|jddS(utThe list of Synset objects for this Word. :rtype: list of Synsets .. versionadded:: 0.7.0 R9N(t get_synsetsR (R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytsynsetsscC@s|jddS(uThe list of definitions for this word. Each definition corresponds to a synset. .. versionadded:: 0.7.0 R9N(tdefineR (R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt definitionsscC@stj|j|S(uReturn a list of Synset objects for this word. :param pos: A part-of-speech tag to filter upon. If ``None``, all synsets for all parts of speech will be loaded. :rtype: list of Synsets .. versionadded:: 0.7.0 (RRAR'(R)R9((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR@s cC@s)g|jd|D]}|j^qS(u;Return a list of definitions for this word. Each definition corresponds to a synset for this word. :param pos: A part-of-speech tag to filter upon. If ``None``, definitions for all parts of speech will be loaded. :rtype: List of strings .. versionadded:: 0.7.0 R9(R@t definition(R)R9tsyn((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRBs N(t__name__t __module__t__doc__RR2R R%R*R,R-RRR4R6R7R8RRR;R:RARCR@RB(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR#=s(            tWordListcB@seZdZdZdZdZdZdZdZe dZ dZ d Z d Z d Zd Zd ZdZRS(u A list-like collection of words.cC@s?g|D]}t|^q|_tt|j|jdS(u[Initialize a WordList. Takes a collection of strings as its only argument. N(R#t _collectionR$RIR*(R)t collectiontw((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR*s"cC@s t|jS(N(tstrRJ(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR-scC@s+|jj}djd|dt|jS(u.Returns a string representation for debugging.u {cls}({lst})R&tlst(t __class__RFtformatR+RJ(R)t class_name((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR,s cC@s2t|tr#|j|j|S|j|SdS(u$Returns a string at the given index.N(t isinstancetsliceRORJ(R)tkey((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt __getitem__scC@s|j|j||!S(N(RORJ(R)titj((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt __getslice__scC@s t|jS(N(titerRJ(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__iter__scO@sN|s8g|D]}|j^q j|j||S|jj|||S(uGet the count of a word or phrase `s` within this WordList. :param strg: The string to count. :param case_sensitive: A boolean, whether or not the search is case-sensitive. (tlowertcountRJ(R)tstrgtcase_sensitivetargstkwargstword((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR\s+cC@s9t|tr%|jjt|S|jj|SdS(ukAppend an object to end. If the object is a string, appends a :class:`Word ` object. N(RRR RJtappendR#(R)tobj((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRbscC@sBg|D]3}|jjt|tr1t|n|^q|S(uExtend WordList by appending elements from ``iterable``. If an element is a string, appends a :class:`Word ` object. (RJRbRRR R#(R)titerablete((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytextends;cC@s&|jg|D]}|j^q S(u1Return a new WordList with each word upper-cased.(ROtupper(R)Ra((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRgscC@s&|jg|D]}|j^q S(u1Return a new WordList with each word lower-cased.(ROR[(R)Ra((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR[scC@s&|jg|D]}|j^q S(u8Return the single version of each word in this WordList.(ROR(R)Ra((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR scC@s&|jg|D]}|j^q S(u8Return the plural version of each word in this WordList.(ROR(R)Ra((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR scC@s&|jg|D]}|j^q S(u/Return the lemma of each word in this WordList.(ROR:(R)Ra((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR:s(RFRGRHR*R-R,RURXRZtFalseR\RbRfRgR[RRR:(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRIs           cC@s\|r |n|j}|dk rRt|| rRtdjd|d|n|p[|S(ujValidates a parameter passed to __init__. Makes sure that obj is the correct class. Return obj if it's not None or falls back to default :param obj: The object passed in. :param name: The name of the parameter. :param base_class: The class that obj must inherit from. :param default: The default object to fall back upon if obj is None. u#{name} must be an instance of {cls}tnameR&N(RFR RRt ValueErrorRP(RcRit base_classtdefaulttbase_class_name((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt_validated_params  c C@st|ddttjjjfdtjdd|_t|ddtdtj |_ t|dt tj |_ t|dt tj |_ t|d ttj|_||_d S( u;Common initialization between BaseBlob and Blobber classes.u tokenizerRkRlRmu BaseTokenizeru np_extractoru pos_taggeruanalyzeruparserN(RnRR<ttokenizetapit TokenizerItBaseBlobt tokenizerR t np_extractorRt pos_taggerRtanalyzerRtparsert classifier(RcRsRuRtRvRwRx((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt_initialize_models&s      RrcB@sseZdZeZeZeZe Z e Z e ZddddddedZedZedZddZddZdZedZedZed Zed Zed ZeZed Zed ZddZ dddZ!dZ"dZ#dZ$dZ%dZ&dZ'de(j)dZ*RS(uZAn abstract base class that all textblob classes will inherit from. Includes words, POS tag, NP, and word count properties. Also includes basic dunder and string methods for making objects like Python strings. :param text: A string. :param tokenizer: (optional) A tokenizer instance. If ``None``, defaults to :class:`WordTokenizer() `. :param np_extractor: (optional) An NPExtractor instance. If ``None``, defaults to :class:`FastNPExtractor() `. :param pos_tagger: (optional) A Tagger instance. If ``None``, defaults to :class:`NLTKTagger `. :param analyzer: (optional) A sentiment analyzer. If ``None``, defaults to :class:`PatternAnalyzer `. :param parser: A parser. If ``None``, defaults to :class:`PatternParser `. :param classifier: A classifier. .. versionchanged:: 0.6.0 ``clean_html`` parameter deprecated, as it was in NLTK. c C@st|ts-tdjt|n|rBtdn||_|_t|jdt |_ t |||||||dS(NuHThe `text` argument passed to `__init__(text)` must be a string, not {0}u^clean_html has been deprecated. To remove HTML markup, use BeautifulSoup's get_text() functiontall( RRR t TypeErrorRPttypetNotImplementedErrortrawR'RtTruetstrippedRy( R)ttextRsRuRtRvRwRxt clean_html((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR*Us cC@stt|jdtS(uReturn a list of word tokens. This excludes punctuation characters. If you want to include punctuation characters, access the ``tokens`` property. :returns: A :class:`WordList ` of word tokens. t include_punc(RIRR~Rh(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytwordsdscC@st|jj|jS(uReturn a list of tokens, using this blob's tokenizer object (defaults to :class:`WordTokenizer `). (RIRsRoR~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyttokensnscC@s1|dk r|n|j}t|j|jS(uReturn a list of tokens, using ``tokenizer``. :param tokenizer: (optional) A tokenizer object. If None, defaults to this blob's default tokenizer. N(R RsRIRoR~(R)Rstt((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRouscC@s+|dk r|n|j}|j|jS(uParse the text. :param parser: (optional) A parser instance. If ``None``, defaults to this blob's default parser. .. versionadded:: 0.6.0 N(R RwtparseR~(R)Rwtp((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR~scC@s1|jdkrtdn|jj|jS(u2Classify the blob using the blob's ``classifier``.u-This blob has no classifier. Train one first!N(RxR t NameErrortclassifyR~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRscC@s|jj|jS(uFReturn a tuple of form (polarity, subjectivity ) where polarity is a float within the range [-1.0, 1.0] and subjectivity is a float within the range [0.0, 1.0] where 0.0 is very objective and 1.0 is very subjective. :rtype: namedtuple of the form ``Sentiment(polarity, subjectivity)`` (RvtanalyzeR~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt sentiments cC@stj|jdS(uaReturn the polarity score as a float within the range [-1.0, 1.0] :rtype: float i(RRR~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytpolarityscC@stj|jdS(uReturn the subjectivity score as a float within the range [0.0, 1.0] where 0.0 is very objective and 1.0 is very subjective. :rtype: float i(RRR~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt subjectivityscC@sJtg|jj|jD]*}t|dkr|jj^qS(u-Returns a list of noun phrases for this blob.i(RIRttextractR~tlentstripR[(R)tphrase((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt noun_phrasesscC@sYg|jj|jD]?\}}tjt|st|d|t|f^qS(uReturns an list of tuples of the form (word, POS tag). Example: :: [('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'), ('Thursday', 'NNP'), ('morning', 'NN')] :rtype: list of tuples R((RuR!R~RtmatchR R#(R)RaR((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytpos_tagss cC@sStt}g|jD]}t|^q}x|D]}||cd7` ii(trangeRRRI(R)tnRVtgrams((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytngramss  AuencC@sL|dkr$|jj|j}n|j|jj|jd|d|S(uTranslate the blob to another language. Uses the Google Translate API. Returns a new TextBlob. Requires an internet connection. Usage: :: >>> b = TextBlob("Simple is better than complex") >>> b.translate(to="es") TextBlob('Lo simple es mejor que complejo') Language code reference: https://developers.google.com/translate/v2/using_rest#language-params .. versionadded:: 0.5.0. :param str from_lang: Language to translate from. If ``None``, will attempt to detect the language. :param str to: Language to translate to. :rtype: :class:`BaseBlob ` R0R1N(R R2R3R'ROR4R~(R)R0R5((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR4s cC@s|jj|jS(uDetect the blob's language using the Google Translate API. Requires an internet connection. Usage: :: >>> b = TextBlob("bonjour") >>> b.detect_language() u'fr' Language code reference: https://developers.google.com/translate/v2/using_rest#language-params .. versionadded:: 0.5.0 :rtype: str (R2R3R~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR6scC@sDtjj|jd}d|D}dj|}|j|S(uAttempt to correct the spelling of a blob. .. versionadded:: 0.6.0 :rtype: :class:`BaseBlob ` u\w+|[^\w\s]|\scs@s!|]}t|jVqdS(N(R#R8(t.0RL((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pys su(R<Rotregexp_tokenizeR~tjoinRO(R)Rt correctedtret((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR8scC@s|jS(uXKey used by ComparableMixin to implement all rich comparison operators. (R~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt_cmpkey!scC@s|jS(u8Key used by StringlikeMixin to implement string methods.(R~(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt_strkey'scC@st|jS(N(thashR(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__hash__+scC@sht|tr#|j|j|St|trI|j|j|jStdj|jjdS(uConcatenates two text objects the same way Python strings are concatenated. Arguments: - `other`: a string or a text object u.Operands must be either strings or {0} objectsN(RRR ROR~RrR{RPRF(R)tother((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__add__.s  cC@st|jj||S(uBehaves like the built-in str.split() except returns a WordList. :rtype: :class:`WordList ` (RIRtsplit(R)tseptmaxsplit((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR=sN(+RFRGRHRRtRRuRRsRR2RRvRRwR RhR*RRRRoRRRRRRRttagsRRRR4R6R8RRRRtsystmaxsizeR(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRr9s@                   tTextBlobcB@skeZdZedZedZedZedZdZ edZ dZ RS(u?A general text block, meant for larger bodies of text (esp. those containing sentences). Inherits from :class:`BaseBlob `. :param str text: A string. :param tokenizer: (optional) A tokenizer instance. If ``None``, defaults to :class:`WordTokenizer() `. :param np_extractor: (optional) An NPExtractor instance. If ``None``, defaults to :class:`FastNPExtractor() `. :param pos_tagger: (optional) A Tagger instance. If ``None``, defaults to :class:`NLTKTagger `. :param analyzer: (optional) A sentiment analyzer. If ``None``, defaults to :class:`PatternAnalyzer `. :param classifier: (optional) A classifier. cC@s |jS(u4Return list of :class:`Sentence ` objects.(t_create_sentence_objects(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt sentencesVscC@stt|jdtS(uReturn a list of word tokens. This excludes punctuation characters. If you want to include punctuation characters, access the ``tokens`` property. :returns: A :class:`WordList ` of word tokens. R(RIRR~Rh(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR[scC@sg|jD]}|j^q S(u/List of strings, the raw sentences in the blob.(RR~(R)tsentence((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt raw_sentencesescC@sg|jD]}|j^q S(u6Returns a list of each sentence's dict representation.(Rtdict(R)R((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt serializedjscO@stj|j||S(uReturn a json representation (str) of this blob. Takes the same arguments as json.dumps. .. versionadded:: 0.5.1 (tjsontdumpsR(R)R_R`((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pytto_jsonoscC@s |jS(uThe json representation of this blob. .. versionchanged:: 0.5.1 Made ``json`` a property instead of a method to restore backwards compatibility that was broken after version 0.4.0. (R(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRwscC@sg}t|j}d}x|D]}|jj||}|t|7}|t|}t|d|d|d|jd|jd|jd|jd|j d |j }|j |q"W|S( u>Returns a list of Sentence objects from the raw text. it start_indext end_indexRsRtRuRvRwRx( RR~tindexRtSentenceRsRtRuRvRwRxRb(R)tsentence_objectsRt char_indextsentRRts((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRs ( RFRGRHRRRtpropertyRRRRR(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRFs   RcB@s,eZdZdddZedZRS(uA sentence within a TextBlob. Inherits from :class:`BaseBlob `. :param sentence: A string, the raw sentence. :param start_index: An int, the index where this sentence begins in a TextBlob. If not given, defaults to 0. :param end_index: An int, the index where this sentence ends in a TextBlob. If not given, defaults to the length of the sentence - 1. icO@sPtt|j|||||_|_|p?t|d|_|_dS(Ni(R$RR*tstartRRtendR(R)RRRR_R`((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR*scC@sJi|jd6|jd6|jd6|jd6|jd6|jd6|jd6S(u)The dict representation of this sentence.urawu start_indexu end_indexustrippedu noun_phrasesupolarityu subjectivity(R~RRRRRR(R)((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRs      N(RFRGRHR R*RR(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRs tBlobbercB@sneZdZeZeZeZe Z e Z dddddddZdZdZeZRS(u:A factory for TextBlobs that all share the same tagger, tokenizer, parser, classifier, and np_extractor. Usage: >>> from textblob import Blobber >>> from textblob.taggers import NLTKTagger >>> from textblob.tokenizers import SentenceTokenizer >>> tb = Blobber(pos_tagger=NLTKTagger(), tokenizer=SentenceTokenizer()) >>> blob1 = tb("This is one blob.") >>> blob2 = tb("This blob has the same tagger and tokenizer.") >>> blob1.pos_tagger is blob2.pos_tagger True :param tokenizer: (optional) A tokenizer instance. If ``None``, defaults to :class:`WordTokenizer() `. :param np_extractor: (optional) An NPExtractor instance. If ``None``, defaults to :class:`FastNPExtractor() `. :param pos_tagger: (optional) A Tagger instance. If ``None``, defaults to :class:`NLTKTagger `. :param analyzer: (optional) A sentiment analyzer. If ``None``, defaults to :class:`PatternAnalyzer `. :param parser: A parser. If ``None``, defaults to :class:`PatternParser `. :param classifier: A classifier. .. versionadded:: 0.4.0 cC@s t|||||||dS(N(Ry(R)RsRuRtRvRwRx((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR*scC@s@t|d|jd|jd|jd|jd|jd|jS(uReturn a new TextBlob object with this Blobber's ``np_extractor``, ``pos_tagger``, ``tokenizer``, ``analyzer``, and ``classifier``. :returns: A new :class:`TextBlob `. RsRuRtRvRwRx(RRsRuRtRvRwRx(R)R((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyt__call__s cC@sk|jr|jjjdnd}dj|jjj|jjj|jjj|jjj|jjj|S(Nu()uNoneulBlobber(tokenizer={0}(), pos_tagger={1}(), np_extractor={2}(), analyzer={3}(), parser={4}(), classifier={5})( RxRORFRPRsRuRtRvRw(R)tclassifier_name((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyR,s"     N(RFRGRHRRtRRuRRsRRvRRwR R*RR,R-(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyRs       (?RHt __future__RRRRt collectionsRR<ttextblob.decoratorsRRttextblob.utilsRRttextblob.inflectRR.RR/ttextblob.mixinsR R ttextblob.compatR R t textblob.baseR RRRRttextblob.np_extractorsRttextblob.taggersRttextblob.tokenizersRRRttextblob.sentimentsRttextblob.parsersRttextblob.translateRt textblob.enRtcorpustwordnetRR"R#tlistRIR RnRyRrRRtobjectR(((sc/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/textblob/textblob/blob.pyts:   (  Q  P