Socket
Socket
Sign inDemoInstall

nlpo3

Package Overview
Dependencies
0
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nlpo3

Node.js binding for nlpO3 Thai language processing library


Version published
Weekly downloads
0
Maintainers
2
Created
Weekly downloads
 

Readme

Source

npmjs License

nlpO3 Node.js binding

Node.js binding for nlpO3, a Thai natural language processing library in Rust.

Features

  • Thai word tokenizer
    • use maximal-matching dictionary-based tokenization algorithm and honor Thai Character Cluster boundaries
    • fast backend in Rust
    • support custom dictionary

Build

Requirements

Steps

# In this directory
npm run release

Before build, your nlpo3/ directory should look like this:

- nlpo3/
    - index.ts
    - rust_mod.d.ts

After build:

- nlpo3/
    - index.js
    - index.ts
    - rust_mod.d.ts
    - rust_mode.node

Install

For now, copy the whole nlpo3/ directory after build to your project.

npm (experitmental)

npm is still experimental and may not work on all platforms. Please report issues at https://github.com/PyThaiNLP/nlpo3/issues

npm i nlpo3

Usage

In JavaScript:

const nlpO3 = require(`${path_to_nlpo3}`)

// load dictionary and tokenize a text with it
nlpO3.loadDict("path/to/dict.file", "dict_name")
nloO3.segment("สวัสดีครับ", "dict_name")

In TypeScript:

import {segment, loadDict} from `${path_to_nlpo3}/index`

// load custom dictionary and tokenize a text with it
loadDict("path/to/dict.file", "dict_name")
segment("สวัสดีครับ", "dict_name")

Issues

Please report issues at https://github.com/PyThaiNLP/nlpo3/issues

TODO

  • Find a way to build binaries and publish on npm.

Keywords

FAQs

Last updated on 24 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc