samae / marisa-trie

Automatically exported from code.google.com/p/marisa-trie
0 stars 0 forks source link

sequential indexes #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi ,

Is there any mechanism in marisa trie where i can retrieve the search 
candidates in an order,i mean if i search for 'b',

the search returns me

       id
b       7
ban    12
bang   13
ben    56
beng   57

and the ids are not sequential, is there a mechanism where i can retrieve the 
ids in a sequential order.
Note the strings are returned in a sequential order

Original issue reported on code.google.com by vinay.32...@gmail.com on 27 Feb 2012 at 1:59

GoogleCodeExporter commented 8 years ago
Basically, shorter keys have smaller IDs.
This is due to the data structure of marisa-trie.

So, marisa-trie cannot meet your request.

Original comment by susumu.y...@gmail.com on 28 Feb 2012 at 12:37

GoogleCodeExporter commented 8 years ago

Original comment by susumu.y...@gmail.com on 19 Aug 2012 at 11:42

GoogleCodeExporter commented 8 years ago
The status has been changed to done.does that mean now if i download a fresh 
version , does that marisa support sequential indices?

Original comment by vinay.32...@gmail.com on 20 Aug 2012 at 5:09

GoogleCodeExporter commented 8 years ago
Unfortunately not, it's the spec of marisa-trie.
To do this, we need another data structure.

Original comment by susumu.y...@gmail.com on 20 Aug 2012 at 9:15

GoogleCodeExporter commented 8 years ago
Could u pls let me know what other datastructure will do this.

Original comment by vinay.32...@gmail.com on 20 Aug 2012 at 9:54

GoogleCodeExporter commented 8 years ago
MARISA is actually a combination of Patricia-trie and LOUDS (Level-Order Unary 
Degree Sequence).

LOUDS is a succinct data structure for breadth-first trees. And *breadth-first* 
is the reason why MARISA does not support sequential order ID numbering.

On the other hand, DFUDS is a succinct data structure for depth-first trees. 
And *depth-first* enables sequential order ID numbering.

Original comment by susumu.y...@gmail.com on 20 Aug 2012 at 10:11