Closed GoogleCodeExporter closed 9 years ago
The `weight' is used as an input to marisa::Trie::build().
The `id' is used as an output, where `id' is an ID, as you mentioned.
If you specify weights, the order of a predictive_search() may vary.
But it is just a hint to boost the search performance.
The order of a search result is undefined.
Also note that the `weight' is overwritten with `id' in marisa::Trie::build().
Regards,
Original comment by susumu.y...@gmail.com
on 10 Dec 2011 at 12:59
Thanks for the reply.
I want to use weight for a purpose of storing an extra info for every
string may be frequency of every string .so can I do that.if I do that does
Id value get invalid.
Suppose if I'm not using weight ,I query for a string to marisa true,say I
get 10 results .and now if I build marisa trie without weight and then I
query for the same thing,I will get all the 10 entries right .?
On 10-Dec-2011 6:30 AM, <marisa-trie@googlecode.com> wrote:
Original comment by vinay.32...@gmail.com
on 10 Dec 2011 at 4:31
Weights are not available after marisa::Trie::build(), because they are used
and then discarded. If you want to keep weights associated with keys, like
values in a key-value store, please store the weights into an extra array. You
can get key IDs from the keyset.
If you don't give weights, marisa-trie uses the default weight (1.0). So, the
result does not change. But please note that the order may change.
Original comment by susumu.y...@gmail.com
on 10 Dec 2011 at 2:18
Original comment by susumu.y...@gmail.com
on 28 Feb 2012 at 12:19
Original issue reported on code.google.com by
vinay.32...@gmail.com
on 9 Dec 2011 at 2:37