From 052cddb5c285157800a7771062e32384813a183e Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Wed, 11 Mar 2020 23:23:59 +0800 Subject: [PATCH] dep(plugin-nlp): nodejiaba 2.4.0 -> 2.4.1 --- packages/plugin-nlp/src/index.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/plugin-nlp/src/index.ts b/packages/plugin-nlp/src/index.ts index 562254127a..162b46ca01 100644 --- a/packages/plugin-nlp/src/index.ts +++ b/packages/plugin-nlp/src/index.ts @@ -1,5 +1,5 @@ import { Command, Meta, Context, ParsedLine, ParsedCommandLine } from 'koishi-core' -import { tag, load } from 'nodejieba' +import { tag, load, TagResult, LoadOptions } from 'nodejieba' import { resolve } from 'path' declare module 'koishi-core/dist/command' { @@ -21,25 +21,13 @@ export interface Intension extends Partial { export type IntenderCallback = (meta: Meta, keyword: string) => Intension -// TODO: pending nodejieba typings -interface TagResult { - word: string - tag: string -} - export interface Intender { command: Command keywords: string[] callback: IntenderCallback } -export interface NlpConfig { - // TODO: pending nodejieba typings - dict?: string - hmmDict?: string - userDict?: string - idfDict?: string - stopWordDict?: string +export interface NlpConfig extends LoadOptions { threshold?: number }