Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stopwords_high = STOPWORDS_HIGH_DEFAULT
max_link_density = MAX_LINK_DENSITY_DEFAULT
max_heading_distance = MAX_HEADING_DISTANCE_DEFAULT
encoding = None
default_encoding = DEFAULT_ENCODING
force_default_encoding = False
enc_errors = DEFAULT_ENC_ERRORS
try:
for o, a in opts:
if o in ("-h", "--help"):
print(usage())
sys.exit(0)
if o in ("-V", "--version"):
print("%s: jusText v%s\n\nCopyright (c) 2011 Jan Pomikalek " % (
os.path.basename(sys.argv[0]), VERSION))
sys.exit(0)
elif o == "--list-stoplists":
print("\n".join(get_stoplists()))
sys.exit(0)
elif o == "-o":
try:
fp_out = codecs.open(a, 'w', 'utf8')
except IOError as e:
raise JustextInvalidOptions(
"Can't open %s for writing: %s" % (a, e))
elif o == "-s":
if a.lower() == 'none':
stoplist = set()
else:
if os.path.isfile(a):
try: