亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? string.py

?? mallet是自然語言處理、機(jī)器學(xué)習(xí)領(lǐng)域的一個開源項目。
?? PY
字號:
# module 'string' -- A collection of string operations# Warning: most of the code you see here isn't normally used nowadays.  With# Python 1.6, many of these functions are implemented as methods on the# standard string object. They used to be implemented by a built-in module# called strop, but strop is now obsolete itself."""Common string manipulations.Public module variables:whitespace -- a string containing all characters considered whitespacelowercase -- a string containing all characters considered lowercase lettersuppercase -- a string containing all characters considered uppercase lettersletters -- a string containing all characters considered lettersascii_lowercase -- a string containing all characters considered lowercase  letters that is not locale-dependent and will not change.ascii_uppercase -- a string containing all characters considered uppercase  letters that is not locale-dependent and will not change.ascii_letters -- The concatenation of the ascii_lowercase and ascii_uppercase  constants described below. This value is not locale-dependent.digits -- a string containing all characters considered decimal digitshexdigits -- a string containing all characters considered hexadecimal digitsoctdigits -- a string containing all characters considered octal digitspunctuation -- a string containing all characters considered punctuationprintable -- a string containing all characters considered printable"""# Some strings for ctype-style character classificationwhitespace = ' \t\n\r\v\f'lowercase = 'abcdefghijklmnopqrstuvwxyz'uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'letters = lowercase + uppercasedigits = '0123456789'hexdigits = digits + 'abcdef' + 'ABCDEF'octdigits = '01234567'punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""printable = digits + letters + punctuation + whitespace# not set to 'lowercase' or 'uppercase' because they can changeascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'ascii_letters = ascii_lowercase + ascii_uppercase# Case conversion helpers_idmap = ''for i in range(256): _idmap = _idmap + chr(i)del i# Backward compatible names for exceptionsindex_error = ValueErroratoi_error = ValueErroratof_error = ValueErroratol_error = ValueError# convert UPPER CASE letters to lower casedef lower(s):    """lower(s) -> string    Return a copy of the string s converted to lowercase.    """    return s.lower()# Convert lower case letters to UPPER CASEdef upper(s):    """upper(s) -> string    Return a copy of the string s converted to uppercase.    """    return s.upper()# Swap lower case letters and UPPER CASEdef swapcase(s):    """swapcase(s) -> string    Return a copy of the string s with upper case characters    converted to lowercase and vice versa.    """    return s.swapcase()# Strip leading and trailing tabs and spacesdef strip(s):    """strip(s) -> string    Return a copy of the string s with leading and trailing    whitespace removed.    """    return s.strip()# Strip leading tabs and spacesdef lstrip(s):    """lstrip(s) -> string    Return a copy of the string s with leading whitespace removed.    """    return s.lstrip()# Strip trailing tabs and spacesdef rstrip(s):    """rstrip(s) -> string    Return a copy of the string s with trailing whitespace    removed.    """    return s.rstrip()# Split a string into a list of space/tab-separated words# NB: split(s) is NOT the same as splitfields(s, ' ')!def split(s, sep=None, maxsplit=-1):    """split(str [,sep [,maxsplit]]) -> list of strings    Return a list of the words in the string s, using sep as the    delimiter string.  If maxsplit is nonzero, splits into at most    maxsplit words If sep is not specified, any whitespace string    is a separator.  Maxsplit defaults to -1.    (split and splitfields are synonymous)    """    return s.split(sep, maxsplit)splitfields = split# Join fields with optional separatordef join(words, sep = ' '):    """join(list [,sep]) -> string    Return a string composed of the words in list, with    intervening occurences of sep.  The default separator is a    single space.    (joinfields and join are synonymous)    """    return sep.join(words)joinfields = join# for a little bit of speed_apply = apply# Find substring, raise exception if not founddef index(s, *args):    """index(s, sub [,start [,end]]) -> int    Like find but raises ValueError when the substring is not found.    """    return _apply(s.index, args)# Find last substring, raise exception if not founddef rindex(s, *args):    """rindex(s, sub [,start [,end]]) -> int    Like rfind but raises ValueError when the substring is not found.    """    return _apply(s.rindex, args)# Count non-overlapping occurrences of substringdef count(s, *args):    """count(s, sub[, start[,end]]) -> int    Return the number of occurrences of substring sub in string    s[start:end].  Optional arguments start and end are    interpreted as in slice notation.    """    return _apply(s.count, args)# Find substring, return -1 if not founddef find(s, *args):    """find(s, sub [,start [,end]]) -> in    Return the lowest index in s where substring sub is found,    such that sub is contained within s[start,end].  Optional    arguments start and end are interpreted as in slice notation.    Return -1 on failure.    """    return _apply(s.find, args)# Find last substring, return -1 if not founddef rfind(s, *args):    """rfind(s, sub [,start [,end]]) -> int    Return the highest index in s where substring sub is found,    such that sub is contained within s[start,end].  Optional    arguments start and end are interpreted as in slice notation.    Return -1 on failure.    """    return _apply(s.rfind, args)# for a bit of speed_float = float_int = int_long = long_StringType = type('')# Convert string to floatdef atof(s):    """atof(s) -> float    Return the floating point number represented by the string s.    """    if type(s) == _StringType:	return _float(s)    else:	raise TypeError('argument 1: expected string, %s found' %			type(s).__name__)# Convert string to integerdef atoi(*args):    """atoi(s [,base]) -> int    Return the integer represented by the string s in the given    base, which defaults to 10.  The string s must consist of one    or more digits, possibly preceded by a sign.  If base is 0, it    is chosen from the leading characters of s, 0 for octal, 0x or    0X for hexadecimal.  If base is 16, a preceding 0x or 0X is    accepted.    """    try:	s = args[0]    except IndexError:	raise TypeError('function requires at least 1 argument: %d given' %			len(args))    # Don't catch type error resulting from too many arguments to int().  The    # error message isn't compatible but the error type is, and this function    # is complicated enough already.    if type(s) == _StringType:	return _apply(_int, args)    else:	raise TypeError('argument 1: expected string, %s found' %			type(s).__name__)# Convert string to long integerdef atol(*args):    """atol(s [,base]) -> long    Return the long integer represented by the string s in the    given base, which defaults to 10.  The string s must consist    of one or more digits, possibly preceded by a sign.  If base    is 0, it is chosen from the leading characters of s, 0 for    octal, 0x or 0X for hexadecimal.  If base is 16, a preceding    0x or 0X is accepted.  A trailing L or l is not accepted,    unless base is 0.    """    try:	s = args[0]    except IndexError:	raise TypeError('function requires at least 1 argument: %d given' %			len(args))    # Don't catch type error resulting from too many arguments to long().  The    # error message isn't compatible but the error type is, and this function    # is complicated enough already.    if type(s) == _StringType:	return _apply(_long, args)    else:	raise TypeError('argument 1: expected string, %s found' %			type(s).__name__)# Left-justify a stringdef ljust(s, width):    """ljust(s, width) -> string    Return a left-justified version of s, in a field of the    specified width, padded with spaces as needed.  The string is    never truncated.    """    n = width - len(s)    if n <= 0: return s    return s + ' '*n# Right-justify a stringdef rjust(s, width):    """rjust(s, width) -> string    Return a right-justified version of s, in a field of the    specified width, padded with spaces as needed.  The string is    never truncated.    """    n = width - len(s)    if n <= 0: return s    return ' '*n + s# Center a stringdef center(s, width):    """center(s, width) -> string    Return a center version of s, in a field of the specified    width. padded with spaces as needed.  The string is never    truncated.    """    n = width - len(s)    if n <= 0: return s    half = n/2    if n%2 and width%2:	# This ensures that center(center(s, i), j) = center(s, j)	half = half+1    return ' '*half +  s + ' '*(n-half)# Zero-fill a number, e.g., (12, 3) --> '012' and (-3, 3) --> '-03'# Decadent feature: the argument may be a string or a number# (Use of this is deprecated; it should be a string as with ljust c.s.)def zfill(x, width):    """zfill(x, width) -> string    Pad a numeric string x with zeros on the left, to fill a field    of the specified width.  The string x is never truncated.    """    if type(x) == type(''): s = x    else: s = `x`    n = len(s)    if n >= width: return s    sign = ''    if s[0] in ('-', '+'):	sign, s = s[0], s[1:]    return sign + '0'*(width-n) + s# Expand tabs in a string.# Doesn't take non-printing chars into account, but does understand \n.def expandtabs(s, tabsize=8):    """expandtabs(s [,tabsize]) -> string    Return a copy of the string s with all tab characters replaced    by the appropriate number of spaces, depending on the current    column, and the tabsize (default 8).    """    res = line = ''    for c in s:	if c == '\t':	    c = ' '*(tabsize - len(line) % tabsize)	line = line + c	if c == '\n':	    res = res + line	    line = ''    return res + line# Character translation through look-up table.def translate(s, table, deletions=""):    """translate(s,table [,deletechars]) -> string    Return a copy of the string s, where all characters occurring    in the optional argument deletechars are removed, and the    remaining characters have been mapped through the given    translation table, which must be a string of length 256.    """    return s.translate(table, deletions)# Capitalize a string, e.g. "aBc  dEf" -> "Abc  def".def capitalize(s):    """capitalize(s) -> string    Return a copy of the string s with only its first character    capitalized.    """    return s.capitalize()# Capitalize the words in a string, e.g. " aBc  dEf " -> "Abc Def".# See also regsub.capwords().def capwords(s, sep=None):    """capwords(s, [sep]) -> string    Split the argument into words using split, capitalize each    word using capitalize, and join the capitalized words using    join. Note that this replaces runs of whitespace characters by    a single space.    """    return join(map(capitalize, s.split(sep)), sep or ' ')# Construct a translation string_idmapL = Nonedef maketrans(fromstr, tostr):    """maketrans(frm, to) -> string    Return a translation table (a string of 256 bytes long)    suitable for use in string.translate.  The strings frm and to    must be of the same length.    """    if len(fromstr) != len(tostr):	raise ValueError, "maketrans arguments must have same length"    global _idmapL    if not _idmapL:	_idmapL = map(None, _idmap)    L = _idmapL[:]    fromstr = map(ord, fromstr)    for i in range(len(fromstr)):	L[fromstr[i]] = tostr[i]    return joinfields(L, "")# Substring replacement (global)def replace(s, old, new, maxsplit=-1):    """replace (str, old, new[, maxsplit]) -> string    Return a copy of string str with all occurrences of substring    old replaced by new. If the optional argument maxsplit is    given, only the first maxsplit occurrences are replaced.    """    return s.replace(old, new, maxsplit)# Try importing optional built-in module "strop" -- if it exists,# it redefines some string operations that are 100-1000 times faster.# It also defines values for whitespace, lowercase and uppercase# that match <ctype.h>'s definitions.try:    from strop import maketrans, lowercase, uppercase, whitespace    letters = lowercase + uppercaseexcept ImportError:    pass					  # Use the original versions

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久蜜桃精品| 一区二区三区在线不卡| 成人国产亚洲欧美成人综合网| 亚洲人xxxx| 精品国免费一区二区三区| 91在线国产福利| 国内精品伊人久久久久影院对白| 综合分类小说区另类春色亚洲小说欧美| 欧美丰满嫩嫩电影| 99久久99久久免费精品蜜臀| 蜜桃久久精品一区二区| 亚洲精品欧美激情| 中文字幕不卡三区| 日韩欧美一级在线播放| 在线观看视频一区二区| 国产成人自拍网| 午夜av一区二区三区| 亚洲女人小视频在线观看| 久久先锋影音av鲁色资源网| 欧美日韩视频一区二区| 91麻豆精品一区二区三区| 狠狠色丁香久久婷婷综合_中| 亚洲国产cao| 亚洲欧美激情插| 欧美经典一区二区| 久久亚洲捆绑美女| 日韩免费看的电影| 欧美男同性恋视频网站| 色婷婷综合久久久久中文一区二区| 国产精品一区免费在线观看| 另类小说视频一区二区| 亚洲成人自拍网| 一区二区三区日韩欧美| 国产精品久99| 国产精品久久久一本精品| 久久婷婷色综合| 欧美精品一区二区高清在线观看| 7777女厕盗摄久久久| 欧美日韩视频第一区| 精品视频一区二区不卡| 在线观看一区日韩| 欧美色窝79yyyycom| 欧美性一区二区| 欧美综合天天夜夜久久| 欧美主播一区二区三区| 在线区一区二视频| 欧美性xxxxx极品少妇| 色老汉av一区二区三区| 91浏览器打开| 色综合欧美在线视频区| 在线一区二区三区做爰视频网站| 色哟哟国产精品免费观看| 99热精品国产| 日本久久精品电影| 欧美午夜一区二区三区免费大片| 精品视频1区2区| 69成人精品免费视频| 欧美一卡2卡三卡4卡5免费| 日韩写真欧美这视频| 精品福利视频一区二区三区| 久久久久久夜精品精品免费| 中文字幕成人网| 亚洲精选免费视频| 香蕉av福利精品导航| 久久精品国产亚洲a| 国产精品99久久久久久久女警 | 精品噜噜噜噜久久久久久久久试看 | 91精品久久久久久久久99蜜臂| 欧美日本一区二区三区四区| 日韩亚洲欧美中文三级| 国产三级精品视频| 一区二区三区视频在线观看| 日韩电影网1区2区| 国产精华液一区二区三区| 不卡电影一区二区三区| 欧美日韩在线播放三区四区| 日韩欧美亚洲一区二区| 欧美韩国日本综合| 亚洲国产精品一区二区久久恐怖片 | 国产一区二区免费视频| 99视频精品全部免费在线| 欧美日韩高清在线播放| 久久老女人爱爱| 樱花影视一区二区| 久久99热这里只有精品| 成人爱爱电影网址| 欧美丰满嫩嫩电影| 国产精品久久久久久久午夜片| 亚洲图片欧美综合| 国产精品911| 欧美日韩一区二区三区高清| 久久亚洲影视婷婷| 亚洲成人免费影院| 国产91丝袜在线播放| 欧美性一二三区| 国产免费观看久久| 日韩精品高清不卡| av一区二区三区| 日韩欧美在线观看一区二区三区| 中文字幕视频一区二区三区久| 日韩av午夜在线观看| 99久久精品国产精品久久| 日韩午夜中文字幕| 亚洲精品国产精华液| 国产精品一区二区男女羞羞无遮挡 | 欧美日韩国产123区| 国产精品拍天天在线| 麻豆精品在线看| 欧美色大人视频| 中文字幕日韩欧美一区二区三区| 另类的小说在线视频另类成人小视频在线| av中文字幕一区| 2021国产精品久久精品| 日韩高清在线一区| 一本大道久久a久久精二百| 国产色产综合色产在线视频| 日韩成人午夜精品| 欧美亚日韩国产aⅴ精品中极品| 中文字幕不卡在线播放| 国产一区二区精品久久| 欧美一级理论性理论a| 亚洲小少妇裸体bbw| 色88888久久久久久影院按摩| 欧美高清在线视频| 国产精品一区二区果冻传媒| 日韩精品中文字幕在线不卡尤物| 亚洲第一二三四区| 欧美吻胸吃奶大尺度电影 | 日韩美女啊v在线免费观看| 国产乱国产乱300精品| 欧美tk—视频vk| 美女久久久精品| 欧美一二三四区在线| 日韩黄色在线观看| 欧美日韩国产另类一区| 亚洲国产日日夜夜| 欧美午夜精品理论片a级按摩| 一区二区欧美国产| 欧美专区在线观看一区| 亚洲一区二区欧美激情| 欧美视频一二三区| 亚洲a一区二区| 777久久久精品| 免费观看一级欧美片| 欧美成人精精品一区二区频| 日本va欧美va欧美va精品| 欧美一区二区网站| 精品一区二区三区在线播放视频| 欧美一区在线视频| 久久66热偷产精品| 久久人人97超碰com| 国产99久久久精品| 中文一区一区三区高中清不卡| hitomi一区二区三区精品| 国产精品久久久久9999吃药| 色乱码一区二区三区88| 亚洲在线观看免费视频| 欧美精品xxxxbbbb| 久久99精品视频| 中文字幕av一区二区三区免费看 | 一区二区三区中文字幕电影| 91黄色激情网站| 天天综合天天做天天综合| 日韩一区二区麻豆国产| 国产一区二区h| 亚洲色欲色欲www在线观看| 91久久精品一区二区| 日本美女视频一区二区| 久久九九久精品国产免费直播| 99久久精品情趣| 秋霞午夜鲁丝一区二区老狼| 日韩精品一区二区三区四区视频 | 欧美三级电影精品| 麻豆视频观看网址久久| 国产精品欧美一区二区三区| 欧美性生交片4| 韩国女主播一区| 亚洲免费看黄网站| 欧美电影免费观看完整版| 不卡电影一区二区三区| 日韩精品一二区| 国产精品久久久久久久浪潮网站 | 亚洲一区二区三区四区五区黄 | 亚洲天堂久久久久久久| 欧美影院午夜播放| 久久97超碰国产精品超碰| 国产精品国产三级国产专播品爱网 | 看电影不卡的网站| 亚洲精品久久久蜜桃| 欧美不卡激情三级在线观看| 99re这里只有精品6| 麻豆国产欧美一区二区三区| 综合激情成人伊人| 精品盗摄一区二区三区| 在线观看日韩毛片| 国产成人精品综合在线观看| 五月婷婷激情综合| 亚洲日本中文字幕区| 精品黑人一区二区三区久久| 在线观看日韩av先锋影音电影院|