`L iddlZddlZejdejejdZd dZd dZd dZd dZ dZ y) N[]c|r$tjd|jS|jjtjS)zRemoves punctuation from a string. :param s: The string. :param all: Remove all punctuation. If False, only removes punctuation from the ends of the string. )PUNCTUATION_REGEXsubstripstring punctuationsalls T/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/textblob/utils.py strip_puncrs;  $$R33wwyv1122cTt|jj|S)zMakes text all lowercase and strips punctuation and whitespace. :param s: The string. :param all: Remove all punctuation. If False, only removes punctuation from the ends of the string. )r)rlowerr r s r lowerstriprs aggioo'S 11rcV|j|Dcgc]\}}| c}}Scc}}w)zConvert a nltk.tree.Tree to a string. For example: (NP a/DT beautiful/JJ new/JJ dashboard/NN) -> "a beautiful dashboard" )join)treeconcatwordtags rtree2strrs% ;;5$5 665s % cg}|D]9\}}d}|D]}|j|sd}n|s'|j||f;|S)zAFilter out insignificant (word, tag) tuples from a chunk of text.TF)endswithappend)chunk tag_suffixesgoodrroksuffixs rfilter_insignificantr$'s^ D% c " F||F#   KKs $% Krct|dS)z-Return whether ``obj`` is a file-like object.read)hasattr)objs r is_fileliker)5s 3 r)F) ))DTCCzPRP$PRP) rer compileescaper rrrrr$r)rrr2sP BJJ9299V-?-?#@"ACD 327  r