C# Class SoundFingerprinting.Query.ConfidenceCalculator

Inheritance: IConfidenceCalculator
显示文件 Open project: AddictedCS/soundfingerprinting

Public Methods

Method Description
CalculateConfidence ( double sourceMatchStartsAt, double sourceMatchLength, double queryLength, double originStartsAt, double originLength ) : double

Calculates how confident is the algorithm that it found a successful match Source - query file, Origin - inserted item in the database

Private Methods

Method Description
Ceil ( double confidence ) : double
GetConfidenceForSmallSnippetFoundInLongOrigin ( double sourceMatchStartsAt, double sourceMatchLength, double queryLength, double originStartsAt, double originLength ) : double
GetConfidenceForSmallSnippetFoundInLongQuery ( double sourceMatchStartsAt, double sourceMatchLength, double queryLength, double originStartsAt, double originLength ) : double
NeedleInHaystack ( double queryLength, double originLength ) : bool
OriginTrackIsClippedAtTheEnd ( double sourceMatchStartsAt, double queryLength, double originLength ) : bool
OriginTrackIsClippedFromTheBegining ( double sourceMatchStartsAt, double originStartsAt ) : bool
QueryClippedFromTheBegining ( double originStartsAt, double originLength, double queryLength ) : bool
QueryClippedFromTheEnd ( double sourceMatchStartsAt, double originStartsAt ) : bool

Method Details

CalculateConfidence() public method

Calculates how confident is the algorithm that it found a successful match Source - query file, Origin - inserted item in the database
public CalculateConfidence ( double sourceMatchStartsAt, double sourceMatchLength, double queryLength, double originStartsAt, double originLength ) : double
sourceMatchStartsAt double Source starts to match at this position
sourceMatchLength double Length of the match in the source
queryLength double Total length of the query
originStartsAt double Start position of the match in the resulting (origin) track, as returned from the datasource
originLength double Length of the origin track as it was inserted in datasource
return double