sourced.ml.core.extractors.identifier_distance

Module Contents

class sourced.ml.core.extractors.identifier_distance.IdentifierDistance(split_stem=False, type='tree', max_distance=DEFAULT_MAX_DISTANCE, **kwargs)[source]

Bases:sourced.ml.core.extractors.bags_extractor.BagsExtractor

Extractor wrapper for Uast2IdTreeDistance and Uast2IdLineDistance algorithm. Note that this is an unusual BagsExtractor since it returns iterable instead of bag.

The class did not wrap with @register_extractor because it does not produce bags as others do. So nobody outside code will see it or use it directly. For the same reason we a free to override NAMESPACE, NAME, OPTS fields with any value we want.

TODO(zurk): Split BagsExtractor into two clases: Extractor and BagsExtractor(Extractor), re-inherit this class from Extractor, delete explanations from docstring.

class DistanceType[source]
Tree = tree[source]
Line = line[source]
All[source]
static resolve(type)[source]
NAMESPACE =[source]
NAME = Identifier distance[source]
OPTS[source]
DEFAULT_MAX_DISTANCE[source]
extract(self, uast: bblfsh.Node)[source]