From 7cc277bd4b1e38ca289af8d2b6a9adaf68ac8f13 Mon Sep 17 00:00:00 2001 From: lovit Date: Sat, 10 Oct 2020 16:15:50 +0900 Subject: [PATCH] Raise exception when corpus file is not found (#103, #111) --- Korpora/korpus_modu_messenger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Korpora/korpus_modu_messenger.py b/Korpora/korpus_modu_messenger.py index 0d07fd1..e9cc806 100644 --- a/Korpora/korpus_modu_messenger.py +++ b/Korpora/korpus_modu_messenger.py @@ -35,6 +35,8 @@ def __init__(self, root_dir_or_paths, force_download=False): paths = sorted(glob(root_dir_or_paths)) else: paths = root_dir_or_paths + if not paths: + raise ValueError('Not found corpus files. Check `root_dir_or_paths`') self.train = KorpusData('모두의_메신저_말뭉치(conversation).train', load_modu_messenger(paths))