Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.puncnorm = PuncNorm()
self.ft = panphon.FeatureTable()
self.num_panphon_fts = len(self.ft.names)
self.preprocessor = PrePostProcessor(code, 'pre', False)
self.postprocessor = PrePostProcessor(code, 'post', False)
self.strip_diacritics = StripDiacritics(code)
self.preproc = preproc
self.postproc = postproc
self.ligatures = ligatures
self.rev_preproc = rev_preproc
self.rev_postproc = rev_postproc
if rev:
self.rev_g2p = self._load_g2p_map(code, True)
self.rev_regexp = self._construct_regex(self.rev_g2p.keys())
self.rev_preprocessor = PrePostProcessor(code, 'pre', True)
self.rev_postprocessor = PrePostProcessor(code, 'post', True)
self.nils = defaultdict(int)
self.regexp = self._construct_regex(self.g2p.keys())
self.puncnorm = PuncNorm()
self.ft = panphon.FeatureTable()
self.num_panphon_fts = len(self.ft.names)
self.preprocessor = PrePostProcessor(code, 'pre', False)
self.postprocessor = PrePostProcessor(code, 'post', False)
self.strip_diacritics = StripDiacritics(code)
self.preproc = preproc
self.postproc = postproc
self.ligatures = ligatures
self.rev_preproc = rev_preproc
self.rev_postproc = rev_postproc
if rev:
self.rev_g2p = self._load_g2p_map(code, True)
self.rev_regexp = self._construct_regex(self.rev_g2p.keys())
self.rev_preprocessor = PrePostProcessor(code, 'pre', True)
self.rev_postprocessor = PrePostProcessor(code, 'post', True)
self.nils = defaultdict(int)
code (str): ISO 639-3 code and ISO 15924 code joined with a hyphen
preproc (bool): if True, apply preprocessor
postproc (bool): if True, apply postprocessors
ligatures (bool): if True, use phonetic ligatures for affricates
instead of standard IPA
rev (bool): if True, load reverse transliteration
rev_preproc (bool): if True, apply preprocessor when reverse transliterating
rev_postproc (bool): if True, apply postprocessor when reverse transliterating
"""
self.rev = rev
self.g2p = self._load_g2p_map(code, False)
self.regexp = self._construct_regex(self.g2p.keys())
self.puncnorm = PuncNorm()
self.ft = panphon.FeatureTable()
self.num_panphon_fts = len(self.ft.names)
self.preprocessor = PrePostProcessor(code, 'pre', False)
self.postprocessor = PrePostProcessor(code, 'post', False)
self.strip_diacritics = StripDiacritics(code)
self.preproc = preproc
self.postproc = postproc
self.ligatures = ligatures
self.rev_preproc = rev_preproc
self.rev_postproc = rev_postproc
if rev:
self.rev_g2p = self._load_g2p_map(code, True)
self.rev_regexp = self._construct_regex(self.rev_g2p.keys())
self.rev_preprocessor = PrePostProcessor(code, 'pre', True)
self.rev_postprocessor = PrePostProcessor(code, 'post', True)
self.nils = defaultdict(int)
preproc (bool): if True, apply preprocessor
postproc (bool): if True, apply postprocessors
ligatures (bool): if True, use phonetic ligatures for affricates
instead of standard IPA
rev (bool): if True, load reverse transliteration
rev_preproc (bool): if True, apply preprocessor when reverse transliterating
rev_postproc (bool): if True, apply postprocessor when reverse transliterating
"""
self.rev = rev
self.g2p = self._load_g2p_map(code, False)
self.regexp = self._construct_regex(self.g2p.keys())
self.puncnorm = PuncNorm()
self.ft = panphon.FeatureTable()
self.num_panphon_fts = len(self.ft.names)
self.preprocessor = PrePostProcessor(code, 'pre', False)
self.postprocessor = PrePostProcessor(code, 'post', False)
self.strip_diacritics = StripDiacritics(code)
self.preproc = preproc
self.postproc = postproc
self.ligatures = ligatures
self.rev_preproc = rev_preproc
self.rev_postproc = rev_postproc
if rev:
self.rev_g2p = self._load_g2p_map(code, True)
self.rev_regexp = self._construct_regex(self.rev_g2p.keys())
self.rev_preprocessor = PrePostProcessor(code, 'pre', True)
self.rev_postprocessor = PrePostProcessor(code, 'post', True)
self.nils = defaultdict(int)