I don't know of any functions in PHP that do this (but there may be some). If you have a limited set of clusters, you may just want to create a function (or class) that parses the text for specific words, and creates associations accordingly. For example...if you are matching on the word Car, you may have a list that includes Automobile, Motorcycle, Ford, Toyota etc... That way anytime one of the words associated with Car is found, you can create the relationship.