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, *filenames, **kwargs):
encoding = kwargs.get("encoding", ENCODING)
super(CantoneseCHATReader, self).__init__(
*filenames, encoding=encoding
)
def hkcancor():
"""
Create the corpus object for the Hong Kong Cantonese Corpus.
"""
data_path = os.path.join(
os.path.dirname(__file__), "data", "hkcancor", "*.cha"
)
return CantoneseCHATReader(data_path, encoding="utf8")
def read_chat(*filenames, **kwargs):
"""
Create a corpus object based on *filenames*.
:param filenames: one or multiple filenames (absolute-path or relative to
the current directory; with or without glob matching patterns)
:param kwargs: Keyword arguments. Currently, only ``encoding`` is
recognized, which defaults to 'utf8'.
"""
encoding = kwargs.get("encoding", ENCODING)
return CantoneseCHATReader(*filenames, encoding=encoding)