redo noembeddingphrase to return an empty embedding

This commit is contained in:
stuart committed 2025-12-15 14:20:54 +01:00
1 parent 6d6ba89354
commit 84cd06e8e8
2 files changed
+7 -1

No files matched your search

+2 -1
View File
@@ -15,9 +15,10 @@ class Lexeme(ABC):
pass
@property
@abstractmethod
def embedding(self) -> Embedding:
"""Embedding(s) associated with the lexeme."""
raise NotImplementedError("Embeddings are not supported") #added to allow for NoEmbeddingPhrase
pass
@classmethod
@abstractmethod
+5
View File
@@ -35,6 +35,11 @@ class NoEmbeddingPhrase(Lexeme):
@property
def content(self) -> str:
return self._content
@property
def embedding(self) -> Embedding:
return self._embedding
@classmethod
def from_dict(cls, data: dict) -> "Phrase":
return cls(