Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def printOutMatches(matchStr, numSyllables=None, wordInitial='ok',
wordFinal='ok', spanSyllable='ok',
stressedSyllable='ok', multiword='ok',
numMatches=None, matchList=None, pos=None):
'''Helper function to run searches and output results'''
if matchList is None:
matchList = isleDict.search(matchStr, numSyllables, wordInitial,
wordFinal, spanSyllable,
stressedSyllable, multiword, pos)
else:
matchList = isletool.search(matchList, matchStr, numSyllables,
wordInitial, wordFinal, spanSyllable,
stressedSyllable, multiword, pos)
if numMatches is not None and len(matchList) > numMatches:
random.shuffle(matchList)
for i, matchTuple in enumerate(matchList):
if numMatches is not None and i > numMatches:
break
word, pronList = matchTuple
pronList = ["%s(%s)" % (tmpWord, ",".join(posInfo))
for tmpWord, posInfo in pronList]
print("%s: %s" % (word, ",".join(pronList)))
print("")
return matchList