Skip to content

Commit

Permalink
Bug fix: added missing normalization.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Apr 8, 2018
1 parent ff99c4a commit 1e0ecb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion JavaTriesWithFrequencies.m
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ Mathematica is (C) Copyright 1988-2017 Wolfram Research, Inc.

JavaTrieClassify[tr_, record_, "Probabilities", opts : OptionsPattern[]] :=
Block[{res, dval = OptionValue[JavaTrieClassify, "Default"]},
res = JavaTrieLeafProbabilities[JavaTrieRetrieve[tr, record]];
res = JavaTrieLeafProbabilities[JavaTrieRetrieve[tr, record], "Normalized"->True];
If[Length[res] == 0, <|dval -> 0|>,
res = AssociationThread[res[[All, 2, 2]] -> res[[All, 1, 2]]];
res = ReverseSort[Association[Rule @@@ res]]
Expand Down

0 comments on commit 1e0ecb8

Please sign in to comment.