Skip to content

Commit

Permalink
v0.1dev3
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Dec 30, 2022
1 parent 344c097 commit c33c6f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Work in processing...

## Install

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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="spacy-pythainlp",
version="0.1dev2",
version="0.1dev3",
description="PyThaiNLP For spaCy",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down
4 changes: 2 additions & 2 deletions spacy_pythainlp/core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from pythainlp.tag import pos_tag
from pythainlp.tag import NER
from pythainlp.tokenize import (
sent_tokenize,
word_tokenize,
DEFAULT_SENT_TOKENIZE_ENGINE,
DEFAULT_WORD_TOKENIZE_ENGINE
Expand Down Expand Up @@ -63,6 +61,7 @@ def __init__(
self.on_tokenize = tokenize
self.pos_corpus = pos_corpus
if self.on_ner:
from pythainlp.tag import NER
self.ner = NER(engine=DEFAULT_NER)

def __call__(self, doc:Doc):
Expand Down Expand Up @@ -96,6 +95,7 @@ def _pos(self,doc:Doc):
return doc

def _sent(self, doc:Doc):
from pythainlp.tokenize import sent_tokenize
_text = sent_tokenize(str(doc.text), engine=self.sent_engine)
_doc = word_tokenize('SplitThword'.join(_text), engine=self.tokenize_engine)
number_skip = 0
Expand Down

0 comments on commit c33c6f0

Please sign in to comment.