You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to specify a custom format string even if the user has an output-format-type specified in their mecabrc. As described in taku910/mecab#41, the way to do this on the command line is to give an argument like -O "". So I tried this:
tagger = MeCab.Tagger('-O ""')
Unfortunately this results in a RuntimeError. I tried escaping the quotes without effect. I guess something about the way the argument string is passed to the Mecab library is different than its own internal argument handling?
For reference, the reason I want to specify a format string is explained in explosion/spaCy#3491.
The text was updated successfully, but these errors were encountered:
Unfortunately, the SWIG interface definition file that we use only exposes the C++-level Tagger constructor that takes a single string containing command-line options. That constructor doesn't implement any shell quotation syntax; it blindly splits its input on whitespace. It is therefore not possible to set the -O option's argument to the empty string using this constructor.
There is another constructor that takes an array of command-line options. If we exposed that constructor, you could write something like
tagger = MeCab.Tagger(["-O", ""])
and it would work. Unfortunately, I do not understand SWIG well enough to know how to make that change. If you can figure it out I would be glad to merge your patch. (Please note that both the Tagger and Model classes should be changed.)
I would like to specify a custom format string even if the user has an
output-format-type
specified in theirmecabrc
. As described in taku910/mecab#41, the way to do this on the command line is to give an argument like-O ""
. So I tried this:Unfortunately this results in a
RuntimeError
. I tried escaping the quotes without effect. I guess something about the way the argument string is passed to the Mecab library is different than its own internal argument handling?For reference, the reason I want to specify a format string is explained in explosion/spaCy#3491.
The text was updated successfully, but these errors were encountered: