Skip to content

Commit

Permalink
fix: fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
hexenq committed Jun 23, 2018
1 parent d9bd7af commit 6581c5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuroshiro-analyzer-seed",
"version": "0.5.0",
"version": "0.5.1",
"description": "seed/example for building morphological analyzer",
"main": "lib/index.js",
"module": "src/index.js",
Expand Down
18 changes: 11 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ class Analyzer {
// Initialize the analyzer
// ...
// When finished, set new analyzer and call resolve
this._analyzer = "newAnalyzer";
this._analyzer = {
analyze: () => [{
surface_form: "黒白",
reading: "クロシロ"
}]
};
resolve();
} else {
}
else {
reject(new Error("This analyzer has already been initialized."));
}
});
Expand Down Expand Up @@ -62,12 +68,10 @@ class Analyzer {
return new Promise((resolve, reject) => {
// Parse the input string
// ...
resolve([{
surface_form: '黒白',
reading: 'クロシロ'
}]);
const result = this._analyzer.analyze();
resolve(result);
});
}
}

export default Analyzer;
export default Analyzer;

0 comments on commit 6581c5c

Please sign in to comment.