Skip to content

Commit

Permalink
Merge pull request #349 from PyThaiNLP/fix-ner-tag-2-1
Browse files Browse the repository at this point in the history
Back port ner fix to 2.1 (update to 2.1.2)
  • Loading branch information
wannaphong authored Dec 31, 2019
2 parents 8369a21 + dee415e commit c3f223c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Thai Natural Language Processing in Python.

PyThaiNLP is a Python package for text processing and linguistic analysis, similar to `nltk` but with focus on Thai language.

- This is [2.1.1 stable release](https://github.com/PyThaiNLP/pythainlp/releases). See [change log](https://github.com/PyThaiNLP/pythainlp/issues/181).
- This is [2.1.2 stable release](https://github.com/PyThaiNLP/pythainlp/releases). See [change log](https://github.com/PyThaiNLP/pythainlp/issues/181).
- For latest development, see [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) branch.
- 📫 follow our [PyThaiNLP](https://www.facebook.com/pythainlp/) Facebook page

Expand Down Expand Up @@ -119,7 +119,7 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนเพื่

> เพราะโลกขับเคลื่อนต่อไปด้วยการแบ่งปัน
- รุ่นนี้คือรุ่นเสถียร [2.1.1](https://github.com/PyThaiNLP/pythainlp/releases) ดูความเปลี่ยนแปลงในรุ่นนี้ที่ [2.1 change log](https://github.com/PyThaiNLP/pythainlp/issues/181).
- รุ่นนี้คือรุ่นเสถียร [2.1.2(https://github.com/PyThaiNLP/pythainlp/releases) ดูความเปลี่ยนแปลงในรุ่นนี้ที่ [2.1 change log](https://github.com/PyThaiNLP/pythainlp/issues/181).
- สำหรับรุ่นที่กำลังพัฒนา ดูใน [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) branch
- PyThaiNLP 2.1 รองรับ Python 3.6 ขึ้นไป ผู้ใช้ Python 2.7+ ยังสามารถใช้ PyThaiNLP 1.6 ได้
- 📫 ติดตามข่าวสารได้ที่ Facebook [PyThaiNLP](https://www.facebook.com/pythainlp/)
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "2.1.1"
__version__ = "2.1.2"

thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars
thai_vowels = "ฤฦะ\u0e31าำ\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39เแโใไ\u0e45\u0e47" # 19
Expand Down
6 changes: 5 additions & 1 deletion pythainlp/tag/named_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ def get_ner(
self.temp = ""
self.sent = ""
for idx, (word, ner) in enumerate(self.sent_ner):
if "B-" in ner:
if "B-" in ner and self.temp != "":
self.sent += "</"+self.temp+">"
self.temp = ner.replace("B-", "")
self.sent += "<"+self.temp+">"
elif "B-" in ner:
self.temp = ner.replace("B-", "")
self.sent += "<"+self.temp+">"
elif "O" == ner and self.temp != "":
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.1.1
current_version = 2.1.2
commit = True
tag = True

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

setup(
name="pythainlp",
version="2.1.1",
version="2.1.2",
description="Thai Natural Language Processing library",
long_description=readme,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c3f223c

Please sign in to comment.