Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Return a Venn set for the letters in two strings
ResourceFunction["StringVenn"][left, right] returns {left complement, intersection, right complement} for strings left and right. | |
ResourceFunction["StringVenn"][left, right] returns {leftcomplement,intersection,rightcomplement} for strings left and right. |
| UnsortedMultisetComplement (left) | "att" | letters in LEFT but not in RIGHT |
| MultisetIntersection | "aacehimm" | letters in both LEFT and RIGHT |
| UnsortedMultisetComplement (right) | "brd" | letters in RIGHT but not in LEFT |
Find the left complement, intersection and right complement of two strings:
| In[1]:= |
| Out[1]= |
A string union can be found by applying StringJoin to the result:
| In[2]:= |
| Out[2]= |
Words with repeated letters (multiset) can be used:
| In[3]:= |
| Out[3]= |
Verify "Sherlock Holmes" has the letters of "horseshoe":
| In[4]:= |
| Out[4]= |
Find words with letters similar to those in "Mathematica":
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Look at the Venn sets:
| In[6]:= |
| Out[6]= | ![]() |
Longer word lists can give other results:
| In[7]:= |
| Out[7]= |
Apply StringVenn to two of the longest words that don't repeat a sound character:
| In[8]:= |
| Out[8]= |
Apply StringVenn to their sound characters:
| In[9]:= |
| Out[9]= |
Verify two strings are perfect anagrams of each other:
| In[10]:= |
| Out[10]= |
Check the longest well-mixed non-deliberate anagram in Wikipedia:
| In[11]:= | ![]() |
| Out[11]= |
Find 13-letter words with letters similar to those in "daguerreotype":
| In[12]:= | ![]() |
| Out[12]= |
Check the Venn sets for the other two words:
| In[13]:= |
| Out[13]= |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License