Skip to content

Commit c33c6f0

Browse files
committed
v0.1dev3
1 parent 344c097 commit c33c6f0

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Work in processing...
55

66
## Install
77

8-
> pip install https://github.com/PyThaiNLP/spaCy-PyThaiNLP/archive/refs/heads/main.zip
8+
> pip install spacy-pythainlp
99
1010
## How to use
1111

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
setup(
1313
name="spacy-pythainlp",
14-
version="0.1dev2",
14+
version="0.1dev3",
1515
description="PyThaiNLP For spaCy",
1616
long_description=readme,
1717
long_description_content_type="text/markdown",

spacy_pythainlp/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from pythainlp.tag import pos_tag
2-
from pythainlp.tag import NER
32
from pythainlp.tokenize import (
4-
sent_tokenize,
53
word_tokenize,
64
DEFAULT_SENT_TOKENIZE_ENGINE,
75
DEFAULT_WORD_TOKENIZE_ENGINE
@@ -63,6 +61,7 @@ def __init__(
6361
self.on_tokenize = tokenize
6462
self.pos_corpus = pos_corpus
6563
if self.on_ner:
64+
from pythainlp.tag import NER
6665
self.ner = NER(engine=DEFAULT_NER)
6766

6867
def __call__(self, doc:Doc):
@@ -96,6 +95,7 @@ def _pos(self,doc:Doc):
9695
return doc
9796

9897
def _sent(self, doc:Doc):
98+
from pythainlp.tokenize import sent_tokenize
9999
_text = sent_tokenize(str(doc.text), engine=self.sent_engine)
100100
_doc = word_tokenize('SplitThword'.join(_text), engine=self.tokenize_engine)
101101
number_skip = 0

0 commit comments

Comments
 (0)