def __init__(self, cdb_lu=None, cdb_syn=None, output_format=SimCornet._default_output_format, max_depth=SimCornet._default_max_depth): SimCornet.__init__(self, cdb_lu, cdb_syn, output_format, max_depth) self._init_cache()
def _transitive_closure_lu(self, lu, rel_name): # Transitive closure for a single lu raher than a list. # Cached version which assumes that rel_name (e.g. "HAS_HYPERONYM") # remains the same over one cached session return self._trans_closure_cache.setdefault( lu, SimCornet._transitive_closure(self, [lu], rel_name))
def _IC(self, lu, subcount=False, smooth=False, cat_totals=False, base=2): # Cached version which assumes that keyword args remain the same over # one cached session return self._IC_cache.setdefault( lu, SimCornet._IC(self, lu, subcount, smooth, cat_totals, base))
def _get_lex_units_raw(self, spec): # Cached version which assumes that format (e.g. "raw") # remains the same over one cached session return self._get_lex_units_cache.setdefault( spec, SimCornet.get_lex_units(self, spec, format="raw"))