C# Class Ada.Matchers.BoWPoS.BagOfWords

Show file Open project: yvettec/Dupes

Public Methods

Method Description
AddDocument ( uint documentID, uint>.IDictionary termTFs ) : void
BagOfWords ( ) : System
BagOfWords ( Term>.IDictionary terms, bool idfsCalculated = false ) : System
BagOfWords ( IEnumerable terms, bool idfsCalculated = false ) : System
ContainsDocument ( uint docID ) : bool
GetSimilarity ( uint>.IDictionary terms, uint maxDocsToReturn ) : float>.Dictionary

Calculates the cosine similarity of the given strings (normally words) compared to the current collection of Terms.

RecalculateIDFs ( ) : void
RemoveDocument ( uint documentID, uint>.IDictionary termTFs ) : void

Private Methods

Method Description
CalculateDocumentLength ( uint docID, List terms ) : float
CalculateQueryLength ( float>.Dictionary queryVector ) : float
CalculateQueryTfIdfVector ( uint>.IDictionary tf ) : float>.Dictionary

Method Details

AddDocument() public method

public AddDocument ( uint documentID, uint>.IDictionary termTFs ) : void
documentID uint
termTFs uint>.IDictionary
return void

BagOfWords() public method

public BagOfWords ( ) : System
return System

BagOfWords() public method

public BagOfWords ( Term>.IDictionary terms, bool idfsCalculated = false ) : System
terms Term>.IDictionary
idfsCalculated bool
return System

BagOfWords() public method

public BagOfWords ( IEnumerable terms, bool idfsCalculated = false ) : System
terms IEnumerable
idfsCalculated bool
return System

ContainsDocument() public method

public ContainsDocument ( uint docID ) : bool
docID uint
return bool

GetSimilarity() public method

Calculates the cosine similarity of the given strings (normally words) compared to the current collection of Terms.
public GetSimilarity ( uint>.IDictionary terms, uint maxDocsToReturn ) : float>.Dictionary
terms uint>.IDictionary A collection of tokens (i.e., words) for a given string.
maxDocsToReturn uint
return float>.Dictionary

RecalculateIDFs() public method

public RecalculateIDFs ( ) : void
return void

RemoveDocument() public method

public RemoveDocument ( uint documentID, uint>.IDictionary termTFs ) : void
documentID uint
termTFs uint>.IDictionary
return void