Skip to main content

No project description provided

Project description

nori-clone Python binding

Usage

Installation

pip install nori-clone

Pre-built pip packages are only provided for x86_64 macOS and linux. But you can use nori-clone in M1 chips if you build this repo from source.

For more details, you can check nori-clone in PyPI.

Build from source

You can build pip package using Bazel.

$ bazel build //nori/python:build_pip_pkg
INFO: Analyzed target //nori/python:build_pip_pkg (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //nori/python:build_pip_pkg up-to-date:
  bazel-bin/nori/python/build_pip_pkg
...
$ ./bazel-bin/nori/python/build_pip_pkg dist
++ uname -s
++ tr A-Z a-z
...
++ date
+ echo Thu Jan 20 21:59:37 KST 2022 : '=== Output wheel file is in: ./dist'
Thu Jan 20 21:59:37 KST 2022 : === Output wheel file is in: ./dist

You can find your own wheel file in ./dist.

How to use

import nori

dictionary = nori.Dictionary()
dictionary.load_prebuilt_dictionary("./dictionary/latest-dictionary.nori")
dictionary.load_user_dictionary("./dictionary/latest-userdict.txt")
tokenizer = nori.NoriTokenizer(dictionary)

result = tokenizer.tokenize("이 프로젝트는 nori를 재작성하는 프로젝트입니다.")

for token in result.tokens:
    print(token.surface)

You can check the inferface of Python binding here(./nori/bind.pyi).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

nori_clone-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

nori_clone-1.0.0-cp310-cp310-macosx_12_0_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

nori_clone-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

nori_clone-1.0.0-cp39-cp39-macosx_12_0_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

nori_clone-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

nori_clone-1.0.0-cp38-cp38-macosx_12_0_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

nori_clone-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page