content_indexer v0.2.4 ContentIndexer.TfIdf.Calculate

Calculate the TF_IDF weights for a given document_name tokens

Link to this section Summary

Functions

Retrieves the current set of weights i.e. the state

Link to this section Functions

Link to this function tf_idf(document_name, tokens)

Retrieves the current set of weights i.e. the state

## Parameters

- document_name: String - document name
- tokens: List of tokens each being a String

## Example

iex> ContentIndexer.TfIdf.Calculate.tf_idf("test_file.md", ["bread","butter"])
{:ok, [
    {"test_file_1.md", [{"butter", 0}, {"bread", -0.234}]},
  ]
}