Skip to content

QS: Output Schema#972

Closed
ooprathamm wants to merge 7 commits intomandiant:quantumstrandfrom
ooprathamm:output
Closed

QS: Output Schema#972
ooprathamm wants to merge 7 commits intomandiant:quantumstrandfrom
ooprathamm:output

Conversation

@ooprathamm
Copy link
Copy Markdown
Contributor

@ooprathamm ooprathamm commented Mar 14, 2024

Closes #721

@ooprathamm
Copy link
Copy Markdown
Contributor Author

ooprathamm commented Mar 14, 2024

  • ResultDocument could act as output scheme, that is used by render_strings() or to dump json

  • For Merging the database keys (Idea for discussion):
    • Migrate Databases from struct to pydantic model

    • Sequence of Database objects in TaggedStrings populated by taggers

       Database = Union[ StringGlobalPrevalenceDatabase, OpenSourceStringDatabase....]

       class TaggedString:
           metadb: Sequence[Database]

Make query_fn used by tagger return tag and instance

def query_fn(db: Database, string: str) -> Tuple[Sequence[str], Sequence[Database]]:
    if db.query(string):
        return ("#tag",), [db.query]
    return (), []

In tag_strings update tag and instance

            for tagger in taggers:
                tags, db = tagger(string.string)
                tags.update(tags)
                db_keys.extend(db)

@ooprathamm ooprathamm marked this pull request as draft March 15, 2024 07:53
@mr-tz
Copy link
Copy Markdown
Collaborator

mr-tz commented Mar 16, 2024

ResultDocument could act as output scheme, that is used by render_strings() or to dump json

That should be the goal; to have one data source used by various output modes.

Migrate Databases from struct to pydantic model

Any formalization like that would be great.

@ooprathamm ooprathamm marked this pull request as ready for review March 17, 2024 08:36
@ooprathamm ooprathamm marked this pull request as draft March 17, 2024 18:17
@ooprathamm ooprathamm marked this pull request as ready for review March 18, 2024 05:59
@mr-tz
Copy link
Copy Markdown
Collaborator

mr-tz commented Mar 19, 2024

Thanks, will review this in the upcoming days.

@mr-tz
Copy link
Copy Markdown
Collaborator

mr-tz commented Aug 29, 2025

closed via #1146

@mr-tz mr-tz closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants