If I were you I would start with a readthrough of the vignette: RJournal_6_111-122-2014.pdf (r-project.org)
focus on the stringdistmatrix option, try the examples, and adapt them to your purpose.
If you get stuck, feel free to come back for additional support.
A reprex would be desirable