From 84cd06e8e8a37d5940d06288ec74e6e5ac626599 Mon Sep 17 00:00:00 2001 From: stuartgo Date: Mon, 15 Dec 2025 14:20:54 +0100 Subject: [PATCH] redo noembeddingphrase to return an empty embedding --- anansyTypes/structures/lexeme.py | 3 ++- anansyTypes/structures/phrase.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/anansyTypes/structures/lexeme.py b/anansyTypes/structures/lexeme.py index 89ca418..cfc1852 100644 --- a/anansyTypes/structures/lexeme.py +++ b/anansyTypes/structures/lexeme.py @@ -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 diff --git a/anansyTypes/structures/phrase.py b/anansyTypes/structures/phrase.py index 488c943..de9dfe2 100644 --- a/anansyTypes/structures/phrase.py +++ b/anansyTypes/structures/phrase.py @@ -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(