Open paucodeici opened 8 months ago
For the tree, we would need:
Would mean 2 data structures representing the same thing.
OR we just keep each nodes at their level to have a structure like level_0 = [Node_0] level_1 = [Node_1,Node_2,...] ...
It allows us when looking for upper level to simply loop through the ones in the upper level of the considered element.
And honestly, if optimization is a problem it can be tackled later...
Need to decide a data format we will apply for each classification.
The industrial classification all works as tree.
So we should implement a tree format, with as many branches and leaves we want.
Such a data is often recursive (since we do not know the depth at construction) and need a Node class.
A node is simply:
The search people could do are:
Other important elements are the links between classification.
For mapping from tree A to tree B we map each node of tree A to nodes of tree B. Three situations can occur:
For generality we prefer to consider 1 and 3 as the only options.
It leads to a mapping as a dict where
dict[Node in A] = [Node 1 in B, Node 2 in B, ..., Node N in B]
Mapping from A to B.
Another way is to create edge, as
edge: node_1: node_2: