Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected Optional _POSTAG

_POSTAG: POSTAG

Protected _TABLE

_TABLE: IDICT<IWord>

Optional inited

inited: boolean

name

name: string = "ChsNameTokenizer"

Optional priority

priority: number

segment

segment: Segment

type

type: "tokenizer" = "tokenizer"

Static type

type: "tokenizer" = "tokenizer"

Methods

_cache

  • _cache(): void

Protected _splitUnknow

  • _splitUnknow<T, U>(words: T[], fn: function): U[]

Protected _splitUnset

  • _splitUnset<T, U>(words: T[], fn: function): U[]

Protected createToken

  • createToken<T, U>(data: T, skipCheck?: boolean, attr?: U & IWordDebugInfo): T

Protected debugToken

  • debugToken<T, U>(data: T, attr?: U & IWordDebugInfo, returnToken?: true, ...argv: any[]): T

init

  • init(segment: Segment, ...argv: any[]): this

matchName

  • matchName(text: string, cur?: number): IWord[]
  • 匹配包含的人名,并返回相关信息

    Parameters

    • text: string

      文本

    • Default value cur: number = 0

      开始位置

    Returns IWord[]

    返回格式 {w: '人名', c: 开始位置}

Protected sliceToken

  • sliceToken<T>(words: T[], pos: number, len: number, data: T, skipCheck?: boolean): T[]

split

Static Protected _init

Static init

  • init<T>(segment: Segment, ...argv: any[]): T

Generated using TypeDoc