File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ package.
4141## Status
4242The package exposes almost all functionality of the ` fst ` crate, except for:
4343
44- - Combining the results of slicing, ` search ` and ` search_re ` with set operations
4544- Using raw transducers
4645
4746
@@ -83,6 +82,24 @@ m = Map.from_iter( file_iterator('/your/input/file/'), '/your/mmapped/output.fst
8382
8483# re-open a file you built previously with from_iter()
8584m = Map(path = ' /path/to/existing.fst' )
85+
86+ # slicing multiple sets efficiently
87+ a = Set.from_iter([" bar" , " foo" ])
88+ b = Set.from_iter([" baz" , " foo" ])
89+ list (UnionSet(a, b)[' ba' :' bb' ])
90+ [' bar' , ' baz' ]
91+
92+ # searching multiple sets efficiently
93+ a = Set.from_iter([" bar" , " foo" ])
94+ b = Set.from_iter([" baz" , " foo" ])
95+ list (UnionSet(a, b).search(' ba' , 1 )
96+ [' bar' , ' baz' ]
97+
98+ # searching multiple sets with a regex efficiently
99+ a = Set.from_iter([" bar" , " foo" ])
100+ b = Set.from_iter([" baz" , " foo" ])
101+ list (UnionSet(a, b).search_re(r ' b\w {2} ' )
102+ [' bar' , ' baz' ]
86103```
87104
88105
You can’t perform that action at this time.
0 commit comments