added original content to word
This commit is contained in:
1 parent
57f30b04c1
commit
b05b30e450
1 file changed
+6
-1
@@ -5,9 +5,10 @@ from pydantic_core import core_schema
|
||||
|
||||
|
||||
class Word(Lexeme):
|
||||
def __init__(self, word_id: int, content: str, embedding: Embedding):
|
||||
def __init__(self, word_id: int, content: str,original_content: str, embedding: Embedding):
|
||||
self.id = word_id
|
||||
self._content = content
|
||||
self._original_content = original_content
|
||||
self._embedding = embedding
|
||||
|
||||
@property
|
||||
@@ -15,6 +16,9 @@ class Word(Lexeme):
|
||||
return self._content
|
||||
|
||||
@property
|
||||
def original_content(self) -> str:
|
||||
return self._original_content
|
||||
@property
|
||||
def embedding(self) -> Embedding:
|
||||
return self._embedding
|
||||
|
||||
@@ -30,4 +34,5 @@ class Word(Lexeme):
|
||||
word_id=data["id"],
|
||||
content=data["content"],
|
||||
embedding=Embedding.from_dict(data["embedding"]),
|
||||
original_content=data["original_content"],
|
||||
)
|
||||
Reference in new issue
Block a user