返回介绍

BackgroundTokenizer

发布于 2019-12-03 22:45:18 字数 6962 浏览 1090 评论 0 收藏 0

Tokenizes the current Document in the background, and caches the tokenized rows for future use.

If a certain row is changed, everything below that row is re-tokenized.

Constructors

new BackgroundTokenizer(Tokenizer tokenizer, Editor editor)

Creates a new BackgroundTokenizer object.

tokenizerTokenizerRequired. The tokenizer to use
editorEditorRequired. The editor to associate with

Events

BackgroundTokenizer.on("update", function(Object e))

Fires whenever the background tokeniziers between a range of rows are going to be updated.

eObjectRequired. An object containing two properties, first and last, which indicate the rows of the region being updated.

Methods

BackgroundTokenizer.fireUpdateEvent(Number firstRow, Number lastRow)

Emits the 'update' event. firstRow and lastRow are used to define the boundaries of the region to be updated.

firstRowNumberRequired. The starting row region
lastRowNumberRequired. The final row region

BackgroundTokenizer.getState(Number row)

Returns the state of tokenization at the end of a row.

rowNumberRequired. The row to get state at

BackgroundTokenizer.getTokens(Number row)

Gives list of tokens of the row. (tokens are cached)

rowNumberRequired. The row to get tokens at

BackgroundTokenizer.setDocument(Document doc)

Sets a new document to associate with this object.

docDocumentRequired. The new document to associate with

BackgroundTokenizer.setTokenizer(Tokenizer tokenizer)

Sets a new tokenizer for this object.

tokenizerTokenizerRequired. The new tokenizer to use

BackgroundTokenizer.start(Number startRow)

Starts tokenizing at the row indicated.

startRowNumberRequired. The row to start at

BackgroundTokenizer.stop()

Stops tokenizing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文