[+] Get paths from pkg_resources
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import NamedTuple, Iterable
|
||||
|
||||
import pkg_resources
|
||||
|
||||
__version__ = '1.0.0'
|
||||
|
||||
|
||||
@@ -15,3 +18,9 @@ class SentiResult(NamedTuple):
|
||||
def is_positive(self) -> bool:
|
||||
return self.scale() > 0
|
||||
|
||||
|
||||
def _paths() -> tuple[str, str]:
|
||||
jar = pkg_resources.resource_filename(__name__, 'original/SentiStrength.jar')
|
||||
data = pkg_resources.resource_filename(__name__, 'original/data') + '/'
|
||||
return jar, data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user