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.
41
41
## Status
42
42
The package exposes almost all functionality of the ` fst ` crate, except for:
43
43
44
- - Combining the results of slicing, ` search ` and ` search_re ` with set operations
45
44
- Using raw transducers
46
45
47
46
@@ -83,6 +82,24 @@ m = Map.from_iter( file_iterator('/your/input/file/'), '/your/mmapped/output.fst
83
82
84
83
# re-open a file you built previously with from_iter()
85
84
m = 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' ]
86
103
```
87
104
88
105
You can’t perform that action at this time.
0 commit comments