idearium
¶
Idearium
¶
Bases: BaseModel
A collection of [Notions][silverlingua.core.molecules.notion.Notion] that is automatically trimmed to fit within a maximum
number of tokens.
Source code in src/SilverLingua/core/organisms/idearium.py
tokenized_notions
class-attribute
instance-attribute
¶
persistent_indices
class-attribute
instance-attribute
¶
_non_persistent_indices
property
¶
_non_persistent_indices: set
The indices of non-persistent notions.
validate_notions
¶
validate_notion
classmethod
¶
Source code in src/SilverLingua/core/organisms/idearium.py
index
¶
append
¶
append(notion: Notion)
Appends the given notion to the end of the Idearium.
Source code in src/SilverLingua/core/organisms/idearium.py
extend
¶
Extends the Idearium with the given list of notions.
Source code in src/SilverLingua/core/organisms/idearium.py
insert
¶
Inserts the given notion at the given index.
Source code in src/SilverLingua/core/organisms/idearium.py
pop
¶
Removes and returns the notion at the given index.
Source code in src/SilverLingua/core/organisms/idearium.py
replace
¶
Replaces the notion at the given index with the given notion.
Source code in src/SilverLingua/core/organisms/idearium.py
copy
¶
copy() -> Idearium
Returns a copy of the Idearium.
Source code in src/SilverLingua/core/organisms/idearium.py
_trim
¶
Trims the Idearium to fit within the maximum number of tokens, called after every modification.
This is the primary point of extension for Idearium subclasses, as it allows for custom trimming behavior.