diff --git a/anansyTypes/__init__.py b/anansyTypes/__init__.py index 2a00b1d..9d7a407 100644 --- a/anansyTypes/__init__.py +++ b/anansyTypes/__init__.py @@ -26,6 +26,7 @@ __all__ = [ "PreprocessorType", "SymbolProvider", "Language", + "DiscountType", "Currency", "SubscriptionType" ] diff --git a/anansyTypes/enums.py b/anansyTypes/enums.py index bf4db58..69027d2 100644 --- a/anansyTypes/enums.py +++ b/anansyTypes/enums.py @@ -52,4 +52,8 @@ class SubscriptionType(Enum): class Currency(Enum): EUR = "EUR" USD = "USD" - NOK = "NOK" \ No newline at end of file + NOK = "NOK" + +class DiscountType(Enum): + PERCENTAGE = "percentage" + ABSOLUTE = "absolute" \ No newline at end of file diff --git a/anansyTypes/structures/phrase.py b/anansyTypes/structures/phrase.py index 08f85ee..bb4333f 100644 --- a/anansyTypes/structures/phrase.py +++ b/anansyTypes/structures/phrase.py @@ -8,25 +8,6 @@ from .embedding import Embedding import numpy as np -# class NoEmbeddingPhrase(Lexeme): -# def __init__(self, id: str, content: str,original_content: str): -# #initialised with empty embedding -# super().__init__(id=id, content=content, embedding=Embedding(data=torch.tensor([])), original_content=original_content) - -# @classmethod -# def from_dict(cls, data: dict) -> "NoEmbeddingPhrase": -# return cls( -# id=data["id"], -# content=data["content"], -# original_content=data["original_content"], -# ) -# @model_validator(mode="before") -# @classmethod -# def ignore_embedding(cls, values): -# # Remove embedding from incoming data -# values.pop("embedding", None) -# return values - class Phrase(Lexeme): @classmethod @@ -37,14 +18,3 @@ class Phrase(Lexeme): original_content=data["original_content"], embedding=Embedding.from_dict(data["embedding"]), ) - - # @classmethod - # def from_noembeddingphrase( - # cls, phrase: NoEmbeddingPhrase, embedding: Embedding - # ) -> "Phrase": - # return cls( - # id=phrase.id, - # content=phrase.content, - # original_content=phrase.original_content, - # embedding=embedding, - # )