@tknf/budoux-edge
v0.1.0
Published
BudouX on Edge environments
Downloads
1
Readme
@tknf/budoux-edge
BudouX uses jsdom
for DOM manipulation and will not work in Edge environments such as Cloudflare Workers.
This package provides budoux/edge
tuned to work in Edge environments by omitting methods that manipulate DOM.
Install
$ npm install budoux @tknf/budoux
Usage on Edge
Japanese:
import { loadDefaultJapaneseParser } from "@tknf/budoux-edge";
const parser = loadDefaultJapaneseParser();
console.log(parser.parse("今日は天気です。"));
// ['今日は', '天気です。']
Simplified Chinese:
import { loadDefaultSimplifiedChineseParser } from "@tknf/budoux-edge";
const parser = loadDefaultSimplifiedChineseParser();
console.log(parser.parse("是今天的天气。"));
// ['是', '今天', '的', '天气。']
Traditional Chinese:
import { loadDefaultTraditionalChineseParser } from "@tknf/budoux-edge";
const parser = loadDefaultTraditionalChineseParser();
console.log(parser.parse("是今天的天氣。"));
// ['是', '今天', '的', '天氣。']
Copyright
Copyright (c) 2023 TKNF LLC. See LICENSE.md ofr further details.