I was trying to log out some results of this function and realized that if it results in a perfect match the returned value isn't a float but an integer.
Float.to_string(Ngram.calculate('helena', 'helena', 1))
** (FunctionClauseError) no function clause matching in Float.to_string/1
Note that this can be worked around by dividing the result by 1.0 in order to force it to be a float:
Float.to_string(Ngram.calculate('helena', 'helena', 1)/1.0)