Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, filename=None, lang=None, left=2, right=2, cache=True):
"""Create an hyphenation instance for given lang or filename.
:param filename: filename of hyph_*.dic to read
:param lang: lang of the included dict to use if no filename is given
:param left: minimum number of characters of the first syllabe
:param right: minimum number of characters of the last syllabe
:param cache: if ``True``, use cached copy of the hyphenation patterns
"""
if not filename:
filename = LANGUAGES[language_fallback(lang)]
self.left = left
self.right = right
if not cache or filename not in hdcache:
hdcache[filename] = HyphDict(filename)
self.hd = hdcache[filename]