
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Python binding for nlpO3, a Thai natural language processing library in Rust.
To install:
pip install nlpo3
segment()
- use maximal-matching dictionary-based tokenization algorithm
and honor Thai Character Cluster boundaries
load_dict()
- load a dictionary from a plain text file
(one word per line)Load file path/to/dict.file
to memory
and assign a name dict_name
to it.
Then tokenize a text with the dict_name
dictionary:
from nlpo3 import load_dict, segment
load_dict("path/to/dict.file", "custom_dict")
segment("สวัสดีครับ", "dict_name")
it will return a list of strings:
['สวัสดี', 'ครับ']
(result depends on words included in the dictionary)
Use multithread mode, also use the dict_name
dictionary:
segment("สวัสดีครับ", dict_name="dict_name", parallel=True)
Use safe mode to avoid long waiting time in some edge cases for text with lots of ambiguous word boundaries:
segment("สวัสดีครับ", dict_name="dict_name", safe=True)
sudo apt-get install python3-dev
Cargo.toml
python -m pip install --upgrade build
python -m build
This should generate a wheel file, in dist/
directory,
which can be installed by pip.
To install a wheel from a local directory:
pip install dist/nlpo3-1.3.1-cp311-cp311-macosx_12_0_x86_64.whl
To run a Python unit test:
cd tests
python -m unittest
Please report issues at https://github.com/PyThaiNLP/nlpo3/issues
nlpO3 Python binding is copyrighted by its authors and licensed under terms of the Apache Software License 2.0 (Apache-2.0). See file LICENSE for details.
A pre-built binary package is available from PyPI for these platforms:
Python | OS | Architecture | Has binary wheel? |
---|---|---|---|
3.13 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.12 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.11 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.10 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.9 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.8 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
3.7 | Windows | x86 | ✅ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ❌ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
musllinux | x86_64 | ✅ | |
PyPy 3.10 | Windows | x86 | ❌ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
PyPy 3.9 | Windows | x86 | ❌ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
PyPy 3.8 | Windows | x86 | ❌ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ✅ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ | |
PyPy 3.7 | Windows | x86 | ❌ |
Windows | AMD64 | ✅ | |
macOS | x86_64 | ✅ | |
macOS | arm64 | ❌ | |
manylinux | x86_64 | ✅ | |
manylinux | i686 | ✅ |
FAQs
Python binding for nlpO3 Thai language processing library in Rust
We found that nlpo3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.