WOLFRAM NOTEBOOK

[Do this for graphs as well]

Out[]=

String End Catalyst

Always do a string join:
In[]:=
ResourceFunction["TokenEventGraph"][{s1_,s2_}:>{StringJoin[s1,s2]},{{"A","B"}},2]
Out[]=
In[]:=
Graph[ResourceFunction["TokenEventGraph"][{s1_,s2_}:>{StringJoin[s1,s2]},{{"A","B"}},2],GraphLayout->"SpringElectricalEmbedding"]
Out[]=
In[]:=
Graph3D[ResourceFunction["TokenEventGraph"][{s1_,s2_}:>{StringJoin[s1,s2]},{{"A","B"}},3],GraphLayout->"SpringElectricalEmbedding",VertexShapeFunction->Automatic]
Out[]=

Join only if there’s an overlap

In[]:=
ResourceFunction["StringOverlaps"][{"AAB","BA"}]
Out[]=
{AABA,BAAB}
In[]:=
ResourceFunction["TokenEventGraph"][{s1_,s2_}:>ResourceFunction["StringOverlaps"][{s1,s2}],{{"A","B"}},2]
Out[]=
In[]:=
ResourceFunction["TokenEventGraph"][{s1_,s2_}:>ResourceFunction["StringOverlaps"][{s1,s2}],{{"A","AA"}},2]
Out[]=
This purely polymerizes....

How do we enumerate multi-string rules?

Could put the strings end-to-end, then a substitution system
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.