Computer representation of a data tree structure and the associated encoding/decoding methods
Abstract
Computer representation of an oriented tree representative of the organization of a data set, in particular of a data dictionary, each data being associated with a particular node of said tree, characterized in that a first range is associated with each node of said tree according to a first total order relationship and a second rank is associated with each node of said tree according to a second total order relationship, the same comprising a table of values stored in a memory, such that the first rank of a node is represented by a value that is stored in the address of the representative table of second rank of that node.

Term
Term ended
Projected expiry passed 21 February 2023, 3.6 years ago.
- Priority
- Filed
- Published
- Projected expiry
- Today
25 claims: 2 independent, 23 dependent
- 1ES 2 311 699 T3 REIVINDICACIONES 1. Representación informática de un árbol orientado representativo de la organización de un conjunto de datos, en particular de un diccionario de datos, cada dato estando asociado a un nodo particular de dicho árbol, caracterizada porque un primer rango está asociado a cada nodo de dicho árbol según una primera relación de orden total y un segundo rango está asociado a cada nodo de dicho árbol según una segunda relación de orden total, la misma comprendiendo una tabla de valores almacenados en una memoria, tal que el primer rango de un nodo está representado por un valor que está almacenado en la dirección de la tabla representativa de segundo rango de ese nodo.
- 2Representación informática según la reivindicación 1, caracterizada porque la primera relación de orden total es una combinación de una relación de orden de descendencia ordenando un nodo con respecto a sus descendientes, y de una relación de orden de primogenitura ordenando los nodos hijos de un mismo nodo.
- 3Representación informática según la reivindicación 2, caracterizada porque un primer nodo del árbol es inferior a un segundo nodo del árbol según dicha primera relación de orden total si el segundo nodo es un descendiente del primer nodo o si, el ancestro común del primer y segundo nodo tiene un primer hijo del cual desciende el primer nodo o confundido con éste último y un segundo hijo del cual desciende el segundo nodo o confundido con éste último, dicho primer hijo es inferior a dicho segundo hijo según la relación de orden de primogenitura.
- 4Representación informática según la reivindicación 2, caracterizada porque un primer nodo del árbol es superior a un segundo nodo del árbol según dicha primera relación de orden total si el segundo nodo es un descendiente del primer nodo o si, el ancestro común del primer y segundo nodo tiene un primer hijo del cual desciende el primer nodo o confundido con éste último y un segundo hijo del cual desciende el segundo nodo o confundido con éste último, dicho primer hijo es inferior a dicho segundo hijo según la relación de orden de primogenitura.
- 5Representación informática según una de las reivindicaciones de 2 a 4, caracterizada porque la segunda relación de orden total es una combinación de la relación de orden inversa de dicha relación de orden de descendencia y dicha relación de orden de primogenitura.
- 6Representación informática según la reivindicación 5, caracterizada porque un primer nodo del árbol es inferior a un segundo nodo del árbol según dicha segunda relación de orden total si el segundo nodo es un descendiente del primer nodo o si, el ancestro común del primer y segundo nodo tiene un primer hijo del cual desciende el primer nodo o confundido con éste último y un segundo hijo del cual desciende el segundo nodo o confundido con éste último, dicho primer hijo es inferior a dicho segundo hijo según la relación de orden de primogenitura.
- 7Representación informática según la reivindicación 5, caracterizada porque un primer nodo del árbol es superior a un segundo nodo del árbol según dicha segunda relación de orden total si el segundo nodo es un descendiente del primer nodo o si, el ancestro común del primer y segundo nodo tenga un primer hijo del cual desciende el primer nodo o confundido con éste último y un segundo hijo del cual desciende el segundo nodo o confundido con éste último, dicho primer hijo es inferior a dicho segundo hijo según la relación de orden de primogenitura.
- 8Representación informática según una de las reivindicaciones de 2 a 7, caracterizada porque, los datos son series de caracteres de un alfabeto provisto de un orden alfabético, cada arco de dicho árbol estando asociado a un carácter de al menos un dato, la relación de orden de primogenitura entre dos hijos de un mismo nodo está dada por la relación de orden alfabético de los caracteres asociados a los arcos respectivos entre dicho nodo y sus dos hijos.
- 9Método de codificación de un árbol orientado representativo de la organización de un conjunto de datos, especialmente de un diccionario, cada dato de dicho conjunto estando asociado a un nodo particular de dicho árbol, caracterizado porque se le atribuye a cada nodo de dicho árbol un primer y segundo Indice, el primer Indice siendo representativo del rango del nodo según una primera relación de orden total que ordena los nodos de dicho árbol, el segundo Indice siendo representativo del rango del nodo según una segunda relación de orden total, la primera relación de orden total siendo una combinación de una relación de orden de descendencia que ordena un nodo con respecto a sus descendientes y de una relación de orden de primogenitura que ordena los nodos hijos de un mismo nodo, la segunda relación de orden total siendo una combinación de la relación de orden inversa de dicha relación de orden de descendencia y dicha relación de orden de primogenitura, dicho método brindando un tabla en el cual son ordenados los valores representativos de los dichos primeros Indices de los nodos de dicho árbol en direcciones representativas de dichos segundos Indices de los nodos de dicho árbol.
- 10Método de codificación según la reivindicación 9, caracterizado porque comprende una llamada recurrente de una etapa de cálculo que brinda para un nodo cualquiera del árbol, el tamaño del subárbol resultante de dicho nodo.
- 11Método de codificación según la reivindicación 10, caracterizado porque, para un primer y segundo hijo de un mismo nodo, llamado nodo padre, adyacentes en una lista de hijos ordenados según dicha relación de orden de primogenitura, la etapa de cálculo determina el primer Indice del segundo hijo a partir del primer Indice del primer hijo y del tamaño del subárbol descendiente del primer hijo, y el segundo Indice del segundo hijo a partir del segundo Indice del primer hijo y del tamaño del subárbol del segundo hijo. ES 2 311 699 T3
- 12Método de codificación según la reivindicación 11, caracterizado porque dicha etapa de cálculo determina el primer Indice del hijo clasificado primero en dicha lista a partir del primer Indice de dicho nodo padre y el segundo Indice de dicho nodo padre a partir del segundo Indice del hijo clasificado último en dicha lista.
- 13Método de codificación según una de las reivindicaciones de 10 a 12, caracterizado porque dicha etapa de cálculo determina el tamaño del subárbol descendiente de dicho nodo padre a partir de la suma de los tamaños de los subárboles resultantes de sus hijos.
- 14Método de codificación según una de las reivindicaciones de 9 a 13, caracterizado porque opera sobre una primera representación de dicho árbol por medio de punteros en la cual, para un nodo dado, un primer tipo de puntero brinda un nodo hijo según la relación de orden de descendencia y un segundo tipo de puntero brinda la lista de sus otros hijos.
- 15Método de codificación según una de las reivindicaciones de 9 a 13, caracterizado porque brinda un tabla en la cual son ordenados los valores representativos de los dichos segundos Indices de los nodos de dicho árbol en direcciones representativas de dichos primeros Indices de los nodos de dicho árbol.
- 16Método de codificación de un dato de entrada perteneciente a un conjunto de datos organizadas según una estructura de árbol orientado, especialmente de un diccionario de datos, estando formadas los datos por series de caracteres de un alfabeto provisto de un orden alfabético, cada dato estando asociado a un nodo particular de dicho árbol y a cada arco de dicho árbol estando asociado un carácter, caracterizado porque, dicho árbol es representado por medio de la representación informática según una de las reivindicaciones de 1 a 8, se recorre el árbol de nodo en nodo según un camino que parte desde la raíz y se analiza dicho dato de entrada carácter por carácter, el nodo siguiente de un nodo corriente de dicho camino siendo escogido a través de los hijos de éste último, la elección siendo efectuada por medio de una sucesión de etapas de comparación, cada etapa de comparación comparando el carácter en curso de dicho dato de entrada y el carácter asociado al arco que une el nodo corriente con uno de sus hijos, siendo interrumpido el recorrido sólo cuando dicho dato de entrada fue enteramente analizado, el método proporcionando como valor codificado de dicho dato de entrada un Indice función de la dirección de la tabla de dicha representación informática representativa del último nodo de dicho camino.
- 17Método de codificación según la reivindicación 16, caracterizado porque dicho Indice es igual a la dirección representativa del último nodo de dicho camino.
- 18Método de codificación según la reivindicación 16, caracterizado porque dicho Indice es igual al valor almacenado en dicha tabla en la dirección representativa del último nodo de dicho camino.
- 19Método de codificación según una de las reivindicaciones de 16 a 18, caracterizado porque los hijos sucesivos del nodo corriente son determinados a partir de sus respectivas direcciones representativas en la tabla de dicha representación informática, obteniéndose la dirección representativa del hijo siguiente a un hijo corriente a partir de la dirección representativa del hijo corriente y del tamaño del subárbol resultante del hijo corriente.
- 20Método de codificación según la reivindicación 19, caracterizado porque el tamaño del subárbol resultante del hijo corriente es obtenido a partir del valor almacenado en dicha tabla en la dirección representativa del hijo corriente y del valor almacenado en dicha tabla en la dirección representativa del hijo precedente.
- 21Método de decodificación de un Indice representativo de un dato perteneciente a un conjunto de datos organizados según una estructura de árbol orientado, en particular de un diccionario de datos, formándose los datos por series de caracteres de un alfabeto provisto de un orden alfabético, cada dato estando asociada a un nodo particular de dicho árbol y a cada arco de dicho árbol estando asociado un carácter, caracterizado porque, dicho árbol es representado por medio de la representación informática según una de las reivindicaciones de 1 a 8, el árbol siendo recorrido según un camino que parte desde la raíz, el nodo siguiente de un nodo corriente de dicho camino siendo escogido a través de los hijos de éste último, efectuándose la elección por medio de una sucesión de etapas de comparación, cada etapa de comparación comparando dicho Indice a un Indice representativo de uno de dichos hijos en dicha representación informática, el método proporcionando como dato decodificado la cadena de caracteres asociada a los arcos que forman dicho camino.
- 22Método de codificación según la reivindicación 21, caracterizado porque dicho Indice representativo es una dirección en dicha tabla de la representación informática.
- 23Método de codificación según la reivindicación 21, caracterizado porque dicho Indice representativo es un valor almacenado en dicha tabla de la representación informática.
- 24Método de codificación según una de las reivindicaciones 21 a 23, caracterizado porque los hijos sucesivos del nodo corriente son determinados a partir de sus respectivas direcciones representativas en la tabla de dicha representación informática, obteniéndose la dirección representativa del hijo siguiente a un hijo corriente a partir de la dirección representativa del hijo corriente y del tamaño del subárbol resultante del hijo corriente. ES 2 311 699 T3
- 25Método de codificación según la reivindicación 24, caracterizado porque el tamaño del subárbol resultante del hijo corriente es obtenido a partir del valor almacenado en dicha tabla en la dirección representativa del hijo corriente y del valor almacenado en dicha tabla en la dirección representativa del hijo precedente.
Independent claims25
207 paragraphs in 11 sections, as filed
ES 2 311 699 T3
DESCRIPTION
Computer representation of a tree-like data structure and associated encoding / decoding methods.
The present invention relates to a computer representation of an oriented tree representing the organization of a data set, especially a dictionary. The present invention also relates to a method of coding said oriented tree in said computer representation. The present invention also relates to a method of encoding a data belonging to said set in an Index of said computer representation. The present invention finally refers to a decoding method that makes it possible to find the corresponding data from an Index of said computer representation.
Before exposing the state of the art, it is convenient to define a certain number of terms that will be used below.
An oriented graph (later simply called graph) is called a pair G = (S, A) where S is a set of vertices (later also called nodes) and A is a subset of SxS, called a set of arcs.
A graph path is an ordered series (s<sub>0</sub>, s<sub>B</sub>..., yes<sub>n</sub>) of vertices such that (s<sub>i-1</sub>, s<sub>i</sub>), is an arc, for i = 1, ... n, when s<sub>n</sub>= s<sub>0</sub> with n> 1, the path is called a loop or loop. A graph is said to be connected if any two nodes of the graph are joined by a path.
A tree is defined as a connected graph without a circuit. It can be shown that any two vertices of a tree are joined by a single path. A tree has a particular vertex R, such that every vertex s other than R is connected to the latter by a path. This particular vertex is called the root of the tree.
For a given vertex S, every vertex s is called a descendant of S<sub>d</sub> of the tree such that there is a path between sys<sub>d</sub>. Conversely, for a given vertex s, every vertex S is called the ancestor of s<sub>to</sub> of the tree such that there is a path between S<sub>to</sub> and yes. A child vertex of a vertex S is called a descendant s<sub>F</sub> from s such that (S, s<sub>F</sub>) e A. For every vertex s, of the tree the resulting subtree of s is called the tree of root s that includes all the descendants of s.
Finally, any vertex of the tree that does not have a descendant is called a leaf.
Many information processing methods refer to a representation of data according to a tree structure (or tree), especially methods of classification, understanding or storage of information.
The document Chang H: "Bubble structure and operation to facilitate free traversal", IBM Technical disclosure Bulletin, vol-26, no.9, discloses a bubble material and an algorithm that require at least two tables to represent a tree in a memory.
Depending on the type of application considered, the data can be character strings, phoneme series, waveforms, luminance / chrominance patterns, etc.
Without loss of generality, the data is considered below to consist of strings of elementary entities or characters (eg letters, symbols, figures, alphanumeric signs). The set of these possible characters constitutes an alphabet. This alphabet is supposed to be provided with a relationship of total order, called alphabetical order.
In many applications such as "search engines", "search in a directory", "search in a dictionary" etc., a very important volume of data must be able to be stored and accessed, which imposes severe restrictions in operating conditions in real time, especially for online accesses.
Each piece of data must be accessible quickly without the need for large computational resources. Also, to reduce access times, large volumes of data must reside in central memory. In order not to excessively increase the size of this memory, it is often necessary to carry out a prior compression of the data. Advantageously, the data must be able to be accessed without being decompressed, which would still penalize access times.
In the types of application considered above, an asymmetric treatment of the data is envisaged: the data compression phase can include a relatively long and complex treatment, although what allows its access and recovery must be simple and fast. In this way, the data can be stored in memory in a compressed and fixed form, being updated "off-line" before they are put online.
There is a data organization structure that lends itself particularly well to compression: that of the tree defined above. It is especially found in dictionaries or directories. A dictionary in the common sense of the word is a data file (also called entries), each data being made up of a string of alphabetic characters, the latter being organized according to a tree structure.
ES 2 311 699 T3
In practice, in a computer representation, each data in the dictionary is associated with an Index. Searching for a string of characters (or word) in the dictionary leads to identifying the Index of the corresponding word. In this way, a text can be represented by a series of Indices, more adapted to computer processing than the initial representation.
Different types of representation were proposed in the state of the art and especially:
- in the form of a dichotomy table, using a Ziv-Lempel compression
- in the form of a fragment table
- lexical tree shaped
These different types of representation lead to equivalent performances in case of perfect access. Perfect access is called an access mode where the exact character string is searched in the dictionary corresponding to the word to be analyzed, without taking into account errors or alterations.
The representation by lexical tree involves an analysis (or "parsing") of the character strings. An example of a lexical tree is given in Fig. 1 by the following dictionary Δ:
Δ = {abolish, abolition, appeal, attorney, bar, barrister, bench, case, court, crime}
It is observed that in the lexical tree, the arcs are associated with the characters of the words in the dictionary. More precisely, a label is associated with each arc of the tree, each label having a character as its mark. The lexical tree is the meeting of all the paths where the skeleton corresponds to a word in the dictionary. The skeleton of a path is called the string of the characters of the labels of the arcs that make up that path. A dictionary word is also called a dictionary “entry”.
It will be noted that the leaves of the lexical tree have been represented by circles although the other vertices have been represented by disks. The root of the tree has been indicated as R.
The tree is assumed to be indexed, which means that each vertex is associated with an Index. An elementary operation in a lexical tree is to search from a given word, the Index of the corresponding dictionary entry. This operation needs to traverse the tree according to the arcs labeled by the successive characters that make up the word.
In particular, the search algorithm starts a function Analyze Word that returns as a value the Index (Index-associated (s)) of the dictionary entry if the latter is present, or, by default, a non-identification code (Index -Unknown word). This is shown below in pseudo-C code:
Function NumberIndex ParsePa1 open (StringWordAnalysis, Root vertex)
Start
Vertex s = Root;
For each Character of Word Analysis Do
If word-end (AnalysisWord) and s is a sheet
Then return Associated-index (s);
If Character corresponds to a label of a descending arc of s
Then s = descendant-corresponding (s);
If not return Index-Word-is known;
End
ES 2 311 699 T3
Navigating the instructions s = corresponding-descendant (s) assumes that you have a computer representation of the lexical tree.
In general, it is necessary to have a computer representation of a tree to be able to easily navigate, use and modify it.
According to a first known computer representation, a tree is represented by an adjacency table M = (mjj) i = 0, ..., n; j = 0, ..., n stored in memory with m, j = 1 if (s ,, s,) e A.
According to a more common computer representation, a tree is represented as a series of computer pointers. According to a first known variant illustrated in Fig. 2A, each node is represented by a value (or Index) and a table of pointers pointing towards its child nodes. The size of the table corresponds to the maximum number of children (k) that a tree node can have (in this case the tree is called "k-air"). Fig. 2A shows an example of representation of a 3-air shaft according to this variant.
Encoding the children of a node through a pointer table has the drawback of consuming too much memory space when the tree contains a small number of nodes that have many children and numerous other nodes that have few children. According to a second known variant of representation, this difficulty is remedied by using for a given node a pointer towards one of its child nodes, called the eldest child, and a pointer from the eldest child to a linked list of its siblings. Fig. 2B shows an example of representation according to this second variant, for a 5-air shaft.
Pointers allow you to quickly modify the structure of the tree but are relatively expensive in memory space. Furthermore, the detection of a descent relationship between nodes is not immediate. It is supposed to determine the path that joins the two nodes, which, in the framework of a representation by pointers, involve significant computational resources. The number of calculations to be carried out can be considerably reduced by memorizing the transitive closure of the tree, in the event that a node points to each of its descendants. However, this last option is particularly voracious in memory space.
The basic problem of the invention is to propose a computer representation of a tree that takes up little memory space, which allows it to be easily traversed and simply modified.
This problem is solved by the computer representation of a tree representative of the organization of a data set, in particular a data dictionary, each data being associated to a particular node of said tree, this representation including a table of values stored in a memory, said values being representative of the ranks of the nodes of said tree ordered according to a first total order relationship, the addresses at which said values are stored being representative of the ranks of the nodes of said tree ordered according to a second total order relation.
Advantageously, the first total order relation is a combination of a descent order relation ordering a node with respect to its descendants and a primogeniture order relation ordering the child nodes of the same node.
According to a first embodiment, a first node of the tree is lower than a second node of the tree according to said first total order relationship if the second node is a descendant of the first node or if the common ancestor of the first and second nodes has a first child from which the first node descends or confused with the latter and a second child from which the second node descends or confused with the latter, said first son is inferior to said second son according to the relationship of order of primogeniture.
According to a second embodiment, a first node of the tree is superior to a second node of the tree according to said first total order relationship if the second node is a descendant of the first node or if the common ancestor of the first and second nodes has a first child from which the first node descends or confused with the latter and a second child from which the second node descends or confused with the latter, said first son is inferior to said second son according to the relationship of order of primogeniture.
Advantageously, the second total order relation is a combination of the inverse order relation of said descent order relation and of said primogeniture order relation.
According to a first variant, a first node of the tree is inferior to a second node of the tree according to said second total order relationship if the first node is a descendant of the second node or if the common ancestor of the first and second nodes has a first child from which the first node descends or confused with the latter and a second child from which the second node descends or confused with the latter, said first son is inferior to said second son according to the relationship of order of primogeniture.
According to a second variant, a first node of the tree is superior to a second node of the tree according to said second total order relationship if the first node is a descendant of the second node or if the common ancestor of the first and second node has a first child from which the first node descends or confused with the latter and a second child from which the second node descends or confused with the latter, said first son is inferior to said second son according to the relationship of order of primogeniture.
ES 2 311 699 T3
If the data are series of characters of an alphabet provided with an alphabetical order, each arc of said tree being associated with a character of at least one piece of data, the relation of order of primogeniture between two children of the same node can be given by the alphabetical order relationship between the characters associated with the respective arcs between said node and its two children.
The invention also relates to a method of coding an oriented tree representative of the organization of a data set, especially a dictionary, each data of said set being associated to a particular node of said tree, in which it is attributed to each node of said tree a first and second Index, the first Index being representative of the rank of the node according to a first total order relation ordering the nodes of said tree, the second Index being representative of the rank of the node according to a second total order relation, the first total order relation being a combination of a descent order relation ordering a node with respect to its descendants and a primogeniture order relation ordering the child nodes of the same node, the second total order relation being a combination of the inverse order relation of said descent order relation and said primogeniture order relation.
Advantageously, the coding method includes a recurring reference of a calculation step that provides, for any node of the tree, the size of the subtree resulting from said node.
For a first and second child of the same node, called parent node, adjacent in a list of children ordered according to said relationship of order of primogeniture, the calculation stage determines the first Index of the second child from the first Index of the first child and the size of the subtree resulting from the first child, and the second Index of the second child from the second Index of the first child and the size of the subtree resulting from the second child.
Said calculation step determines the first Index of the child ranked first in said list from the first Index of said parent node and the second Index of said parent node from the second Index of the child ranked last in said list.
Said calculation stage also determines the size of the subtree resulting from said parent node from the sum of the sizes of the subtrees resulting from its children.
Advantageously, said coding method operates on a first representation of said tree by means of pointers in which, for a given node, a first type of pointer provides a child node according to the descent order relationship and a second type of pointer provides the list of his other children.
The invention is also defined by a method of encoding an input data belonging to a set of data organized according to an oriented tree structure, especially a data dictionary, the data being formed by series of characters of an alphabet provided with a alphabetical order, each data being associated with a particular node of said tree and each arc of said tree being associated with a character, in which said tree is represented by means of the computer representation already mentioned, the tree is traversed from node to node according to a path starting from the root and said input data is analyzed character by character, the next node of a current node of said path being chosen through the latter's children, the choice being made through a succession of stages of comparison, each comparison stage comparing the character in progress of said input data and the character associated with the arc that joins the current node with one of its children, the journey being interrupted only when said input data was entirely analyzed, providing the method as a value encoded of said input data an Index as a function of the address of the table of said computer representation representative of the last node of said path.
The invention is also defined by a method of decoding a representative index of a data belonging to a set of data organized according to an oriented tree structure, in particular a data dictionary, the data being formed by series of characters from an alphabet provided in an alphabetical order, each data being associated with a particular node of said tree and each arc of said tree being associated with a character, in which said tree is represented by means of the computer representation already mentioned, the tree is traversed according to a path that starts from the root, the next node of a current node of said path, being chosen through the children of the latter, being carried out the choice by means of a succession of comparison stages, each comparison stage comparing said Index to a representative Index of one of said children in said computer representation, providing the method as decoded data the string of characters associated with the arcs that form said path.
The characteristics of the invention mentioned above, as well as others, will appear more clearly after reading the following description of certain embodiments, said description made in relation to the attached drawings, among which:
Fig. 1 represents a lexical tree;
Fig. 2A shows a first computer representation of a tree with the aid of pointers;
ES 2 311 699 T3
Fig. 2B shows a second computer representation of a tree with the aid of pointers;
Fig. 3A illustrates with an example a tree coding method according to a first embodiment of the invention;
Fig. 3B shows a first variant computer representation of the tree of Fig. 3A;
Fig. 3C shows a second variant of computer representation of the tree of Fig. 3A;
Fig. 4 illustrates a portion of the tree before indexing by prefix rank and postfix rank.
The idea behind the invention is to create a new computer representation of a tree from a new total order relationship, translating the dependency relationships between nodes.
The dependency relationship between nodes induces a partial order relationship on the set of nodes in the tree. For example, if it was suitable for two nodes if ys<sub>2</sub> of the tree that: yes> s<sub>2</sub> yes and only if yes<sub>2</sub> it is a descendant of if, it has an order relationship. However, this order is only a partial order since all the nodes of the tree cannot be compared in this way (for example, the children of the same node).
You can build a total order relationship on the nodes of a tree if you know how to order all the children of the same node. The order according to which the children of the same node are ordered will be conventionally called the primogeniture order. For a lexical tree, where the labels of the arcs contain the alphabetic characters, it may be convenient that two children si and s<sub>2</sub> of the same node S satisfy the relation if> s<sub>2</sub> if the character of the label associated with the arc (S, si) is preceded by that of the label associated with the arc (S, s<sub>2</sub>). Otherwise, the alphabetical order of the marks of the labels induces a primogeniture order on the child nodes of the same node.
>9 <
The combination of the partial order of descent relationship (noted below O) and the primogeniture relationship (noted below 'o <sub>p</sub> ) allows to obtain a total order relation on the set of nodes. This combination can be done in several different ways:
- prefix order relation (conventionally indicated <sub>pi</sub>^):
<img file="ES2311699T3_D0001.tif" />
where a 'and b' are the children of the common ancestor of a and b, such that a descends or is confused with a 'and b descends or is confused with b'.
In other words, node a is inferior to node b in the sense of prefix order if b is a descendant of a or a 'is an older brother of b'.
- Reverse prefix order relation (conventionally noted):
b * a if a * i> or a '* b' frep or P
- inverse postfix order relationship (conventionally stated):
a V. b if a <boa '* b' poxt? D p in other words, node a is inferior to node b in the sense of postfix order if a is a descendant of boa 'is an older brother of b'.
- inverse postfix order relationship (conventionally stated):
<img file="ES2311699T3_D0002.tif" />
ES 2 311 699 T3
Given that any two nodes of a tree are either descendants of each other or descendants of a common ancestor, the order relations defined above are total order relations.
< <£
The order relations (or χ<sub>Γβ?}</sub> ) Y <sub>pose</sub>. (or<sub>£ sop</sub> ) thus allow the set S of the tree nodes to be ordered entirely. In other words, each of the order relations can be associated with a “rank” function of S in [0, n], for example:
<img file="ES2311699T3_D0003.tif" />
such that s<sub>1</sub> s<sub>2</sub> if and only if PrefixRange (s<sub>1</sub>) <PrefixRange (s<sub>2</sub>)
<img file="ES2311699T3_D0004.tif" />
such that s<sub>1</sub> s<sub>2</sub> if and only if RangePosfix (s<sub>1</sub>) <PosfixRange (s<sub>2</sub>).
PrefixRange andPosfixRange are ordered set maps. In the same way you can define the and esop:
such that s<sub>1</sub> <fre-p
<img file="ES2311699T3_D0005.tif" />
s<sub>2</sub> yes Inverse PrefixRange (s<sub>1</sub>) <InversePrefixRange (s<sub>2</sub>)
<img file="ES2311699T3_D0006.tif" />
such that s<sub>1 tso</sub>^ s<sub>2</sub> if and only if InversePosfixRange (s<sub>1</sub>) <InversePosfixRange (s<sub>2</sub>).
According to a first embodiment, a bijection T of [0, n] in [0, n] defined by:
T: [0, n] -> [0, n]
T = RangePosfix or RangePrefix<sup>-1</sup>.
According to a variant of this first embodiment, the bijection T<sup>1</sup>.
In the same way, bijections formed by composition can be used: InversePosfixRange or PrefixRange.<sup>-1</sup>,PosfixRange or InversePrefixRange<sup>-1</sup> or InversePosfix Range or InversePrefix Range<sup>-1</sup> in other embodiments of the invention or, in their variants, the inverse of their bijections.
For the sake of simplicity, we will limit the discussion of the invention to the use of T and T bijections<sup>1</sup>, so that the other bijections can also be used.
Said bijection T can be represented in a computerized manner in the form of a first table of values stored in memory, the postfix range of a node being stored in an address representative of the prefix range of that node.
Similarly, the bijection T<sup>1</sup> It can be represented in a computerized way in the form of a second table of values stored in memory, the postfix range of a node being stored in an address representative of the prefix range of that node.
An example will help to better understand the interest and use of these bijections.
Fig. 3A illustrates a tree where nodes have been indexed by prefix ranges (in bold and underlined) and postfix ranges (in italics). The primogeniture order relationship, for example induced by an alphabetical order
ES 2 311 699 T3 on the markings of the labels in the case of a lexical tree, has been conventionally represented in the increasing direction from left to right. A pair is associated with each node s in this way:
(PrefixRange (s), PosfixRange (s))
These pairs are advantageously stored in a table by means of bijection T (Fig. 3B) or T<sup>1</sup>(Fig. 3C). In Fig. 3B the postfix range values have been stored in the addresses given by the corresponding prefix range values. Conversely, in Fig. 3C the prefix range values have been stored in the addresses given by the corresponding postfix range values.
A first advantage of the computer representation of the tree according to the invention is that it does not occupy a memory space of the size of the tree (n + 1) as opposed to a classical representation by pointers (Figs. 2A and 2B) that needs at least twice of memory space.
A second essential advantage of this computer representation is that it allows a dependency relationship between two nodes in the tree to be detected very simply. Indeed, to determine whether a node s<sub>2</sub> is dependent on a node s<sub>1</sub>, just compare PrefixRange (s<sub>1</sub>) to PrefixRange (s<sub>2</sub>) on one side, and PosfixRange (s<sub>1</sub>) toPosfixRange (s<sub>2</sub>) from elsewhere:
s<sub>2</sub> is dependent on s<sub>1</sub> if and only if you have:
Range Prefix (s<sub>2</sub>)> PrefixRange (yes) andPosfixRange (s2) <
Posfix Range (Yes)
In this way, in the example of Fig. 3A, it is verified that the node represented by the pair (PrefixRange, PosfixRange) = (5, 1) is well dependent on that represented by the pair (PrefixRange, PosfixRange) = (1 , 5) but not the one represented by the pair (PrefixRange, PosfixRange) = (22, 21).
In the same way, thanks to the table in Fig. 3B, it is very easy to determine the descendants or ancestors of a given node. For example, to determine the list of the descendants of node (8, 12), it is enough to sweep the table in the direction of increasing directions starting from address 8 and to search among the stored data for those that are less than postfix 12 (here 6, 10, 11, 7, 8, 9). These values indicate the postfix rank of the descendants of the node in question. To determine the list of the ancestors of the node (8, 12), simply sweep the table in the direction of decreasing directions starting from address 8 and search among the stored data for those that are less than postfix 12 (here 19 , 22). These values indicate the postfix ranks of the ancestors of the node in question.
It proceeds in a dual way from the table in Fig. 3C. Taking the previous example, it is enough, to determine the list of descendants, with deleting the table in the direction of decreasing directions starting from address 12 and searching among the stored data for those that are greater than prefix 8 (here 14, 10, 13, 12, 11, 9). These values indicate the prefix ranges of the descendants of the node in question. In the same way, to determine the list of ancestors of (8, 12), it is enough to sweep the table in the direction of increasing directions from address 12 and search among the stored data for those that are less than the prefix 8 (here 7, 0).
A third advantage of the computer representation according to the invention is that it allows an easy path of the tree, if it is from the root to the leaves, a path that is carried out, for example, when a string of characters (word) is analyzed with the help of a tree. lexical, if it is from the leaves to the root, a path that is carried out, for example, when a character string is generated from the Index of a node.
The path of the tree from the root to the leaves assumes that we know how to determine the children of a given node. As will be seen, the table in Fig. 3B (or that of Fig. 3C) allows them to be found quickly.
Suppose that the navigation algorithm searches for the children of node (12,8) and consider the table in Fig. 3B. The table is swept in the direction of increasing directions starting from address 8. As before, the data in the table less than 12 is searched. When a data x less than 12 is retained, the following data that are less are not considered. to x. In other words, the table continues to be swept until a data x 'greater than ax (but always less than the initial value 12) is found again. The process is iterated until the end of the table. Thus, in the present example, the value 6 that is retained (<12) is found first, then the value 10 that is also retained (6 <10 <12). The following values 7, 8, 9, are not retained since, if they are well below 12, they are not greater than the last retained value 10. The value 11 is retained next (10 <11 <12) but not the following values since they are greater than 12.
It proceeds in a dual way from the table in Fig. 3C. Taking the previous example, the table is swept in the direction of decreasing directions starting from address 12. As before, the stored data greater than the prefix 8 is searched for. When a data x greater than 8 is found, no more are considered the following data that are greater than x. In other words, the table is swept until a data is found again and
ES 2 311 699 T3 lower than x (but always higher than the initial value 8). The process is iterated until the beginning of the table is reached. Thus, in the present example, the value 14 that is retained (> 8) is found first and then the value 10 that is also retained (8 <10 <14). The following values 11,12,13 are not retained since, if they are well above 8, they are not less than the last retained value 10. The value 9 is retained next (8 <9 <10) but not the following values since they are greater than 8.
This way of determining the children of a given node may be suitable for small trees. However, as you will see later, for large trees, it is faster to directly calculate the prefix / postfix ranges of these children.
It will be noted that, if it had been used, instead of tables constructed from bijections T and T, tables constructed respectively from bijectionsInversePosfixRange orPrefixRange<sup>-1</sup>, PosfixRange or ReversePoefixRange<sup>-1 </sup>o InversePosfixRange oInversePoefixRange<sup>-1</sup> Or, from the inverses of their bijections, the children of a given node could have been determined in a similar way, at the eventual price of a change of direction of the sweep and / or change of direction of the inequalities.
In the same way, the path of a tree from its leaves to the root supposes that it is known to determine the father of a given node. Assuming that the navigation algorithm looks for the parent of a node (12, 8) and considering first of all the table of Fig. 3B. The table is swept in the direction of decreasing directions from address 8. The first data found greater than 12 gives the postfix indication of the father of the node in question (here 19).
With this understood, we proceed in a dual way from the table in Fig. 3C. In this case, the table is swept in the direction of increasing directions from address 12. The first data found below 8 gives the prefix indication of the father of the node in question (here 7).
To transform any tree into its computer representation, an operation called tree coding, the nodes must first be indexed. To code the tree in the form of a computer representation according to the invention, the nodes must be indexed by means of the PrefixRange andPosfixRange functions (or other equivalent functions seen above). Without loss of generality, we will limit the discussion of the indexing method according to the invention to two aforementioned functions.
The indexing method operates on a classic computer representation of the tree by means of pointers, such as that illustrated in Fig. 2B. This classical computer representation will be obtained in a known way from a file of dictionary entries. The vertical chain of pointers corresponds to a prefix relation of the inputs. The horizontal chain of the siblings of the same node is made according to the order of primogeniture, such that it inherits a classification of the marks of the labels.
The prefix range of the root is initialized to 0 and the tree is traversed starting from the root following the pointers of the oldest child until a leaf is reached (the one most to the left according to the representation convention chosen here). The postfix range of this sheet is initialized to 0.
Let now be a node S of the tree having as children s<sub>0</sub>, s<sub>1</sub>, ..., yes<sub>p</sub> ordered according to the increasing order of primogeniture (that is, ordered according to the horizontal chain), as illustrated in Fig. 4. There are the following relationships:
<img file="ES2311699T3_D0007.tif" />
where Γ (s) is the size of the resulting subtree of s.
ES 2 311 699 T3
Indexing by prefix range and postfix range can be carried out in a single step, starting from the root of the tree, using the recurring reference of a function that returns as a value, for a given vertex s, the size Γ (s) of the subtree that it turns out. This function is shown below in pseudo-C code:
TreeCode size function (vertex S, Prefix range, Postfix range, Bijection table)
Start
SizeSubTreesOfChildren = 0;
If S is a leaf Then {
Bijection [Prefix] = Postfix;
Return 1;
}
If not for all descendants of S Do {
TreeSize2 = TreeCode (s,
Prefix + 1,
Postfix + SizeSnbChildrenTree, Bijection);
Prefix + = SizeSv¡bTree;
SizeSubTreeOfChildren + = SizeSnbTree;
Bijection [Prefix] = Postfix + SizeSnbAx TreesOfChildren;
Return SizeSubTreesOfChildren + l;
End
It will be noted in the program above that the variable SubTreeSize is the size of the subtree resulting from the current child node (s) and that the variableSubTreeSizeOfChildren is the accumulated value of the sizes of the subtrees resulting from the already explored child nodes.
The TreeCode function directly creates a computer representation in the form of an Index table of the type of Fig. 3B, stored in memory. Once this computer representation is created, the initial representation by pointers, when rendered useless, is deleted from memory.
In the following, we will place ourselves, for the sake of simplicity, in the context of a dictionary organized according to a lexical tree, where each entry in the dictionary corresponds to a leaf in the tree. As has just been seen, a computer representation in the form of a table of the same size as that of the tree can be obtained by means of the coding method according to the invention.
This computer representation is advantageously used to search, from a given character string, the Index of the corresponding dictionary entry. Conventionally, the prefix range of the sheet will be taken as Index (alternatively, its inverse prefix range can be chosen). The index search refers to a first method of traversing the tree from the root to the leaves according to the invention.
Reciprocally, this computer representation is advantageously used to generate, from the Index of a dictionary entry, the corresponding character string. The generation of the character string refers to a second method of traversing the tree from the root to the leaves according to the invention.
The case of a search for the Index of a character string C is considered first. The tree is traversed from the root following the arcs where the labels have the successive characters of C.
ES 2 311 699 T3
Advantageously, the first method of tracing the tree from the root to the leaves according to the invention operates in the following way.
During the arrival of the first child s<sub>0</sub> of a node S, it is initialized:
<img file="ES2311699T3_D0008.tif" />
and the size Γ (s<sub>0</sub>) resulting from s<sub>0</sub> from:
Γ (s<sub>0</sub>) = PosfixRange (s<sub>0</sub>) - LastPosfix where LastPosfix is the postfix range of the last node where the subtree traversal was abandoned (in other words, the postfix range of the root of the last subtree exposed in the traversal). By way of illustration, if in Fig. 3A the postfix rank node 5 has not been retained because the arc that joins the root and that node does not have the desired character, the resulting subtree of that node is not traversed and is taken as LastPosfix = 5. The tour continues through the node of postfix range 19 and, if successful, through that of postfix range 12. The size of the subtree resulting from that node (first child s<sub>0</sub> of node S of postfix rank 19) is effectively 7.
The prefix ranges of the successive children s of S are then determined by means of the following recurrence relations:
Raago Prefix (If<sub>+</sub>i) - Ra.ngoPrefix (s ±) + Γ (si)
Γ (s<sub>i + 2</sub>) = PosfixRange (s<sub>1+1</sub>) - RangePosfix (Yes)
Each explored child s ,, is tested whether the current character c of C is equal to the character that has the label of the arc joining S to s ,. If this is not the case, the next child s exploration is continued.<sub>+1</sub> and so on I successively until the current character is found or all children of S.
When a given node S is reached, the name of its children is not known a priori. To do this, the size r (S) of the resulting subtree is advantageously memorized during node S scanning. Then, during the successive exploration of the children s ,, the variable SizeSubTreeOfChildren is brought up to date.
<img file="ES2311699T3_D0009.tif" />
And it is known that all the children s, of S were explored when:
<img file="ES2311699T3_D0010.tif" />
If all children have been scanned without the current character being found, the complete character string C does not correspond to a dictionary entry (at least a portion of C can be part of it). If the current character was found by one of the children s<sub>t</sub> then S = s<sub>t</sub> and the search cycle restarts with the next character. The process is iterated until a leaf of the tree is reached. The Index searched is the prefix range of this sheet. Advantageously, in order to be able to search for words that are prefixes one to another, such as "bar" and "barrister" in Fig. 1, an end-of-word marker can be added at the end of each word, for example a space character. In this case, all leaves in the tree have end-of-word markers.
In this way, it is possible to define a TreeTraversal function that returns, from a wordAnalysis string of characters, the prefix range of the leaf reached at the end of the tour. This function uses the computer representation of the tree according to the invention. Its pseudo-code is shown below:
ES 2 311 699 T3
Function IndexPrefix PathTree (AnalysisWord string, Bijection table)
Start
S = root;
Prefix (S) = 0; // Index prefix of the root SizeSubTree (S) = Bijection [Prefix (S)] + 1; LastPosfix = -1;
So much so that SubTreeSize (S) different from 1 {s = eldest child of S;
Prefix (s) = Prefix (S) + 1;
SizeSubTreesOfChildren = 0;
So much so that SizeSubTreeOfChildren <SubTreeSize (S) - 1; If CharacterInCourse corresponds to a label from S to s Then direct the path to the child s by making S = s;
If we<sub>2</sub> = next child of S;
Postfix (s) = Bijection [Prefix (S)];
SubTreeSize (s) = Postfix (s) - LastPosfix; Prefix (s<sub>2</sub>) = Prefix (s) + SizeSubTree (s); LastPosfix = Postfix (s); SizeSubTreeOfChildren + = SizeSubTree (s); Explore the next descendant by putting s = s<sub>2</sub> }
ReturnIncompleteRoute Code}
Return Prefix (S);
Reciprocally, if it is desired to generate from an Index / (supposedly equal to the prefix range of a leaf in the tree) the character string of the corresponding dictionary entry, a second traversal method is used according to the invention. This second method differs from the first in that the selection of the child node is from now on guided by the comparison of the prefix range of that node with the Index / searched. More precisely, the son s<sub>t</sub> is selected since the following relationship is verified:
<img file="ES2311699T3_D0011.tif" />
The Index / is thus approximated by increasing values of the prefix range of the explored nodes.
The second method refers to the same iterative calculation of the prefix ranks of the children of a given node S from the respective sizes of the subtrees r (si). The stopping criterion of the exploration of the children s, of a given node S is also based on a comparison of r (S) and the sum of the r (s) for the children already explored.
ES 2 311 699 T3
You can define a WordGeneration function that returns the corresponding character string from a PrefixGuide Index. This function also uses 1 the computer representation of the tree according to the invention. Its pseudo-C code is shown below:
Word Generation string function (PrefixGuide Index, Bijection table)
Start
S = root;
Prefix (S) = 0; // Index prefix of the root SizeSubTree (S) = Bijection [Prefix (S)] + 1; LastPosfix = -1;
So much so that TaxoañoSubArbol (S) different from 1 {s = eldest son of S;
Prefix (s) = Prefix (S) + 1; TaxoyearSubTreesOfChildren = 0;
So much that SizeSubTreeOfChildren <TaxoyearSubTree (S) -1 {s<sub>2</sub> = next child S;
Postfix (s) = Bijection [Prefix (S)]; SubTreeSize (s) = Postfix (s) - LastPosfix; Prefix (s<sub>2</sub>) = Prefix (s) + SizeSubTree (s);
If Prefix Guide <Prefix (s<sub>2</sub>) ;
Then {
Choose the path to the preceding child by doing
S = s;
Update CadenaGenerada}
Otherwise {
LastPosfix = Postfix (s); TaxoyearSubTreeOfChildren + = TaxoyearSubTree (s); explore the next descendant by putting s = s<sub>2</sub> }
}
Return CodeRouteIncoxopleto}
Return GeneratedString;
Contents11
15 sheets
Sheet 1 Sheet 2 Sheet 3 Sheet 4 Sheet 5 Sheet 6 Sheet 7 Sheet 8 Sheet 9 Sheet 10 Sheet 11 Sheet 12 Sheet 13 Sheet 14 Sheet 15
15 members in 9 offices
Priority claims5
| Document | Office | Kind | Date |
|---|---|---|---|
| 0202664 | France | A | |
| 0202664 | France | A | |
| 20020002664 | France | – | |
| 020266403718905 | – | – | – |
| FR20020002664 | – | – | – |
Members15
| Document | Office | Kind | |
|---|---|---|---|
| FR2836573A1 | France | A1 | |
| WO03073320A2 | World Intellectual Property Organization (WIPO) | A2 | |
| AU2003222939A1 | Australia | A1 | |
| WO03073320A3 | World Intellectual Property Organization (WIPO) | A3 | |
| EP1483693A2 | European Patent Office (EPO) | A2 | |
| US2005149471A1 | United States of America | A1 | |
| JP2005525625A | Japan | A | |
| EP1483693B1 | European Patent Office (EPO) | B1 | |
| AT403907T | Austria | T | |
| ATE403907T1 | Austria | T1 | |
| DE60322678D1 | Germany | D1 | |
| JP2008299867A | Japan | A | |
| ES2311699T3This record | Spain | T3 | |
| US7882109B2 | United States of America | B2 | |
| JP4805315B2 | Japan | B2 |
Numbers
- Publication
- 2311699
- Publication, DOCDB
- 2311699
- Publication, EPODOC
- ES2311699T
- Application
- 3718905
- Application, DOCDB
- 03718905
- Application, EPODOC
- ES20030718905T
Titles2
- Spanish
- REPRESENTACION INFORMATICA DE UNA ESTRUCTURA DE DATOS ARBORESCENTE Y METODOS DE CODIFICACION/DECODIFICACION ASOCIADOS.
- English
- INFORMATIC REPRESENTATION OF AN ARBORESCENT DATA STRUCTURE AND ASSOCIATED CODING / DECODING METHODS.
Classification
- CPC, 1
- G06F16/322
- IPC, 1
- G06F17 30