MCPcopy Index your code
hub / github.com/python/cpython / finish

Method finish

Tools/unicode/dawg.py:135–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 self.previous_word = word
134
135 def finish(self):
136 if not self.data:
137 raise ValueError("need at least one word in the dawg")
138 # minimize all unchecked_nodes
139 self._minimize(0)
140
141 self._linearize_edges()
142
143 topoorder, linear_data, inverse = self._topological_order()
144 return self.compute_packed(topoorder), linear_data, inverse
145
146 def _minimize(self, down_to):
147 # proceed from the leaf up to a certain point

Callers 2

build_compression_dawgFunction · 0.95

Calls 4

_minimizeMethod · 0.95
_linearize_edgesMethod · 0.95
_topological_orderMethod · 0.95
compute_packedMethod · 0.95

Tested by 1