/usr/local/lib/python3.6/site-packages/sacremoses/__pycache__
NameSizeModeActions
chinese.cpython-36.pyc147100644editdlrm
cli.cpython-36.pyc65190644editdlrm
corpus.cpython-36.pyc49150644editdlrm
indic.cpython-36.pyc9490644editdlrm
normalize.cpython-36.pyc48290644editdlrm
sent_tokenize.cpython-36.pyc7210644editdlrm
subwords.cpython-36.pyc46500644editdlrm
tokenize.cpython-36.pyc165930644editdlrm
truecase.cpython-36.pyc117780644editdlrm
util.cpython-36.pyc51300644editdlrm
__init__.cpython-36.pyc2990644editdlrm
__main__.cpython-36.pyc2240644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/sacremoses/__pycache__/normalize.cpython-36.pyc (4829B)
3 Eg@s:ddlZddlZddlmZddlmZGdddZdS)N) text_type)chainc%@seZdZdZddddddddddg ZddgZdddddddddddddddgZddddddgZddddddddddg ZdgZ ddgZ dgZ dgZ ddddddddddddddddddddddddddddddddddddg$Z dddZddZddZddZdS)MosesPunctNormalizerz This is a Python port of the Moses punctuation normalizer from https://github.com/moses-smt/mosesdecoder/blob/master/scripts/tokenizer/normalize-punctuation.perl \r\( (\))  + \) ([.!:?;,]))\g<1>\( ( \))(\d) %\g<1>% :: ;;`''' " „"“”–-— - ´([a-zA-Z])‘([a-zA-Z]) \g<1>'\g<2>([a-zA-Z])’([a-zA-Z])‘‚’´´…... « « « »  »» %%nº nº  : ºC ºC cm cm \?? \!! ;, , "([,.]+)\g<1>","",(\.+)"(\s*[^<]) "\g<1>\g<2> (\d) (\d) \g<1>,\g<2> \g<1>.\g<2>,,。\s*. 、∶:?《》)!(;」「00112233445566778899.\s*~~━〈<〉>【[】]%enTFcCs|j|j|j|jg|_|r*|jjd|j|r\|dkrF|jj|jn|d kr\|jj|j |r|d krx|jj|j n|jj|j t t |j|_||_||_dS) ah :param language: The two-letter language code. :type lang: str :param penn: Normalize Penn Treebank style quotations. :type penn: bool :param norm_quote_commas: Normalize quotations and commas :type norm_quote_commas: bool :param norm_numbers: Normalize numbers :type norm_numbers: bool rdeesfrczcsN)rrr)rrrrr)EXTRA_WHITESPACENORMALIZE_UNICODE FRENCH_QUOTESHANDLE_PSEUDO_SPACES substitutionsinsertNORMALIZE_UNICODE_IF_NOT_PENNappendEN_QUOTATION_FOLLOWED_BY_COMMA$DE_ES_FR_QUOTATION_FOLLOWED_BY_COMMADE_ES_CZ_CS_FROTHERlistrpre_replace_unicode_punctpost_remove_control_chars)selflangZpennZnorm_quote_commasZ norm_numbersrrr>/usr/local/lib/python3.6/site-packages/sacremoses/normalize.py__init__s$ zMosesPunctNormalizer.__init__cCsN|jr|j|}x$|jD]\}}tj||t|}qW|jrF|j|}|jS)z? Returns a string with normalized punctuation. ) rreplace_unicode_punctrresubrrremove_control_charsstrip)rtextregexp substitutionrrr normalizes  zMosesPunctNormalizer.normalizecCs*x$|jD]\}}tj||t|}qW|S)N)REPLACE_UNICODE_PUNCTUATIONrrr)rrrrrrrrsz*MosesPunctNormalizer.replace_unicode_punctcCstjdd|S)Nz\p{C}r)regexr)rrrrrrsz)MosesPunctNormalizer.remove_control_charsN)rr)rr)r r )r r )r r)rr)rr)rr)rr)rr)rr)rr)rr)rr)r r)r!r")r#r$)r r )r%r)r&r')r(r')r)r)r*r)r+r)rr)r,r)r-r.)r/r)r0r)r1r)r2r)r3r)r4r)r5r6)r7r8)r9r)r:r;)r<r=)r>r?)r@rA)rBr)rCrD)r r )rErF)rGrH)rIrJ)rKrL)rKrM)rNrO)rPrQ)rRrO)r r)rr)rSr)rTr)rUr?)rVr)rWr)rXr)rYrA)rZr)r[r)r\r)r]r)r^r_)r`ra)rbrc)rdre)rfrg)rhri)rjrk)rlrm)rnro)rprq)rrrQ)rsrt)r+r)r-r.)rur")rvrw)rxry)rzr{)r|r})r~r6)rTTTFF)__name__ __module__ __qualname____doc__rrrrrrrrrrrrrrrrrrr s 'r)rrsixr itertoolsrrrrrrs