Skip to content

Commit

Permalink
Implemented JavaTrieShrinkInternalNodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Feb 3, 2017
1 parent b1de8f8 commit 3057c23
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions JavaTriesWithFrequencies.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Mathematica is (C) Copyright 1988-2017 Wolfram Research, Inc.
JavaTrieShrink::usage = "JavaTrieShrink[ jTr_, sep_String:\"\"] concatenates the \"single path\" nodes\
in the trie jTr using the given separator sep."

JavaTrieShrinkInternalNodes::usage = "JavaTrieShrinkInternalNodes[ jTr_, sep_String:\"\"] concatenates\
the \"single path\" internal nodes in the trie jTr using the given separator sep."


JavaTrieThresholdRemove::usage = "Remove nodes that have values below (or above) a threshold."

JavaTrieParetoFractionRemove::usage = "Remove nodes that have values below (or above) thresholds derived\
Expand Down Expand Up @@ -269,6 +273,13 @@ Mathematica is (C) Copyright 1988-2017 Wolfram Research, Inc.

JavaTrieShrink[jTr_?JavaObjectQ, sep_String, th_?NumberQ ] := TrieFunctions`shrinkByThreshold[jTr, sep, th];

Clear[JavaTrieShrinkInternalNodes]
JavaTrieShrinkInternalNodes[jTr_?JavaObjectQ, sep_String: ""] :=
TrieFunctions`shrinkInternalNodes[jTr, sep, 1.0 ];

JavaTrieShrinkInternalNodes[jTr_?JavaObjectQ, sep_String, th_?NumberQ ] :=
TrieFunctions`shrinkInternalNodes[jTr, sep, th];

Clear[JavaTrieToJSON]
JavaTrieToJSON[jTr_?JavaObjectQ] := ImportString[jTr@toJSON[], "JSON"];

Expand Down

0 comments on commit 3057c23

Please sign in to comment.