• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PyThaiNLP / pythainlp / 7264193706

19 Dec 2023 03:47PM UTC coverage: 85.469% (+0.6%) from 84.856%
7264193706

push

github

wannaphong
PyThaiNLP v5.0.0dev1

1 of 1 new or added line in 1 file covered. (100.0%)

5 existing lines in 2 files now uncovered.

6276 of 7343 relevant lines covered (85.47%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/pythainlp/parse/esupar_engine.py
1
# -*- coding: utf-8 -*-
2
"""
1✔
3
esupar: Tokenizer, POS tagger and dependency parser with BERT/RoBERTa/DeBERTa models for Japanese and other languages
4

5
GitHub: https://github.com/KoichiYasuoka/esupar
6
"""
7
from typing import List, Union
1✔
8

9
try:
1✔
10
    import esupar
1✔
UNCOV
11
except ImportError:
×
UNCOV
12
    raise ImportError("Import Error; Install esupar by pip install esupar")
×
13

14

15
class Parse:
1✔
16
    def __init__(self, model: str = "th") -> None:
1✔
17
        if model is None:
1✔
18
            model = "th"
1✔
19
        self.nlp = esupar.load(model)
1✔
20

21
    def __call__(
1✔
22
        self, text: str, tag: str = "str"
23
    ) -> Union[List[List[str]], str]:
24
        _data = str(self.nlp(text))
1✔
25
        if tag == "list":
1✔
26
            _temp = _data.splitlines()
1✔
27
            _tag_data = []
1✔
28
            for i in _temp:
1✔
29
                _tag_data.append(i.split())
1✔
30
            return _tag_data
1✔
31
        return _data
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc