Skip to content

Commit

Permalink
dep(plugin-nlp): nodejiaba 2.4.0 -> 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Mar 11, 2020
1 parent e2350d0 commit 052cddb
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions packages/plugin-nlp/src/index.ts
Original file line number Diff line number Diff line change
@@ -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' {
Expand All @@ -21,25 +21,13 @@ export interface Intension extends Partial<ParsedLine> {

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
}

Expand Down

0 comments on commit 052cddb

Please sign in to comment.