<s> """<STR_LIT>""" <EOL> import sys <EOL> import jieba <EOL> from argparse import ArgumentParser <EOL> from . _compat import * <EOL> parser = ArgumentParser ( usage = "<STR_LIT>" % sys . executable , description = "<STR_LIT>" , epilog = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , metavar = "<STR_LIT>" , default = '<STR_LIT>' , <EOL> nargs = '<STR_LIT:?>' , const = '<STR_LIT:U+0020>' , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , metavar = "<STR_LIT>" , nargs = '<STR_LIT:?>' , const = '<STR_LIT:_>' , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> action = "<STR_LIT:store_true>" , dest = "<STR_LIT>" , default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , dest = "<STR_LIT>" , action = "<STR_LIT>" , <EOL> default = True , help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , action = "<STR_LIT:store_true>" , default = False , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , '<STR_LIT>' , action = '<STR_LIT:version>' , <EOL> version = "<STR_LIT>" + jieba . __version__ ) <EOL> parser . add_argument ( "<STR_LIT:filename>" , nargs = '<STR_LIT:?>' , help = "<STR_LIT>" ) <EOL> args = parser . parse_args ( ) <EOL> if args . quiet : <EOL> jieba . setLogLevel ( <NUM_LIT> ) <EOL> if args . pos : <EOL> import jieba . posseg <EOL> posdelim = args . pos <EOL> def cutfunc ( sentence , _ , HMM = True ) : <EOL> for w , f in jieba . posseg . cut ( sentence , HMM ) : <EOL> yield w + posdelim + f <EOL> else : <EOL> cutfunc = jieba . cut <EOL> delim = text_type ( args . delimiter ) <EOL> cutall = args . cutall <EOL> hmm = args . hmm <EOL> fp = open ( args . filename , '<STR_LIT:r>' ) if args . filename else sys . stdin <EOL> if args . dict : <EOL> jieba . initialize ( args . dict ) <EOL> else : <EOL> jieba . initialize ( ) <EOL> if args . user_dict : <EOL> jieba . load_userdict ( args . user_dict ) <EOL> ln = fp . readline ( ) <EOL> while ln : <EOL> l = ln . rstrip ( '<STR_LIT:\r\n>' ) <EOL> result = delim . join ( cutfunc ( ln . rstrip ( '<STR_LIT:\r\n>' ) , cutall , hmm ) ) <EOL> if PY2 : <EOL> result = result . encode ( default_encoding ) <EOL> print ( result ) <EOL> ln = fp . readline ( ) <EOL> fp . close ( ) </s>
