MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / isProfane

Method isProfane

source/game/StarNameGenerator.cpp:115–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115bool 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
127MarkovSource PatternedNameGenerator::makeMarkovSource(size_t prefixSize, size_t endSize, StringList sourceNames) {
128 MarkovSource newSource;

Callers

nothing calls this directly

Calls 5

splitAnyMethod · 0.80
rot13Method · 0.80
toLowerMethod · 0.80
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected