kazu.krt.components¶
Functions
|
This function saves the state of the resource manager and displays success messages in the sidebar. |
|
|
Classes
This class provides static methods to manage a placeholder resource in the session state. |
|
- class kazu.krt.components.ParserSelector[source]¶
Bases:
object
- PARSER_SELECTOR = 'PARSER_SELECTOR'¶
- class kazu.krt.components.PlaceholderResource[source]¶
Bases:
object
This class provides static methods to manage a placeholder resource in the session state.
- static create_placeholder_resource(text, parser_name)[source]¶
Creates a placeholder resource with a given text and parser name, and stores it in the session state.
- PLACEHOLDER_RESOURCE = 'PLACEHOLDER_RESOURCE'¶
- class kazu.krt.components.ResourceEditor[source]¶
Bases:
object
- static display_case_sensitivity_and_confidence_selector(row, default_syn)[source]¶
Displays selectors for both case sensitivity and confidence.
Returns a tuple of the selected values.
- Parameters:
- Returns:
- Return type:
- static display_resource_editor(resources, maybe_parser_name=None, on_click_override=None, args=None)[source]¶
- static extract_form_data_from_state(parser_name, resources)[source]¶
- Parameters:
parser_name (str)
resources (Iterable[OntologyStringResource])
- Return type:
Iterable[tuple[OntologyStringResource, OntologyStringResource]]
- static submit_form_for_addition()[source]¶
Submits the form for addition of a new resource.
Extracts the placeholder resource and parser name from the session state. Then, it extracts the form data from the state and syncs the resources. Finally, it deletes the placeholder resource from the session state.
- Returns:
- Return type:
None
- ASSOCIATE_ID_SET_DF = 'ASSOCIATE_ID_SET_DF'¶
- ASSOCIATE_ID_SET_EDITOR = 'ASSOCIATE_ID_SET_EDITOR'¶
- BEHAVIOUR_SELECTOR = 'BEHAVIOUR_SELECTOR'¶
- CASE_SELECTOR = 'CASE_SELECTOR'¶
- CONFIDENCE_SELECTOR = 'CONFIDENCE_SELECTOR'¶
- kazu.krt.components.save()[source]¶
This function saves the state of the resource manager and displays success messages in the sidebar.
It creates placeholders for each message returned by the resource manager’s save method. After a delay of 2 seconds, it empties all the placeholders.
- Returns:
- Return type:
None