| 113 | } |
| 114 | |
| 115 | bool PatternedNameGenerator::isProfane(String const& name) const { |
| 116 | auto matchNames = name.toLower().rot13().splitAny(" -"); |
| 117 | for (auto& naughtyWord : m_profanityFilter) { |
| 118 | for (auto& matchName : matchNames) { |
| 119 | auto find = matchName.find(naughtyWord); |
| 120 | if (find != NPos && (find == 0 || naughtyWord.size() + 1 >= matchName.size())) |
| 121 | return true; |
| 122 | } |
| 123 | } |
| 124 | return false; |
| 125 | } |
| 126 | |
| 127 | MarkovSource PatternedNameGenerator::makeMarkovSource(size_t prefixSize, size_t endSize, StringList sourceNames) { |
| 128 | MarkovSource newSource; |