Skip to content

Commit

Permalink
Unify variable name: root_dir_or_paths -> root_dir (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratsgo committed Nov 15, 2020
1 parent 590e044 commit b32a4ef
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuMessengerKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_MESSENGER')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_MESSENGER')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_메신저_말뭉치(conversation).train', load_modu_messenger(paths))


Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_morpheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuMorphemeKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_MP')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_MP')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_형태분석_말뭉치.train', load_modu_morpheme(paths))
self.tagmap = {
'JKS': '주격조사',
Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_ne.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuNEKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_NE')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_NE')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_개체명_말뭉치.train', load_modu_ne(paths))
self.tagmap = {
'PS': 'PERSON',
Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ def __init__(self, force_download=False):


class ModuNewsKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False, load_light=True):
def __init__(self, root_dir=None, force_download=False, load_light=True):
super().__init__(force_download)
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_NEWSPAPER')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_NEWSPAPER')
paths = find_corpus_paths(root_dir)
if load_light:
self.train = ModuNewsDataLight('모두의_뉴스_말뭉치(light).train', load_modu_news(paths, load_light))
else:
Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_spoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuSpokenKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_SPOKEN')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_SPOKEN')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_구어_말뭉치.train', load_modu_spoken(paths))


Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuWebKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_WEB')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_WEB')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_웹_말뭉치.train', load_modu_web(paths))


Expand Down
8 changes: 4 additions & 4 deletions Korpora/korpus_modu_written.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


class ModuWrittenKorpus(ModuKorpus):
def __init__(self, root_dir_or_paths=None, force_download=False):
def __init__(self, root_dir=None, force_download=False):
super().__init__()
if root_dir_or_paths is None:
root_dir_or_paths = os.path.join(default_korpora_path, 'NIKL_WRITTEN')
paths = find_corpus_paths(root_dir_or_paths)
if root_dir is None:
root_dir = os.path.join(default_korpora_path, 'NIKL_WRITTEN')
paths = find_corpus_paths(root_dir)
self.train = KorpusData('모두의_문어_말뭉치.train', load_modu_written(paths))


Expand Down

0 comments on commit b32a4ef

Please sign in to comment.