Fix missing custom_options in other parser constructors

This commit is contained in:
Martin Tan 2023-09-10 17:00:43 +08:00
parent ce093567d6
commit 32343df22e
3 changed files with 3 additions and 3 deletions

View File

@ -322,7 +322,7 @@ class DocumentParser(LoggingMixin):
def extract_metadata(self, document_path, mime_type):
return []
def parse(self, document_path, mime_type, file_name=None):
def parse(self, document_path, mime_type, file_name=None, custom_options=None):
raise NotImplementedError
def get_archive_path(self):

View File

@ -35,6 +35,6 @@ class TextDocumentParser(DocumentParser):
return out_path
def parse(self, document_path, mime_type, file_name=None):
def parse(self, document_path, mime_type, file_name=None, custom_options=None):
with open(document_path) as f:
self.text = f.read()

View File

@ -53,7 +53,7 @@ class TikaDocumentParser(DocumentParser):
for key in parsed["metadata"]
]
def parse(self, document_path: Path, mime_type, file_name=None):
def parse(self, document_path: Path, mime_type, file_name=None, custom_options=None):
self.log("info", f"Sending {document_path} to Tika server")
tika_server = settings.TIKA_ENDPOINT