Skip to content

Commit

Permalink
Merge pull request #18 from vunb/dev-dtype
Browse files Browse the repository at this point in the history
Dev dtype
  • Loading branch information
vunb authored Mar 7, 2020
2 parents c11c811 + 17a29a7 commit b0a8c49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ console.log('Tags: ', tags)
```js
const path = require('path')
const crfsuite = require('crfsuite')
const trainer = new crfsuite.Trainer()
const trainer = new crfsuite.Trainer({
debug: true
})

let model_filename = path.resolve('./model.crfsuite')

Expand Down
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ export interface Options {
[key: string]: string;
}

export interface TrainerOptions {
[key: string]: any;
debug?: boolean;
}

export interface TrainerCallback {
(str: string): void;
}

export declare class Trainer {
constructor(opts?: TrainerOptions);
append(xseq: Array<string[]>, yseq: string[]): void;
train(model_filename: string): number;
get_params(options: Options): any;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crfsuite",
"version": "1.0.0",
"version": "1.0.1",
"description": "NodeJS binding for CRFsuite",
"main": "index.js",
"types": "index.d.ts",
Expand Down
4 changes: 3 additions & 1 deletion test/specs/trainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const path = require('path');
const test = require('tape');
const crfsuite = require('../..');

const trainer = new crfsuite.Trainer();
const trainer = new crfsuite.Trainer({
debug: false,
});


test('crfsuite trainer', function (t) {
Expand Down

0 comments on commit b0a8c49

Please sign in to comment.