MCPcopy Index your code
hub / github.com/ddbourgin/numpy-ml / Node

Class Node

numpy_ml/preprocessing/nlp.py:399–428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397
398
399class Node(object):
400 def __init__(self, key, val):
401 self.key = key
402 self.val = val
403 self.left = None
404 self.right = None
405
406 def __gt__(self, other):
407 """Greater than"""
408 if not isinstance(other, Node):
409 return -1
410 return self.val > other.val
411
412 def __ge__(self, other):
413 """Greater than or equal to"""
414 if not isinstance(other, Node):
415 return -1
416 return self.val >= other.val
417
418 def __lt__(self, other):
419 """Less than"""
420 if not isinstance(other, Node):
421 return -1
422 return self.val < other.val
423
424 def __le__(self, other):
425 """Less than or equal to"""
426 if not isinstance(other, Node):
427 return -1
428 return self.val <= other.val
429
430
431class HuffmanEncoder(object):

Callers 1

_build_treeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected