def find_maltparser(parser_dirname):
 if os.path.exists(parser_dirname):
  _malt_dir = parser_dirname
 else:
  _malt_dir = find_dir(parser_dirname, env_vars=(u'MALT_PARSER',))
 malt_dependencies = [u'', u'', u'']
 _malt_jars = set(find_jars_within_path(_malt_dir))
 _jars = set((os.path.split(jar)[1] for jar in _malt_jars))
 malt_dependencies = set([u'log4j.jar', u'libsvm.jar', u'liblinear-1.8.jar'])
 assert malt_dependencies.issubset(_jars)
 assert any(filter((lambda i: (i.startswith(u'maltparser-') and i.endswith(u'.jar'))), _jars))
 return list(_malt_jars)

def find_maltparser ( parser_dirname ) : if os . path . exists ( parser_dirname ) : _malt_dir = parser_dirname else : _malt_dir = find_dir ( parser_dirname , env_vars = ( u'MALT_PARSER' , ) ) malt_dependencies = [ u'' , u'' , u'' ] _malt_jars = set ( find_jars_within_path ( _malt_dir ) ) _jars = set ( ( os . path . split ( jar ) [ 1 ] for jar in _malt_jars ) ) malt_dependencies = set ( [ u'log4j.jar' , u'libsvm.jar' , u'liblinear-1.8.jar' ] ) assert malt_dependencies . issubset ( _jars ) assert any ( filter ( ( lambda i : ( i . startswith ( u'maltparser-' ) and i . endswith ( u'.jar' ) ) ) , _jars ) ) return list ( _malt_jars )
a module to find maltparser .