Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setOutputSimplifiedChinese(self, outputSimpChinese):
self.outputSimpChinese = outputSimpChinese
# 建立 OpenCC instance 用來做繁簡體中文轉換
if outputSimpChinese:
if not self.opencc:
self.opencc = opencc.OpenCC(opencc.OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP)
else:
self.opencc = None
def setOutputSimplifiedChinese(self, CinBaseTextService, outputSimpChinese):
CinBaseTextService.outputSimpChinese = outputSimpChinese
# 建立 OpenCC instance 用來做繁簡體中文轉換
if outputSimpChinese:
if not CinBaseTextService.opencc:
CinBaseTextService.opencc = opencc.OpenCC(opencc.OPENCC_DEFAULT_CONFIG_TRAD_TO_SIMP)
else:
CinBaseTextService.opencc = None