Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

TriesWithFrequencies

Guides

  • Tries with frequencies

Tech Notes

  • English words infixes study
  • Using Tries for Markov chain text generation

Symbols

  • ToTrieFromJSON
  • ToTrieWithRoot
  • TrieBlank
  • TrieBodyQ
  • TrieClassify
  • TrieComparisonGrid
  • TrieContains
  • TrieCreateBySplit
  • TrieCreate
  • TrieDepth
  • TrieForm
  • TrieGetWords
  • TrieHasCompleteMatchQ
  • TrieInsert
  • TrieKeyExistsQ
  • TrieKeyQ
  • TrieKeyTraverse
  • TrieKeyValueTraverse
  • TrieLeafProbabilities
  • TrieLeafProbabilitiesWithPositions
  • TrieMap
  • TrieMemberQ
  • TrieMerge
  • TrieNodeCounts
  • TrieNodeFrequencies
  • TrieNodeProbabilities
  • TrieParetoFractionRemove
  • TriePathFromPosition
  • TriePosition
  • TriePrune
  • TrieQ
  • TrieRandomChoice
  • TrieRemove
  • TrieRetrieve
  • TrieRootToLeafPathProbabilityRules
  • TrieRootToLeafPathRules
  • TrieRootToLeafPaths
  • TrieRuleQ
  • TrieShrink
  • TrieSubTrie
  • TrieThresholdRemove
  • TrieToJSON
  • TrieToListTrie
  • TrieToRules
  • TrieValueRuleQ
  • TrieValueTotal
  • TrieWithTrieRootQ
  • $TrieRoot
  • $TrieValue
AntonAntonov`TriesWithFrequencies`
TrieShrink
​
TrieShrink
[tr_?
TrieQ
]
shrinks the leaves and internal nodes of the trie tr into prefixes.
​
​
TrieShrink
[tr_?
TrieQ
,sep_String]
does the shrinking of string nodes with the string separator sep.
​
Examples  
(1)
Basic Examples  
(1)
Here is a trie:
In[1]:=
tr=​​
TrieCreateBySplit
@​​Flatten@​​{"war","ward","warden","work","car","cars","carbs"};​​
TrieForm
[tr]
Out[1]=
Here is the shrunk version of the trie above:
In[2]:=
TrieForm

TrieShrink
[tr]
Out[2]=
Here the shrunk trie has a specified separator between the characters:
In[3]:=
TrieForm

TrieShrink
[tr,"~"]
Out[3]=
SeeAlso
TrieCreate
 
▪
TrieCreateBySplit
 
▪
TrieForm
RelatedGuides
▪
Tries with frequencies
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com