architxt.simplification.simple_rewrite#
Functions
|
Rewrite a given forest into a valid schema, treating each tree as a distinct group. |
- architxt.simplification.simple_rewrite.simple_rewrite(forest, **_)[source]#
Rewrite a given forest into a valid schema, treating each tree as a distinct group.
Entities within a tree are grouped together, and duplicate entities are discarded. The function creates a unique group name for each distinct set of entities.
- Parameters:
forest (
Collection
[Tree
]) – Input forest consisting of a list of Tree objects.- Return type:
- Returns:
A new forest where each tree is restructured as a valid group. Already valid trees are kept as is.