Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handling error #53

Merged
merged 5 commits into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mecab/src/mecab.h
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,8 @@ class MECAB_DLL_CLASS_EXTERN Model {
virtual const DictionaryInfo *dictionary_info() const = 0;

/**
* Return transtion cost from rcAttr to lcAttr.
* @return transtion cost
* Return transition cost from rcAttr to lcAttr.
* @return transition cost
*/
virtual int transition_cost(unsigned short rcAttr,
unsigned short lcAttr) const = 0;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ class MECAB_DLL_CLASS_EXTERN Model {
* return true if new model is swapped successfully.
* This method is thread safe. All taggers created by
* Model::createTagger() method will also be updated asynchronously.
* No need to stop the parsing thread excplicitly before swapping model object.
* No need to stop the parsing thread explicitly before swapping model object.
* @return boolean
* @param model new model which is going to be swapped with the current model.
*/
Expand Down Expand Up @@ -1159,7 +1159,7 @@ class MECAB_DLL_CLASS_EXTERN Tagger {
* This function is equivalent to
* {
* Tagger *tagger = model.createModel();
* cosnt bool result = tagger->parse(lattice);
* const bool result = tagger->parse(lattice);
* delete tagger;
* return result;
* }
Expand Down
2 changes: 2 additions & 0 deletions mecab/src/tagger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ const char *TaggerImpl::what() const {
bool TaggerImpl::open(int argc, char **argv) {
model_.reset(new ModelImpl);
if (!model_->open(argc, argv)) {
set_what(getGlobalError());
model_.reset(0);
return false;
}
Expand All @@ -467,6 +468,7 @@ bool TaggerImpl::open(int argc, char **argv) {
bool TaggerImpl::open(const char *arg) {
model_.reset(new ModelImpl);
if (!model_->open(arg)) {
set_what(getGlobalError());
model_.reset(0);
return false;
}
Expand Down