From 63771feba881d8127e1a2fc0c416869ead17baf3 Mon Sep 17 00:00:00 2001 From: rusinthread Date: Fri, 23 Dec 2016 04:27:31 +0300 Subject: don't know what... --- main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 48ac788..b493296 100755 --- a/main.py +++ b/main.py @@ -98,7 +98,8 @@ def clean_string(s, remove_junk=False): 'WITH A PASSWORD', 'ANT', 'YEAR', - 'RECOGNIZED' + 'RECOGNIZED', + #'SEARCHED' #'LEGAL', #'FIGHTING' ] @@ -124,7 +125,7 @@ def clean_string(s, remove_junk=False): return s -def decode(s): +def decode(s, is_url=False): buf = '' for word in s.split(' '): word = word.strip() @@ -133,7 +134,7 @@ def decode(s): if re.match(r'^\d+\%$', word): buf += word - elif word.endswith('://'): + elif is_url and word.endswith('://'): buf += word[0] buf += '://' else: @@ -148,6 +149,7 @@ def main(): parser.add_argument('--stats', action='store_true') parser.add_argument('--decode-string') parser.add_argument('--with-junk', action='store_true') + parser.add_argument('--is-url', action='store_true') args = parser.parse_args() data = load_data() @@ -178,7 +180,7 @@ def main(): print(args.decode_string) print_colored(text, 'green', fallback_prefix='[CLEANED] ') - print_colored(decode(text), 'cyan', fallback_prefix='[DECODED] ') + print_colored(decode(text, is_url=args.is_url), 'cyan', fallback_prefix='[DECODED] ') elif args.stats: count = len(data) -- cgit v1.2.3