lundi 16 mars 2020

Generating random human-readable strings with Swift

Is there a way to generate random human-readable strings in Swift, perhaps using a Framework or Cocoa Pod? I am particularly interested in generating names of specific length: 2, 3 or 4 words, with similar functionality to the Python coolname package. I encountered a method for generating random names using a Markov Chain given a preexisting set of names (like n-grams); however, the coolname method would give 10^10 random name possibilities using adjectives, etc. To clarify, I am trying to avoid making HTTP requests to a random name generator API.

In other words, what would be the best way to parse, say the Webster dictionary, in such a way that I can generate random n-word strings?

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire