Timeline for How to split one iterator into two?
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 15, 2015 at 23:25 | comment | added | lqdc |
That would generate n tries for n items in the iterable. Basically I want one object at the end, and you cannot pass another iterable to it once it's finished with the first one.
|
|
Jun 15, 2015 at 23:23 | comment | added | Ricardo Cárdenes |
I think the only important part there is if marisa_trie.Trie(iterable) returns the same as [marisa_trie.Trie([x]) for x in iterable] . Then you can call a and b separately for each key, and this works.
|
|
Jun 15, 2015 at 23:18 | comment | added | lqdc |
alright, replace a with def a(iterable): return marisa_trie.Trie(iterable) . So I was wrong when saying they are stateless. They expect the whole iterable to generate output and then it's read only after that. An example is from this package: github.com/kmike/marisa-trie
|
|
Jun 15, 2015 at 23:14 | comment | added | Ricardo Cárdenes | Well, if the functions are really stateless, then I don't see how this shouldn't work. Either that, or there's still something we need to learn about your problem | |
Jun 15, 2015 at 23:12 | comment | added | lqdc | well, they need the whole iterator to generate output. Like you cannot add to a trie once it's generated because it's read only after that. | |
Jun 15, 2015 at 23:10 | history | undeleted | Ricardo Cárdenes | ||
Jun 15, 2015 at 23:10 | history | edited | Ricardo Cárdenes | CC BY-SA 3.0 |
Even better
|
Jun 15, 2015 at 22:44 | history | deleted | Ricardo Cárdenes | via Vote | |
Jun 15, 2015 at 22:44 | history | answered | Ricardo Cárdenes | CC BY-SA 3.0 |