Pass the whole TextContentConfig as argument to text_to_jsonl methods

- Let the specific text_to_jsonl method decide which of the
  TextContentConfig fields it needs to convert <text> type to jsonl
- This simplifies extending TextContentConfig for a specific type without
  modifying all text_to_jsonl methods
- It keeps the number of args being passed to the `text_to_jsonl'
  methods in check
This commit is contained in:
Debanjum Singh Solanky
2022-09-11 10:09:17 +03:00
parent e951ba37ad
commit 52e3dd9835
4 changed files with 16 additions and 4 deletions

View File

@@ -183,7 +183,7 @@ def setup(text_to_jsonl, config: TextContentConfig, search_config: TextSearchCon
# Map notes in text files to (compressed) JSONL formatted file
config.compressed_jsonl = resolve_absolute_path(config.compressed_jsonl)
previous_entries = extract_entries(config.compressed_jsonl) if config.compressed_jsonl.exists() else None
entries_with_indices = text_to_jsonl(config.input_files, config.input_filter, config.compressed_jsonl, previous_entries)
entries_with_indices = text_to_jsonl(config, previous_entries)
# Extract Updated Entries
entries = extract_entries(config.compressed_jsonl)