[+] SentiResult data class

This commit is contained in:
Azalea (on HyDEV-Daisy)
2022-04-14 20:26:26 -04:00
parent 1d72112aee
commit 20ce2711e2
+13
View File
@@ -1,4 +1,17 @@
from __future__ import annotations
from typing import NamedTuple, Iterable
__version__ = '1.0.0'
class SentiResult(NamedTuple):
positive: int
negative: int
neutral: int
def scale(self) -> int:
return self.positive - self.negative
def is_positive(self) -> bool:
return self.scale() > 0