Package tipy :: Module mrgr :: Class ProbabilisticMerger
[hide private]
[frames] | no frames]

Class ProbabilisticMerger

source code

object --+    
         |    
    Merger --+
             |
            ProbabilisticMerger

Simple Merger which merge suggestions based on their probabilities.

This Merger does not modify the suggestions probabilities. Thus, they are sorted in descending order according to their probabilities.

Class Hierarchy for ProbabilisticMerger
Class Hierarchy for ProbabilisticMerger

Nested Classes [hide private]
    Inherited from Merger
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
__init__(self)
ProbabilisticMerger creator.
source code
prdct.Prediction
merge(self, predictionList)
merge the suggestions in a single list and sort them.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from Merger
Prediction
filter(self, prediction)
Sort the tokens according to their probabilities.
source code
Class Variables [hide private]
  __abstractmethods__ = frozenset([])
    Inherited from Merger
  MAX_PROBABILITY = 1.0
  MIN_PROBABILITY = 0.0
  _abc_cache = <_weakrefset.WeakSet object at 0x7f2a423442d0>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x7f2a423...
  _abc_negative_cache_version = 39
  _abc_registry = <_weakrefset.WeakSet object at 0x7f2a42344210>
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

ProbabilisticMerger creator.

Overrides: object.__init__

merge(self, predictionList)

source code 

merge the suggestions in a single list and sort them.

Parameters:
  • predictionList (list) - The list of Prediction instances. Each predictors return a Prediction instance which is added to the list by the PredictorActivator.
Returns: prdct.Prediction
The merged Prediction instance containing every suggestions of every Prediction instances sorted in descending order according to their probabilities.
Overrides: Merger.merge