MCPcopy Create free account
hub / github.com/SamuraiT/mecab-python3 / Model

Class Model

src/MeCab/__init__.py:142–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141
142class Model(_MeCab.Model):
143 def __init__(self, rawargs="", error_check=False):
144 # Note this is the same as the code for the Tagger.
145 unidicdir = try_import_unidic()
146 args = rawargs
147 if unidicdir:
148 mecabrc = os.path.join(unidicdir, 'mecabrc')
149 args = '-r "{}" -d "{}" '.format(mecabrc, unidicdir) + args
150 args = ['', '-C'] + shlex.split(args)
151 args = [x.encode('utf-8') for x in args]
152
153 try:
154 super(Model, self).__init__(args)
155 except RuntimeError as ee:
156 if not error_check:
157 raise RuntimeError(error_info(rawargs)) from ee
158 else:
159 raise
160
161
162__all__.append("Model")

Callers 1

get_error_detailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected